This file contains 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
Description | CIDR | |
---|---|---|
AWS environment | 10.0.0.0/16 | |
Shared VPC | 10.0.0.0/22 | |
Team A VPC | 10.0.4/0/22 | |
Team B VPC | 10.0.8.0/22 | |
Team C VPC | 10.0.12.0/22 | |
Team D VPC | 10.0.16/0/22 | |
On-premise IP range | 172.16.0.0/16 |
This file contains 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 boto3 | |
table_name = ‘sample_table’ | |
ssm = boto3.client('ssm') | |
table = boto3.resource('dynamodb').Table(table_name) | |
# Store current read and write capacity units. | |
ssm.put_parameter( | |
Name=’/dynamodb/{}/read_capacity_units’.format(table_name), | |
Value=str(table.provisioned_throughput[‘ReadCapacityUnits’]), |
This file contains 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 boto3 | |
client = boto3.client('rds') | |
db_instance_id = ‘id’ | |
# To stop a DB instance. | |
response = client.stop_db_instance( | |
DBInstanceIdentifier=db_instance_id | |
) |
This file contains 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 boto3 | |
ecs = boto3.client('ecs') | |
ssm = boto3.client('ssm') | |
cluster_name = “sample-cluster” | |
service_name = “sample-service” | |
# To stop the tasks | |
response = ecs.describe_services( | |
cluster=cluster_name, |
This file contains 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 boto3 | |
instance = boto3.resource('ec2').Instance('id') | |
# To stop the instance | |
instance.stop() | |
# To start the instance | |
instance.start() |