Last active
April 2, 2020 10:06
-
-
Save kusw3/e893549589b3b34b26c98617535be089 to your computer and use it in GitHub Desktop.
Useful one liners calling aws api through cli
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
# Retrive list of running EC2 instances name and private ip address | |
aws ec2 describe-instances --query 'Reservations[].Instances[?State.Name==`running`].[Tags[?Key==`Name`]|[0].Value,PrivateIpAddress]' --output text |
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
# List ECR repositories | |
aws ecr describe-repositories --query 'repositories[*].repositoryName' --output text |
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
# Retrieve supported RDS engine version of a specific engine | |
aws rds describe-db-engine-versions --query 'DBEngineVersions[?Engine==`mysql`].[Engine,EngineVersion]' --output table | |
# List RDS instances | |
aws rds describe-db-instances --query 'DBInstances[].[DBInstanceIdentifier,Engine,AvailabilityZone,Endpoint.Address,Endpoint.Port]' --output table | |
# Force AZ failover of a RDS instance (for a single-AZ) | |
aws rds modify-db-instance --db-instance-identifier DBNAME --multi-az --apply-immediately | |
aws rds reboot-db-instance --db-instance-identifier DBNAME --force-failover # it takes some time to report AZ change | |
aws rds modify-db-instance --db-instance-identifier DBNAME --no-multi-az --apply-immediately |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment