Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create Amplify project with containers in regions with fewer than 3 AZs #13904

Open
2 tasks done
palpatim opened this issue Aug 28, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working containers Issues related to the non-serverless container based functionality

Comments

@palpatim
Copy link
Member

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

12.12.6

What operating system are you using?

macOS

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

N/A

Describe the bug

Attempting to create an Amplify project, with containers, in regions with fewer than 3 AZs results in an error: The requested number of subnets exceeds the number of AZs for the region. This appears to be because of a hardcoded value for the subnets argument to getEnvironmentNetworkInfo in env-level-constructs.ts.

Expected behavior

The number of requested subnets does not exceed the number of availability zones for the selected region.

Reproduction steps

  1. Initialize a new Amplify project in a region with < 3 availability zones (e.g., us-west-1)
  2. Add container support with amplify configure projects > Advanced: Container-based deployments
  3. Add a containerized API with amplify add api > REST > API Gateway + AWS Fargate (Container-based) > (accept defaults for remaining options)
  4. amplify push -y

Project Identifier

0ef4cab727ef3e2dd0a288133a105af9

Log output

2024-08-28T16:29:54.915Z|info : amplify add api  
2024-08-28T16:29:54.994Z|info : @aws-amplify/amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2024-08-28T16:30:07.403Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["personal"])
2024-08-28T16:30:07.406Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"credential_process":"<REDACTED>","region":"us-west-1"}])
2024-08-28T16:30:12.437Z|info : amplify status core  {"yes":false}
2024-08-28T16:30:12.515Z|info : @aws-amplify/amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2024-08-28T16:30:13.758Z|info : amplify-provider-awscloudformation.display-helpful-urls.showCognitoSandBoxMessage(["containeraztest"])
2024-08-28T16:30:23.944Z|info : amplify push core  {"yes":true}
2024-08-28T16:30:24.025Z|info : @aws-amplify/amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2024-08-28T16:30:25.443Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["personal"])
2024-08-28T16:30:25.446Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"credential_process":"<REDACTED>","region":"us-west-1"}])
2024-08-28T16:30:25.455Z|info : amplify-provider-awscloudformation.zip-util.downloadZip.s3.getFile([{"Key":"[***]rent-[***]ud-[***]d.zip"},null])
2024-08-28T16:30:25.456Z|info : amplify-provider-awscloudformation.aws-s3.s3.getFile([{"Key":"[***]rent-[***]ud-[***]d.zip","Bucket":"[***]ify-[***]aztest-[***]ev-[***]74-[***]ment"}])
2024-08-28T16:30:25.766Z|info : amplify-provider-awscloudformation.initialize-env.run.cfn.updateamplifyMetaFileWithStackOutputs([{"StackName":"[***]ify-[***]aztest-[***]ev-[***]74"}])
2024-08-28T16:30:25.767Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["personal"])
2024-08-28T16:30:25.769Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"credential_process":"<REDACTED>","region":"us-west-1"}])
2024-08-28T16:30:25.778Z|info : amplify-provider-awscloudformation.aws-cfn.updateamplifyMetaFileWithStackOutputs.cfn.listStackResources([{"StackName":"[***]ify-[***]aztest-[***]ev-[***]74"}])
2024-08-28T16:30:26.078Z|info : amplify-provider-awscloudformation.aws-cfn.describeStack.cfn.describeStacks([{"StackName":"[***]ify-[***]aztest-[***]ev-[***]74"}])
2024-08-28T16:30:26.363Z|info : amplify-provider-awscloudformation.aws-s3.s3.getFile([{"Key":"[***]ify-[***]json","Bucket":"[***]ify-[***]aztest-[***]ev-[***]74-[***]ment"}])
2024-08-28T16:30:26.811Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["personal"])
2024-08-28T16:30:26.812Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"credential_process":"<REDACTED>","region":"us-west-1"}])
2024-08-28T16:30:27.043Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["personal"])
2024-08-28T16:30:27.044Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"credential_process":"<REDACTED>","region":"us-west-1"}])
2024-08-28T16:30:27.481Z|error : The requested number of subnets exceeds the number of AZs for the region. {
  "subnets": 3,
  "azs": 2
}
ConfigurationError: The requested number of subnets exceeds the number of AZs for the region. {
  "subnets": 3,
  "azs": 2
}
2024-08-28T16:31:39.010Z|info : amplify diagnose core  {"send-report":true,"yes":false}
2024-08-28T16:31:39.091Z|info : @aws-amplify/amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@palpatim palpatim added the pending-triage Issue is pending triage label Aug 28, 2024
@ykethan ykethan added bug Something isn't working containers Issues related to the non-serverless container based functionality and removed pending-triage Issue is pending triage labels Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working containers Issues related to the non-serverless container based functionality
Projects
None yet
Development

No branches or pull requests

2 participants