Skip to content

Commit

Permalink
Merge pull request #114 from bcelenza/ga-regions
Browse files Browse the repository at this point in the history
Add all available regions
  • Loading branch information
Y0Username authored Mar 30, 2019
2 parents 23da6f8 + 85eb9ae commit 2f67c97
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 38 deletions.
3 changes: 1 addition & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

```
export AWS_PROFILE=<aws-profile for aws-cli>
export AWS_REGION=<aws-region for aws-cli>
export AWS_DEFAULT_REGION="$AWS_REGION"
export AWS_DEFAULT_REGION=<aws-region for aws-cli>
```

* Export the following environment variables
Expand Down
42 changes: 21 additions & 21 deletions examples/apps/colorapp/ecs/create-task-defs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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[]')

Expand All @@ -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 \
Expand All @@ -40,15 +40,15 @@ 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 \
--arg EXECUTION_ROLE_ARN $execution_role_arn \
--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 \
Expand All @@ -61,28 +61,28 @@ 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 \
--arg NAME "$ENVIRONMENT_NAME-ColorTellerWhite" \
--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 \
--arg EXECUTION_ROLE_ARN $execution_role_arn \
--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 \
Expand All @@ -95,28 +95,28 @@ 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 \
--arg NAME "$ENVIRONMENT_NAME-ColorTellerRed" \
--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 \
--arg EXECUTION_ROLE_ARN $execution_role_arn \
--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 \
Expand All @@ -129,28 +129,28 @@ 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 \
--arg NAME "$ENVIRONMENT_NAME-ColorTellerBlue" \
--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 \
--arg EXECUTION_ROLE_ARN $execution_role_arn \
--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 \
Expand All @@ -163,28 +163,28 @@ 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 \
--arg NAME "$ENVIRONMENT_NAME-ColorTellerBlack" \
--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 \
--arg EXECUTION_ROLE_ARN $execution_role_arn \
--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 \
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/colorapp/ecs/ecs-colorapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
10 changes: 5 additions & 5 deletions examples/apps/colorapp/kubernetes/generate-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion examples/apps/colorapp/servicemesh/.region-config.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion examples/apps/colorapp/servicemesh/appmesh-colorapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/colorapp/src/colorteller/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions examples/apps/colorapp/src/gateway/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion examples/infrastructure/appmesh-mesh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion examples/infrastructure/ecs-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion examples/infrastructure/eks-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion examples/infrastructure/vpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 2f67c97

Please sign in to comment.