Created
October 13, 2019 19:04
-
-
Save sanampatel/215d24ba1c5b86a5ae183bc827d15cd9 to your computer and use it in GitHub Desktop.
Print all S3 Buckets name from AWS Lambda Function
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
| import json | |
| import boto3 | |
| print('Loading function') | |
| s3 = boto3.resource('s3') | |
| def lambda_handler(event, context): | |
| for bucket in s3.buckets.all(): | |
| print(bucket.name) | |
| # print("Received event: " + json.dumps(event, indent=2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment