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

referenceAuth capability does not work with latest amplify version? #2287

Open
Catazza opened this issue Dec 1, 2024 · 1 comment
Open
Labels
auth Issue pertaining to Amplify Auth pending-community-response Issue is pending a response from the author or community pending-response Issue is pending response from author pending-triage Incoming issues that need categorization

Comments

@Catazza
Copy link

Catazza commented Dec 1, 2024

Environment information

System:
  OS: macOS 13.6.3
  CPU: (10) arm64 Apple M1 Max
  Memory: 456.33 MB / 32.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 20.3.0 - ~/.nvm/versions/node/v20.3.0/bin/node
  Yarn: 1.22.19 - ~/.nvm/versions/node/v20.3.0/bin/yarn
  npm: 9.6.7 - ~/.nvm/versions/node/v20.3.0/bin/npm
  pnpm: 9.5.0 - ~/.nvm/versions/node/v20.3.0/bin/pnpm
NPM Packages:
  @aws-amplify/backend: 1.8.0
  @aws-amplify/backend-cli: 1.0.4
  aws-amplify: 6.10.0
  aws-cdk: 2.146.0
  aws-cdk-lib: 2.171.1
  typescript: 5.3.3
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Describe the bug

I am following the docs here, I hope I have not missed anything!

I have an externally-generated user pool that I need to import into my CDK app. I have this definition in my resource.ts file for the auth backend.

When I run npx ampx sandbox I get the error:

amplify/backend.ts(21,26): error TS2339: Property 'cfnResources' does not exist on type 'ReferenceAuthResources'.
TypeScript validation check failed.
Resolution: Fix the syntax and type errors in your backend definition.

Reproduction steps

My auth backend file is identical to the one in the docs, with the variables such as poolID populated.

import { referenceAuth } from '@aws-amplify/backend';

export const auth = referenceAuth({
  userPoolId: 'us-east-1_xxxx',
  identityPoolId: 'us-east-1:b57b7c3b-9c95-43e4-9266-xxxx',
  authRoleArn: 'arn:aws:iam::xxxx:role/amplify-xxxx-mai-amplifyAuthauthenticatedU-xxxx',
  unauthRoleArn: 'arn:aws:iam::xxxx:role/amplify-xxxx-mai-amplifyAuthunauthenticate-xxxx',
  userPoolClientId: 'xxxx',
});
@Catazza Catazza added the pending-triage Incoming issues that need categorization label Dec 1, 2024
@ykethan
Copy link
Member

ykethan commented Dec 2, 2024

Hey @Catazza, thank you for reaching. Tried reproducing but did not observe this error message on a sandbox deploy.
But did notice @aws-amplify/backend-cli: 1.0.4 does appear to be put of date. Could you try upgrading this to the latest(1.4.2) version and restart sandbox using --debug flag?
Additionally, on the backend.ts file is the auth resources being overridden?

@ykethan ykethan added pending-response Issue is pending response from author auth Issue pertaining to Amplify Auth pending-community-response Issue is pending a response from the author or community labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issue pertaining to Amplify Auth pending-community-response Issue is pending a response from the author or community pending-response Issue is pending response from author pending-triage Incoming issues that need categorization
Projects
None yet
Development

No branches or pull requests

2 participants