Skip to content

[PERSONAL] Scripts to automate management of AWS resources using Python

Notifications You must be signed in to change notification settings

williamlewis/boto3-mgmt-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 

Repository files navigation

boto3-mgmt-events (Personal)

Scripts to automate management of AWS resources using Python


When learning AWS, you must frequently create, modify, and delete resources for demo and test purposes.

Using Boto3 scripting, these repetitive actions can be automated for expediency and can help ensure that demo resources have been removed to avoid incurring unexpected costs.

Included Services: S3, EC2, DynamoDB, SNS, Lambda, CloudWatch Logs, CloudWatch


Boto3 Documentation


Description Classes Methods / Collections Link ↗

S3

Create a new S3 bucket S3. ServiceResource .create_bucket() s3 create bucket.py
Delete a specific S3 bucket including all objects and object versions within S3. ServiceResource -- s3 delete bucket and objects.py
S3. Bucket .objects.all() .delete()
S3. Object .object_versions_delete() .delete()
Delete a single object from an S3 bucket S3. Client .delete_object() s3 delete object.py
List all current S3 buckets S3. Client .list_buckets() s3 list all buckets.py
List all objects in a specific S3 bucket S3. Client .list_objects() s3 list objects in bucket.py
Upload a local file to an S3 bucket S3. ServiceResource .meta.client s3 upload local file.py
S3. Client .upload_file()
Find and delete all S3 buckets, including objects and object versions S3. ServiceResource .buckets.all() s3 delete all buckets and objects.py
S3. Bucket .object_versions.delete() .delete()

EC2

Launch a specified number of new instances from defined AMI & instance type EC2. Client .run_instances() ec2 launch new instances.py
List out InstanceId attribute for all current instances EC2. ServiceResource .instances.all() ec2 get all instance ids.py
Deregister (delete) a custom machine image from a specific region EC2. ServiceResource -- ec2 deregister ami.py
EC2. Image .deregister()
Delete self-owned instance snapshots EC2. ServiceResource .snapshots.filter() ec2 delete snapshots.py
EC2. Snapshot .delete()
Terminate all current EC2 instances EC2. ServiceResource .instances.all() ec2 terminate all instances.py
EC2. Instance .terminate()

DynamoDB

Delete a table in DynamoDB DynamoDB. ServiceResource -- dynamodb delete table.py
DynamoDB. Table .delete()

SNS

Delete an SNS topic and related subscriptions SNS. Client .delete_topic() sns delete topic.py

Lambda

Delete a specific Lambda function Lambda. Client .delete_function() lambda delete function.py

CloudWatch Logs

Find and delete log groups from CloudWatchLogs CloudWatchLogs. Client .describe_log_groups() .delete_log_group() cloudwatchlogs delete log groups.py

CloudWatch

Delete CloudWatch metric alarms CloudWatch. ServiceResource .alarms.all() cloudwatch delete alarms.py
CloudWatch. Alarm .delete()

About

[PERSONAL] Scripts to automate management of AWS resources using Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages