awslabs / sbt-aws

SaaS Builder Toolkit for AWS is a developer toolkit to implement SaaS best practices and increase developer velocity.
Apache License 2.0
130 stars 26 forks source link

VPC creation is failed in ap-northeast-1 region #66

Closed dchtnk-123 closed 3 months ago

dchtnk-123 commented 3 months ago

Describe the bug

VPC creation is failed in ap-northeast-1 region due to unsupported availability zone . This repository has following code to set availability zone list. availabilityZones: [`${props.env.region}a`, `${props.env.region}b`, `${props.env.region}c`], But it does not work when the target region has different names as availability zone name.

Expected Behavior

VPC creation is successful.

Current Behavior

VPC creation is failed as follow when it tries to run ./install.sh in ap-northeast-1 region.

shared-infra-stack
shared-infra-stack: deploying... [3/5]
shared-infra-stack: creating CloudFormation changeset...
13:06:35 | CREATE_FAILED        | AWS::EC2::Subnet                          | sbtecsvpcPublicSubnet2Subnetxxxxxx
Resource handler returned message: "Value (ap-northeast-1b) for parameter availabilityZone is invalid. Subnets
can currently only be created in the following availability zones: ap-northeast-1a, ap-northeast-1c, ap-northea
st-1d. (Service: Ec2, Status Code: 400, Request ID: xxxxxxxxxxxxxxxxxxxxxxxxxx)" (RequestToken: xxxxxxxxxx, HandlerErrorCode: InvalidRequest)

Reproduction Steps

Run the below.

$ git clone https://github.com/aws-samples/saas-reference-architecture-ecs.git
$ cd saas-reference-architecture-ecs/scripts
$ ./build-application.sh 
$ ./install.sh ${YOUR_EMAIL} 

Possible Solution

Specify proper availability zone list depending on target region.

Additional Information/Context

Actual part that make this issue as follows. https://github.com/aws-samples/saas-reference-architecture-ecs/blob/main/server/lib/shared-infra/shared-infra-stack.ts#L40 https://github.com/aws-samples/saas-reference-architecture-ecs/blob/main/server/lib/tenant-template/ecs-cluster.ts#L48

CDK CLI Version

2.142.1 (build ed4e152)

Framework Version

No response

Node.js Version

v18.19.1

OS

macos

Language

TypeScript

Language Version

No response

Other information

No response

dchtnk-123 commented 3 months ago

I posted issue in wrong repository. Please ignore this issue.