Skip to content

Conversation

@mbaldessari
Copy link
Contributor

Tested with the following:

#!/bin/bash

regions="us-east-1 us-east-2 us-west-1 us-west-2 ca-central-1 ca-west-1 us-gov-east-1 us-gov-west-1 mx-central-1 sa-east-1 eu-west-1 eu-west-2 eu-west-3 eu-central-1 eu-north-1 eu-south-1 eu-south-2 eu-central-2 il-central-1 me-south-1 me-central-1 af-south-1 ap-northeast-1 ap-northeast-2 ap-northeast-3 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-east-1 ap-south-1 ap-south-2 ap-southeast-5 ap-southeast-7 cn-north-1 cn-northwest-1"

export AWS_PAGER=
for i in ${regions}; do
    out=$(aws ec2 describe-instance-type-offerings --location-type region --filters "Name=instance-type,Values=g5.2xlarge" --region "${i}" 2>&1)
    ret=$?
    if [ $ret -eq 0 ]; then
      echo -n "${i} "
    fi
done
echo ""

Got:

us-east-1 us-east-2 us-west-1 us-west-2 ca-central-1 sa-east-1 eu-west-1 eu-west-2 eu-west-3 eu-central-1 eu-north-1 ap-northeast-1 ap-northeast-2 ap-northeast-3 ap-southeast-1 ap-southeast-2 ap-south-1

Tested with the following:

    #!/bin/bash

    regions="us-east-1 us-east-2 us-west-1 us-west-2 ca-central-1 ca-west-1 us-gov-east-1 us-gov-west-1 mx-central-1 sa-east-1 eu-west-1 eu-west-2 eu-west-3 eu-central-1 eu-north-1 eu-south-1 eu-south-2 eu-central-2 il-central-1 me-south-1 me-central-1 af-south-1 ap-northeast-1 ap-northeast-2 ap-northeast-3 ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-4 ap-east-1 ap-south-1 ap-south-2 ap-southeast-5 ap-southeast-7 cn-north-1 cn-northwest-1"

    export AWS_PAGER=
    for i in ${regions}; do
        out=$(aws ec2 describe-instance-type-offerings --location-type region --filters "Name=instance-type,Values=g5.2xlarge" --region "${i}" 2>&1)
        ret=$?
        if [ $ret -eq 0 ]; then
          echo -n "${i} "
        fi
    done
    echo ""

Got:

us-east-1 us-east-2 us-west-1 us-west-2 ca-central-1 sa-east-1 eu-west-1 eu-west-2 eu-west-3 eu-central-1 eu-north-1 ap-northeast-1 ap-northeast-2 ap-northeast-3 ap-southeast-1 ap-southeast-2 ap-south-1
@sauagarwa sauagarwa merged commit d80c6d8 into validatedpatterns:main Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants