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

Hardcode partition fails the deployment in non-aws partition #3122

Open
zxkane opened this issue Jan 18, 2025 · 3 comments
Open

Hardcode partition fails the deployment in non-aws partition #3122

zxkane opened this issue Jan 18, 2025 · 3 comments
Labels
Gen 2 pending-maintainer-response Issue is pending a response from the Amplify team. question Further information is requested

Comments

@zxkane
Copy link

zxkane commented Jan 18, 2025

Environment information

System:
  OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
  CPU: (8) x64 Intel(R) Xeon(R) Platinum 8488C
  Memory: 21.47 GB / 30.82 GB
  Shell: /usr/bin/zsh
Binaries:
  Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
  Yarn: 1.22.22 - ~/.linuxbrew/homebrew/bin/yarn
  npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
  pnpm: 9.6.0 - ~/.nvm/versions/node/v20.18.0/bin/pnpm
NPM Packages:
  @aws-amplify/auth-construct: 1.5.1
  @aws-amplify/backend: 1.13.0
  @aws-amplify/backend-auth: 1.4.2
  @aws-amplify/backend-cli: 1.4.7
  @aws-amplify/backend-data: 1.4.0
  @aws-amplify/backend-deployer: 1.1.14
  @aws-amplify/backend-function: 1.12.0
  @aws-amplify/backend-output-schemas: 1.4.0
  @aws-amplify/backend-output-storage: 1.1.4
  @aws-amplify/backend-secret: 1.1.5
  @aws-amplify/backend-storage: 1.2.4
  @aws-amplify/cli-core: 1.2.2
  @aws-amplify/client-config: 1.5.5
  @aws-amplify/deployed-backend-client: 1.5.0
  @aws-amplify/form-generator: 1.0.3
  @aws-amplify/model-generator: 1.0.12
  @aws-amplify/platform-core: 1.6.0
  @aws-amplify/plugin-types: 1.8.0
  @aws-amplify/sandbox: 1.2.9
  @aws-amplify/schema-generator: 1.2.6
  aws-amplify: 6.12.1
  aws-cdk: 2.176.0
  aws-cdk-lib: 2.176.0
  typescript: 5.7.3
AWS environment variables:
  AWS_PROFILE = kane-bjs
  AWS_REGION = cn-north-1
No CDK environment variables

Data packages

[email protected] /data/git/game-match-playground
├─┬ @aws-amplify/[email protected]
│ └─┬ @aws-amplify/[email protected]
│   └── @aws-amplify/[email protected]
└─┬ @aws-amplify/[email protected]
  └─┬ @aws-amplify/[email protected]
    └── @aws-amplify/[email protected]

Description

Tried to deploy a sandbox env of an Amplify application to AWS China region via npx ampx sandbox, it failed on amplifyDataAmplifyTableManagerNestedStack stack with below error,

Resource handler returned message: "Partition "aws" is not valid for resource "arn:aws:dynamodb:cn-north-1:xxx:table/*-ewdacgq5anbn3olwziz4vo2sby-NONE". (Service: Iam, Status Code: 400, Request ID: 6035f8dc-0113-40b3-b220-70ca7abbb893)" (RequestToken: 3cfce6bb-61e6-a2c3-b639-93e2e2b06c98, HandlerErrorCode: InvalidRequest)

I think it's caused by the custom resource with invalid IAM policy which manages the DDB tables.

cdk.Fn.sub('arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*-${apiId}-${envName}', {

@AnilMaktala AnilMaktala added the question Further information is requested label Jan 21, 2025
@AnilMaktala
Copy link
Member

Hey @zxkane, Thanks for bringing this up. It appears to be a region-specific issue. Let me review it with the team and get back to you.

@AnilMaktala
Copy link
Member

Hey @zxkane, Unfortunately, sandbox environments are not supported in this region. Currently, sandbox environments are only available in the regions listed for Amplify Hosting, as mentioned here.

@AnilMaktala AnilMaktala added pending-community-response Issue is pending a response from the author or community. Gen 2 and removed pending-triage labels Jan 27, 2025
@zxkane
Copy link
Author

zxkane commented Jan 28, 2025

It does not make sense for me. Amplify Gen2 builds upon AWS CDK, which helps build the infrastructure on AWS and then deploy it to multiple partitions and regions. Why must an Amplify Gen2 application be deployed by Amplify Hosting?

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gen 2 pending-maintainer-response Issue is pending a response from the Amplify team. question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants