Files
aws-inventory/aws-s3.py
T
2026-01-22 09:31:32 +08:00

27 lines
468 B
Python
Executable File

#!/usr/bin/env python3
r"""
Documentation
License: This program is released under the MIT License
"""
# Imports
import boto3
# Main function
def main() -> None:
s3_client = boto3.client('s3')
# Get the list of all buckets
response = s3_client.list_buckets()
# Print the names of the buckets
print('Buckets')
for bucket in response['Buckets']:
print(f'{bucket["Name"]}')
# Call main function
if __name__ == '__main__':
main()