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

'npx ampx sandbox' still doesn't work as described in Quickstart tutorials #2419

Open
clarktx opened this issue Jan 9, 2025 · 2 comments
Open
Labels
configure Issues related to local profile configuration pending-triage Incoming issues that need categorization

Comments

@clarktx
Copy link

clarktx commented Jan 9, 2025

Environment information

System:
  OS: Windows 11 10.0.22621
  CPU: (16) x64 AMD Ryzen 7 7800X3D 8-Core Processor
  Memory: 11.71 GB / 31.16 GB
Binaries:
  Node: 20.12.2 - C:\Program Files\nodejs\node.EXE
  Yarn: undefined - undefined
  npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
  pnpm: undefined - undefined
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.6
  @aws-amplify/backend-data: 1.4.0
  @aws-amplify/backend-deployer: 1.1.13
  @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.1
  @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.5.1
  @aws-amplify/plugin-types: 1.7.0
  @aws-amplify/sandbox: 1.2.9
  @aws-amplify/schema-generator: 1.2.6
  aws-amplify: 6.12.0
  aws-cdk: 2.174.1
  aws-cdk-lib: 2.174.1
  typescript: 5.7.3

Describe the bug

The instructions in Configure for local development fail to connect a client to the sandbox. The instructions say to use a user with Amplify Backend deploy access, and the command npx ampx sandbox --outputs-format dart --outputs-out-dir lib to trigger the creation of a stack. However, the client never recognizes the bootstrapped environment.

There is a current workaround mentioned in this repo's other "closed" issues that says to use a user with full Admin access and the command
npx aws-cdk@latest bootstrap aws://<my account>/<region>

This does work, however the tutorial should be updated or the root cause of the problem fixed.

Thanks

Reproduction steps

When following the Configure for local development section, we're instructed to create a user with "AmplifyBackendDeployFullAccess" permission. As expected this user cannot bootstrap the environment, so we're directed to use an Admin or Root user to complete the bootstrap process.

After this is done and a new "CDKToolkit" stack has been started, we get to the problem. We run the sandbox command again as instructed:

`PS dev\my_amplify_app>npx ampx sandbox --outputs-format dart --outputs-out-dir lib

The given region has not been bootstrapped. Sign in to console as a Root user or Admin to complete the bootstrap process, then restart the sandbox.`

The stack is not detected.

@clarktx clarktx added the pending-triage Incoming issues that need categorization label Jan 9, 2025
@ykethan
Copy link
Member

ykethan commented Jan 13, 2025

Hey @clarktx, thank you for reaching out. Are there any AWS environment variables such as region currently being set in terminal or any config changes on the local profile?

@ykethan ykethan added pending-response Issue is pending response from author configure Issues related to local profile configuration labels Jan 13, 2025
@clarktx
Copy link
Author

clarktx commented Jan 17, 2025

Perhaps I was doing something unusual in that my SSO region is us-east-1 but my working (bootstrapped) region was us-east-2. So my SSO_REGION and REGION profile vars are different.

Perhaps npx ampx sandbox doesn't work in this case?

Either way, it would be helpful is the error message that occurs would include the region it had checked. So instead of
The given region has not been bootstrapped. Sign in to console as a Root user or Admin to complete the bootstrap process, then restart the sandbox.

Could you make it read like:
The us-east-1 region has not been bootstrapped. Sign in to console as a Root user or Admin to complete the bootstrap process, then restart the sandbox.

Then we'd know for sure to check our REGION variables and look for one that is pointing to the wrong place.

Thanks
Clark

@github-actions github-actions bot removed the pending-response Issue is pending response from author label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configure Issues related to local profile configuration pending-triage Incoming issues that need categorization
Projects
None yet
Development

No branches or pull requests

2 participants