aws-amplify / amplify-backend

Home to all tools related to Amplify's code-first DX (Gen 2) for building fullstack apps on AWS
Apache License 2.0
183 stars 62 forks source link

Auth construct doesn't work in opt in region (ap-east-1) #1194

Open sobolk opened 7 months ago

sobolk commented 7 months ago

Environment information

System:
  OS: macOS 14.3.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 289.23 MB / 32.00 GB
  Shell: /bin/bash
Binaries:
  Node: 18.17.1 - /opt/homebrew/opt/node@18/bin/node
  Yarn: 1.22.21 - /opt/homebrew/opt/node@18/bin/yarn
  npm: 9.6.7 - /opt/homebrew/opt/node@18/bin/npm
  pnpm: 8.15.1 - /opt/homebrew/opt/node@18/bin/pnpm
NPM Packages:
  @aws-amplify/backend: 0.13.0-beta.10
  @aws-amplify/backend-cli: 0.12.0-beta.12
  aws-amplify: 6.0.21
  aws-cdk: 2.133.0
  aws-cdk-lib: 2.133.0
  typescript: 5.4.3
AWS environment variables:
  AWS_DEFAULT_REGION = ap-east-1
  AWS_REGION = ap-east-1
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1

Description

Repro steps

  1. mkdir testapp010
  2. cd testapp010
  3. npm create amplify@beta
  4. export AWS_REGION=ap-east-1
  5. export AWS_DEFAULT_REGION=ap-east-1
  6. npx amplify sandbox

Log:

amplify-testapp010-sobkamil-sandbox-f740cfcbd4 |   2 | 12:30:54 PM | ROLLBACK_COMPLETE    | AWS::CloudFormation::Stack | amplify-testapp010-sobkamil-sandbox-f740cfcbd4

Failed resources:
amplify-testapp010-sobkamil-sandbox-f740cfcbd4-auth179371D7-1UC6Z7F61HNDC | 12:30:33 PM | CREATE_FAILED        | AWS::Cognito::UserPool     | auth/amplifyAuth/UserPool (amplifyAuthUserPool4BA7F805) Property validation failure: [Encountered unsupported properties in {/}: [UserAttributeUpdateSettings]]
amplify-testapp010-sobkamil-sandbox-f740cfcbd4 | 12:30:41 PM | CREATE_FAILED        | AWS::CloudFormation::Stack | auth.NestedStack/auth.NestedStackResource (auth179371D7) Embedded stack arn:aws:cloudformation:ap-east-1:595032847868:stack/amplify-testapp010-sobkamil-sandbox-f740cfcbd4-auth179371D7-1UC6Z7F61HNDC/a4fc6160-e882-11ee-9de3-0ae3ba061d84 was not successfully created: The following resource(s) failed to create: [amplifyAuthUserPool4BA7F805].

The CloudFormation deployment has failed.
Caused By: ❌ Deployment failed: Error: The stack named amplify-testapp010-sobkamil-sandbox-f740cfcbd4 failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Property validation failure: [Encountered unsupported properties in {/}: [UserAttributeUpdateSettings]], Embedded stack arn:aws:cloudformation:ap-east-1:595032847868:stack/amplify-testapp010-sobkamil-sandbox-f740cfcbd4-auth179371D7-1UC6Z7F61HNDC/a4fc6160-e882-11ee-9de3-0ae3ba061d84 was not successfully created: The following resource(s) failed to create: [amplifyAuthUserPool4BA7F805].
[Sandbox] Watching for file changes...

Error message

Property validation failure: [Encountered unsupported properties in {/}: [UserAttributeUpdateSettings]]

sobolk commented 7 months ago

It seems that cognito not supported in that region. We may consider exposing better error message than Property validation failure: [Encountered unsupported properties in {/}: [UserAttributeUpdateSettings]]

image

redjonzaci commented 5 months ago

can i do this? maybe a check if service is supported in region?

hexinatgithub commented 5 months ago

can i do this? maybe a check if service is supported in region?

error message is very confused, maybe check resource viable in region before deploy to cloud stack.