• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

region

AWS Search for RDS

January 3, 2022

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.

Filed Under: Cloud Tagged With: aws, cli, describe-instances, profile, rds, region, search

GCP List Disk Types

December 22, 2021

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

Filed Under: Cloud Tagged With: disks, filter, gcp, list, region, type

Copy S3 To Another Region

June 22, 2021

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.

Filed Under: Cloud Tagged With: another, copy, region, s3

AWS Copy AMI to another Region

March 2, 2021

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" }

Filed Under: Cloud Tagged With: ami, copy, ec2, region

AWS Copy Snapshot to another Region

March 2, 2021

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" }

Filed Under: Cloud Tagged With: aws, copy, disk, region, snapshot

AWS S3 Replication Policy

December 20, 2019

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/*" } ] }

Filed Under: Cloud Tagged With: aws, policy, region, replication, role, s3

  • Home
  • About
  • Archives

Copyright © 2023