Last active
April 13, 2017 16:17
-
-
Save ozgurakan/efef0c3928fdb00f4eade006dd2f6de6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
def is_s3_enabled(result): | |
attributes = result['Attributes'] | |
s3_logs_enabled = False | |
for attribute in attributes: | |
if attribute['Key'] == 'access_logs.s3.enabled': | |
if attribute['Value'].title() == 'True': | |
s3_logs_enabled = True | |
break | |
return s3_logs_enabled | |
result = { | |
"Attributes": [ | |
{ | |
"Value": "True", | |
"Key": "access_logs.s3.enabled" | |
}, | |
{ | |
"Value": "60", | |
"Key": "idle_timeout.timeout_seconds" | |
}, | |
{ | |
"Value": "", | |
"Key": "access_logs.s3.prefix" | |
}, | |
{ | |
"Value": "false", | |
"Key": "deletion_protection.enabled" | |
}, | |
{ | |
"Value": "", | |
"Key": "access_logs.s3.bucket" | |
} | |
] | |
} | |
if is_s3_enabled(result): | |
print("S3 Access Logs is enabled") | |
else: | |
print("S3 Access Logs is not enabled") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment