Created
October 13, 2019 19:04
-
-
Save sanampatel/6bf4f330503b4dcc2c0550164f29acd4 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