Here’s a simple way to search for a RDS instance in AWS via CLI.
aws rds describe-db-instances \ --db-instance-identifier rds-instance-name \ --region us-east-1 \ --profile my-account |
You may have to cycle through accounts and regions to find it.
cloud engineer
Here’s a simple way to search for a RDS instance in AWS via CLI.
aws rds describe-db-instances \ --db-instance-identifier rds-instance-name \ --region us-east-1 \ --profile my-account |
aws rds describe-db-instances \ --db-instance-identifier rds-instance-name \ --region us-east-1 \ --profile my-account
You may have to cycle through accounts and regions to find it.
To list all disk types available in your project in all regions. Result is truncated.
$ gcloud compute disk-types list NAME ZONE VALID_DISK_SIZES pd-balanced 10GB-65536GB pd-ssd 10GB-65536GB pd-standard 200GB-65536GB pd-balanced 10GB-65536GB ... |
$ gcloud compute disk-types list NAME ZONE VALID_DISK_SIZES pd-balanced 10GB-65536GB pd-ssd 10GB-65536GB pd-standard 200GB-65536GB pd-balanced 10GB-65536GB ...
To list a specific region, use the filter option.
$ gcloud compute disk-types list --filter="zone~'us-central1'" NAME ZONE VALID_DISK_SIZES pd-balanced us-central1-a 10GB-65536GB pd-extreme us-central1-a 500GB-65536GB pd-ssd us-central1-a 10GB-65536GB pd-standard us-central1-a 10GB-65536GB pd-balanced us-central1-b 10GB-65536GB pd-extreme us-central1-b 500GB-65536GB pd-ssd us-central1-b 10GB-65536GB pd-standard us-central1-b 10GB-65536GB pd-balanced us-central1-c 10GB-65536GB pd-extreme us-central1-c 500GB-65536GB pd-ssd us-central1-c 10GB-65536GB pd-standard us-central1-c 10GB-65536GB pd-balanced us-central1-f 10GB-65536GB pd-extreme us-central1-f 500GB-65536GB pd-ssd us-central1-f 10GB-65536GB pd-standard us-central1-f 10GB-65536GB pd-balanced us-central1-d 10GB-65536GB pd-extreme us-central1-d 500GB-65536GB pd-ssd us-central1-d 10GB-65536GB pd-standard us-central1-d 10GB-65536GB |
$ gcloud compute disk-types list --filter="zone~'us-central1'" NAME ZONE VALID_DISK_SIZES pd-balanced us-central1-a 10GB-65536GB pd-extreme us-central1-a 500GB-65536GB pd-ssd us-central1-a 10GB-65536GB pd-standard us-central1-a 10GB-65536GB pd-balanced us-central1-b 10GB-65536GB pd-extreme us-central1-b 500GB-65536GB pd-ssd us-central1-b 10GB-65536GB pd-standard us-central1-b 10GB-65536GB pd-balanced us-central1-c 10GB-65536GB pd-extreme us-central1-c 500GB-65536GB pd-ssd us-central1-c 10GB-65536GB pd-standard us-central1-c 10GB-65536GB pd-balanced us-central1-f 10GB-65536GB pd-extreme us-central1-f 500GB-65536GB pd-ssd us-central1-f 10GB-65536GB pd-standard us-central1-f 10GB-65536GB pd-balanced us-central1-d 10GB-65536GB pd-extreme us-central1-d 500GB-65536GB pd-ssd us-central1-d 10GB-65536GB pd-standard us-central1-d 10GB-65536GB
To a list a specific region and local SSDs only.
gcloud compute disk-types list --filter="zone~'us-central1' AND name~'local-'" NAME ZONE VALID_DISK_SIZES local-ssd us-central1-a 375GB-375GB local-ssd us-central1-b 375GB-375GB local-ssd us-central1-c 375GB-375GB local-ssd us-central1-f 375GB-375GB local-ssd us-central1-d 375GB-375GB |
gcloud compute disk-types list --filter="zone~'us-central1' AND name~'local-'" NAME ZONE VALID_DISK_SIZES local-ssd us-central1-a 375GB-375GB local-ssd us-central1-b 375GB-375GB local-ssd us-central1-c 375GB-375GB local-ssd us-central1-f 375GB-375GB local-ssd us-central1-d 375GB-375GB
Buckets are regional. Your source and destination buckets should be in different regions.
aws s3 sync s3://DOC-EXAMPLE-BUCKET-SOURCE s3://DOC-EXAMPLE-BUCKET-TARGET |
aws s3 sync s3://DOC-EXAMPLE-BUCKET-SOURCE s3://DOC-EXAMPLE-BUCKET-TARGET
Use the sync command. It will copy new or modified files.
Here’s how to copy an AMI to another region.
aws ec2 copy-image \ --source-image-id ami-xxxxxxxxxxx \ --source-region us-east-1 \ --region us-east-2 \ --name "My DR server" |
aws ec2 copy-image \ --source-image-id ami-xxxxxxxxxxx \ --source-region us-east-1 \ --region us-east-2 \ --name "My DR server"
Output:
{ "ImageId": "ami-xxxxxxxxxxx" } |
{ "ImageId": "ami-xxxxxxxxxxx" }
If you need to copy a snapshot from one region to another, here’s the AWS CLI command.
aws ec2 copy-snapshot \ --region us-east-1 \ --source-region us-east-2 \ --source-snapshot-id snap-xxxxxxxxxxxxxxxxx \ --description "This is the DR snapshot copy" |
aws ec2 copy-snapshot \ --region us-east-1 \ --source-region us-east-2 \ --source-snapshot-id snap-xxxxxxxxxxxxxxxxx \ --description "This is the DR snapshot copy"
Output:
{ "SnapshotId": "snap-xxxxxxxxxxxxxxxxx" } |
{ "SnapshotId": "snap-xxxxxxxxxxxxxxxxx" }
Here’s the policy for S3 replication between regions.
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:Get*", "s3:ListBucket" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::source-bucket-name", "arn:aws:s3:::source-bucket-name/*" ] }, { "Action": [ "s3:ReplicateObject", "s3:ReplicateDelete", "s3:ReplicateTags", "s3:GetObjectVersionTagging" ], "Effect": "Allow", "Resource": "arn:aws:s3:::destination-bucket-name/*" } ] } |
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:Get*", "s3:ListBucket" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::source-bucket-name", "arn:aws:s3:::source-bucket-name/*" ] }, { "Action": [ "s3:ReplicateObject", "s3:ReplicateDelete", "s3:ReplicateTags", "s3:GetObjectVersionTagging" ], "Effect": "Allow", "Resource": "arn:aws:s3:::destination-bucket-name/*" } ] }