Python script to parse through an S3 folder(including subfolders) and get the list of all its objects in a CSV file.

Requirement was to create a s3 manifest file for s3 batch job operation. More details around s3 manifest file can be found here. import boto3 from datetime import datetime import csv import logging import argparse today = datetime.today().strftime('%Y-%m-%d') now = datetime.today() print(now) logging.basicConfig(filename='backup_manifest_file_generation_'+today+'.log', level=logging.INFO) rows = [] larger_files = [] def get_matching_s3_keys(bucket, prefix='', suffix=''): """... Continue Reading →

Delete AWS EC2 Snapshots and AMIs older than certain no. of days – Python

Businesses are using the AWS cloud to enable faster disaster recovery of their critical IT systems without incurring the infrastructure expense of a second physical site. The AWS cloud supports many popular disaster recovery (DR) architectures from “pilot light” environments that may be suitable for small customer workload data center failures to “hot standby” environments... Continue Reading →

AWS Key Management

How to list/revoke the grants attached to a resource for a particular KMS key? Basically there is a limit on "Grants for a given principal per CMK" which is 30 i.e., no more than 30 grants can specify the same grantee principal. For ex: in case of redshift in us-east-1 region, the grantee principal is ‘redshift.us-east-1.amazonaws.com’.... Continue Reading →

Create a website or blog at WordPress.com

Up ↑