diff --git a/examples/README.md b/examples/README.md index c69d808b..9b95aee3 100644 --- a/examples/README.md +++ b/examples/README.md @@ -8,8 +8,7 @@ ``` export AWS_PROFILE= -export AWS_REGION= -export AWS_DEFAULT_REGION="$AWS_REGION" +export AWS_DEFAULT_REGION= ``` * Export the following environment variables diff --git a/examples/apps/colorapp/ecs/create-task-defs.sh b/examples/apps/colorapp/ecs/create-task-defs.sh index 2190b93d..98d40892 100755 --- a/examples/apps/colorapp/ecs/create-task-defs.sh +++ b/examples/apps/colorapp/ecs/create-task-defs.sh @@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -stack_output=$(aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +stack_output=$(aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ cloudformation describe-stacks --stack-name "${ENVIRONMENT_NAME}-ecs-cluster" \ | jq '.Stacks[].Outputs[]') @@ -26,12 +26,12 @@ envoy_container_json=$(jq -n \ --arg APPMESH_XDS_ENDPOINT "${APPMESH_XDS_ENDPOINT}" \ --arg ENVOY_LOG_LEVEL $envoy_log_level \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorgateway-envoy" \ -f "${DIR}/envoy-container.json") xray_container_json=$(jq -n \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorgateway-xray" \ -f "${DIR}/xray-container.json") task_def_json=$(jq -n \ @@ -40,7 +40,7 @@ task_def_json=$(jq -n \ --arg COLOR_TELLER_ENDPOINT "colorteller.$SERVICES_DOMAIN:9080" \ --arg TCP_ECHO_ENDPOINT "tcpecho.$SERVICES_DOMAIN:2701" \ --arg APP_IMAGE $COLOR_GATEWAY_IMAGE \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ --arg AWS_LOG_STREAM_PREFIX_APP "colorgateway-app" \ --arg TASK_ROLE_ARN $task_role_arn \ @@ -48,7 +48,7 @@ task_def_json=$(jq -n \ --argjson ENVOY_CONTAINER_JSON "${envoy_container_json}" \ --argjson XRAY_CONTAINER_JSON "${xray_container_json}" \ -f "${DIR}/colorgateway-base-task-def.json") -task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ ecs register-task-definition \ --cli-input-json "$task_def_json") colorgateway_task_def_arn=($(echo $task_def \ @@ -61,12 +61,12 @@ envoy_container_json=$(jq -n \ --arg APPMESH_XDS_ENDPOINT "${APPMESH_XDS_ENDPOINT}" \ --arg ENVOY_LOG_LEVEL $envoy_log_level \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorteller-white-envoy" \ -f "${DIR}/envoy-container.json") xray_container_json=$(jq -n \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorteller-white-xray" \ -f "${DIR}/xray-container.json") task_def_json=$(jq -n \ @@ -74,7 +74,7 @@ task_def_json=$(jq -n \ --arg STAGE "$APPMESH_STAGE" \ --arg COLOR "white" \ --arg APP_IMAGE $COLOR_TELLER_IMAGE \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ --arg AWS_LOG_STREAM_PREFIX_APP "colorteller-white-app" \ --arg TASK_ROLE_ARN $task_role_arn \ @@ -82,7 +82,7 @@ task_def_json=$(jq -n \ --argjson ENVOY_CONTAINER_JSON "${envoy_container_json}" \ --argjson XRAY_CONTAINER_JSON "${xray_container_json}" \ -f "${DIR}/colorteller-base-task-def.json") -task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ ecs register-task-definition \ --cli-input-json "$task_def_json") colorteller_white_task_def_arn=($(echo $task_def \ @@ -95,12 +95,12 @@ envoy_container_json=$(jq -n \ --arg APPMESH_XDS_ENDPOINT "${APPMESH_XDS_ENDPOINT}" \ --arg ENVOY_LOG_LEVEL $envoy_log_level \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorteller-red-envoy" \ -f "${DIR}/envoy-container.json") xray_container_json=$(jq -n \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorteller-red-xray" \ -f "${DIR}/xray-container.json") task_def_json=$(jq -n \ @@ -108,7 +108,7 @@ task_def_json=$(jq -n \ --arg STAGE "$APPMESH_STAGE" \ --arg COLOR "red" \ --arg APP_IMAGE $COLOR_TELLER_IMAGE \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ --arg AWS_LOG_STREAM_PREFIX_APP "colorteller-red-app" \ --arg TASK_ROLE_ARN $task_role_arn \ @@ -116,7 +116,7 @@ task_def_json=$(jq -n \ --argjson ENVOY_CONTAINER_JSON "${envoy_container_json}" \ --argjson XRAY_CONTAINER_JSON "${xray_container_json}" \ -f "${DIR}/colorteller-base-task-def.json") -task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ ecs register-task-definition \ --cli-input-json "$task_def_json") colorteller_red_task_def_arn=($(echo $task_def \ @@ -129,12 +129,12 @@ envoy_container_json=$(jq -n \ --arg APPMESH_XDS_ENDPOINT "${APPMESH_XDS_ENDPOINT}" \ --arg ENVOY_LOG_LEVEL $envoy_log_level \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorteller-blue-envoy" \ -f "${DIR}/envoy-container.json") xray_container_json=$(jq -n \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorteller-blue-xray" \ -f "${DIR}/xray-container.json") task_def_json=$(jq -n \ @@ -142,7 +142,7 @@ task_def_json=$(jq -n \ --arg STAGE "$APPMESH_STAGE" \ --arg COLOR "blue" \ --arg APP_IMAGE $COLOR_TELLER_IMAGE \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ --arg AWS_LOG_STREAM_PREFIX_APP "colorteller-blue-app" \ --arg TASK_ROLE_ARN $task_role_arn \ @@ -150,7 +150,7 @@ task_def_json=$(jq -n \ --argjson ENVOY_CONTAINER_JSON "${envoy_container_json}" \ --argjson XRAY_CONTAINER_JSON "${xray_container_json}" \ -f "${DIR}/colorteller-base-task-def.json") -task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ ecs register-task-definition \ --cli-input-json "$task_def_json") colorteller_blue_task_def_arn=($(echo $task_def \ @@ -163,12 +163,12 @@ envoy_container_json=$(jq -n \ --arg APPMESH_XDS_ENDPOINT "${APPMESH_XDS_ENDPOINT}" \ --arg ENVOY_LOG_LEVEL $envoy_log_level \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorteller-black-envoy" \ -f "${DIR}/envoy-container.json") xray_container_json=$(jq -n \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg AWS_LOG_STREAM_PREFIX_ENVOY "colorteller-black-xray" \ -f "${DIR}/xray-container.json") task_def_json=$(jq -n \ @@ -176,7 +176,7 @@ task_def_json=$(jq -n \ --arg STAGE "$APPMESH_STAGE" \ --arg COLOR "black" \ --arg APP_IMAGE $COLOR_TELLER_IMAGE \ - --arg AWS_REGION $AWS_REGION \ + --arg AWS_REGION $AWS_DEFAULT_REGION \ --arg ECS_SERVICE_LOG_GROUP $ecs_service_log_group \ --arg AWS_LOG_STREAM_PREFIX_APP "colorteller-black-app" \ --arg TASK_ROLE_ARN $task_role_arn \ @@ -184,7 +184,7 @@ task_def_json=$(jq -n \ --argjson ENVOY_CONTAINER_JSON "${envoy_container_json}" \ --argjson XRAY_CONTAINER_JSON "${xray_container_json}" \ -f "${DIR}/colorteller-base-task-def.json") -task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +task_def=$(aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ ecs register-task-definition \ --cli-input-json "$task_def_json") colorteller_black_task_def_arn=($(echo $task_def \ diff --git a/examples/apps/colorapp/ecs/ecs-colorapp.sh b/examples/apps/colorapp/ecs/ecs-colorapp.sh index f4727a48..8ac04d1c 100755 --- a/examples/apps/colorapp/ecs/ecs-colorapp.sh +++ b/examples/apps/colorapp/ecs/ecs-colorapp.sh @@ -7,7 +7,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" # Creating Task Definitions source ${DIR}/create-task-defs.sh -aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ cloudformation deploy \ --stack-name "${ENVIRONMENT_NAME}-ecs-colorapp" \ --capabilities CAPABILITY_IAM \ diff --git a/examples/apps/colorapp/kubernetes/generate-templates.sh b/examples/apps/colorapp/kubernetes/generate-templates.sh index 86234d9a..7723a0fe 100755 --- a/examples/apps/colorapp/kubernetes/generate-templates.sh +++ b/examples/apps/colorapp/kubernetes/generate-templates.sh @@ -56,7 +56,7 @@ spec: - name: "ENVOY_LOG_LEVEL" value: "debug" - name: "AWS_REGION" - value: "${AWS_REGION}" + value: "${AWS_DEFAULT_REGION}" initContainers: - name: proxyinit image: 111345817488.dkr.ecr.us-west-2.amazonaws.com/aws-appmesh-proxy-route-manager @@ -131,7 +131,7 @@ spec: - name: "ENVOY_LOG_LEVEL" value: "debug" - name: "AWS_REGION" - value: ${AWS_REGION} + value: ${AWS_DEFAULT_REGION} initContainers: - name: proxyinit image: 111345817488.dkr.ecr.us-west-2.amazonaws.com/aws-appmesh-proxy-route-manager @@ -207,7 +207,7 @@ spec: - name: "ENVOY_LOG_LEVEL" value: "debug" - name: "AWS_REGION" - value: ${AWS_REGION} + value: ${AWS_DEFAULT_REGION} initContainers: - name: proxyinit image: 111345817488.dkr.ecr.us-west-2.amazonaws.com/aws-appmesh-proxy-route-manager @@ -282,7 +282,7 @@ spec: - name: "ENVOY_LOG_LEVEL" value: "debug" - name: "AWS_REGION" - value: ${AWS_REGION} + value: ${AWS_DEFAULT_REGION} initContainers: - name: proxyinit image: 111345817488.dkr.ecr.us-west-2.amazonaws.com/aws-appmesh-proxy-route-manager @@ -357,7 +357,7 @@ spec: - name: "ENVOY_LOG_LEVEL" value: "debug" - name: "AWS_REGION" - value: ${AWS_REGION} + value: ${AWS_DEFAULT_REGION} initContainers: - name: proxyinit image: 111345817488.dkr.ecr.us-west-2.amazonaws.com/aws-appmesh-proxy-route-manager diff --git a/examples/apps/colorapp/servicemesh/.region-config.sh b/examples/apps/colorapp/servicemesh/.region-config.sh index 0c4b3195..cb4414e6 100644 --- a/examples/apps/colorapp/servicemesh/.region-config.sh +++ b/examples/apps/colorapp/servicemesh/.region-config.sh @@ -1,3 +1,18 @@ -SUPPORTED_REGIONS=(eu-west-1 us-east-1 us-east-2 us-west-2) +SUPPORTED_REGIONS=(\ + ap-south-1 \ + ap-northeast-3 \ + ap-northeast-2 \ + ap-northeast-1 \ + ap-southeast-2 \ + ap-southeast-1 \ + ca-central-1 \ + eu-central-1 \ + eu-west-1 \ + eu-west-2 \ + us-east-1 \ + us-east-2 \ + us-west-1 \ + us-west-2 + ) DEFAULT_REGION=us-west-2 diff --git a/examples/apps/colorapp/servicemesh/appmesh-colorapp.sh b/examples/apps/colorapp/servicemesh/appmesh-colorapp.sh index 6bf033ee..1f454b9d 100755 --- a/examples/apps/colorapp/servicemesh/appmesh-colorapp.sh +++ b/examples/apps/colorapp/servicemesh/appmesh-colorapp.sh @@ -4,7 +4,7 @@ set -ex DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ cloudformation deploy \ --stack-name "${ENVIRONMENT_NAME}-appmesh-colorapp" \ --capabilities CAPABILITY_IAM \ diff --git a/examples/apps/colorapp/src/colorteller/deploy.sh b/examples/apps/colorapp/src/colorteller/deploy.sh index 5637281b..0245de2f 100755 --- a/examples/apps/colorapp/src/colorteller/deploy.sh +++ b/examples/apps/colorapp/src/colorteller/deploy.sh @@ -12,5 +12,5 @@ fi docker build -t $COLOR_TELLER_IMAGE . # push -$(aws ecr get-login --no-include-email --region $AWS_REGION --profile $AWS_PROFILE) +$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --profile $AWS_PROFILE) docker push $COLOR_TELLER_IMAGE diff --git a/examples/apps/colorapp/src/gateway/deploy.sh b/examples/apps/colorapp/src/gateway/deploy.sh index e48e0466..2b693801 100755 --- a/examples/apps/colorapp/src/gateway/deploy.sh +++ b/examples/apps/colorapp/src/gateway/deploy.sh @@ -13,8 +13,8 @@ docker build -t $COLOR_GATEWAY_IMAGE . # push if [ -z $AWS_PROFILE ]; then - $(aws ecr get-login --no-include-email --region $AWS_REGION) + $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION) else - $(aws ecr get-login --no-include-email --region $AWS_REGION --profile $AWS_PROFILE) + $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --profile $AWS_PROFILE) fi docker push $COLOR_GATEWAY_IMAGE diff --git a/examples/infrastructure/appmesh-mesh.sh b/examples/infrastructure/appmesh-mesh.sh index ff8a36ee..6658a2e8 100755 --- a/examples/infrastructure/appmesh-mesh.sh +++ b/examples/infrastructure/appmesh-mesh.sh @@ -4,7 +4,7 @@ set -ex DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ cloudformation deploy \ --stack-name "${ENVIRONMENT_NAME}-appmesh-mesh" \ --capabilities CAPABILITY_IAM \ diff --git a/examples/infrastructure/ecs-cluster.sh b/examples/infrastructure/ecs-cluster.sh index 1e3832ec..eb32c89e 100755 --- a/examples/infrastructure/ecs-cluster.sh +++ b/examples/infrastructure/ecs-cluster.sh @@ -4,7 +4,7 @@ set -ex DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ cloudformation deploy \ --stack-name "${ENVIRONMENT_NAME}-ecs-cluster" \ --capabilities CAPABILITY_IAM \ diff --git a/examples/infrastructure/eks-cluster.sh b/examples/infrastructure/eks-cluster.sh index cd1c302a..663f1756 100755 --- a/examples/infrastructure/eks-cluster.sh +++ b/examples/infrastructure/eks-cluster.sh @@ -4,7 +4,7 @@ set -ex DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ cloudformation deploy \ --stack-name "${ENVIRONMENT_NAME}-eks-cluster" \ --capabilities CAPABILITY_IAM \ diff --git a/examples/infrastructure/vpc.sh b/examples/infrastructure/vpc.sh index 0ded5817..1a01628e 100755 --- a/examples/infrastructure/vpc.sh +++ b/examples/infrastructure/vpc.sh @@ -4,7 +4,7 @@ set -ex DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -aws --profile "${AWS_PROFILE}" --region "${AWS_REGION}" \ +aws --profile "${AWS_PROFILE}" --region "${AWS_DEFAULT_REGION}" \ cloudformation deploy \ --stack-name "${ENVIRONMENT_NAME}-vpc" \ --capabilities CAPABILITY_IAM \