amplify-cli: Export CDK doesn't work when stack contains imported auth

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • 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.

How did you install the Amplify CLI?

npm

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

v14.18.0

Amplify CLI Version

7.6.19

What operating system are you using?

mac

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

No manual changes made

Amplify Categories

auth

Amplify Commands

export

Describe the bug

When amplify backend stack contains imported auth (cognito user pool), amplify export command throws an error.

Expected behavior

CDK should be generated successfully.

Reproduction steps

  1. amplify init
  2. amplify import auth
  3. amplify export

GraphQL schema(s)

# Put schemas below this line


Log output

# Put your logs below this line
โœ– Generating and writing root stack
Cannot read property 'parameters' of undefined
TypeError: Cannot read property 'parameters' of undefined
    at ResourceExport.fixNestedStackParameters (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/resource-package/resource-export.ts:102:59)
    at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/export-resources.ts:50:39)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at exportBackend (/usr/local/lib/node_modules/@aws-amplify/cli/src/commands/export.ts:74:5)
    at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/src/commands/export.ts:62:5)
    at Object.executeAmplifyCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/index.ts:373:5)
    at executePluginModuleCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:178:3)
    at executeCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:30:5)
    at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/src/index.ts:205:5)


Additional information

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 3
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Was anyone able to find a work-around for this issue? Iโ€™ve invested a lot of time on building my app using amplify, and canโ€™t afford to abandon amplify altogether because of this ๐Ÿ˜ฆ

Hi @josefaidt, do you have any news on this ? we are facing the same issue with amplify 10.3.0 and 10.3.1. The issue is that we cannot really understand what is going wrong as the message is not informative and there is no exhaustive documentation and troubleshooting about the export. Also, the diagnose --send-report stop before sending, that reduce drastically the help we can receive.

Still getting this error:

โœ– Generating and writing root stack
๐Ÿ›‘ Cannot read property 'parameters' of undefined
TypeError: Cannot read property 'parameters' of undefined
    at ResourceExport.fixNestedStackParameters (/snapshot/repo/build/node_modules/amplify-provider-awscloudformation/lib/resource-package/resource-export.js:144:59)
    at Object.run (/snapshot/repo/build/node_modules/amplify-provider-awscloudformation/lib/export-resources.js:94:39)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async exportBackend (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/export.js:86:9)
    at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/export.js:74:9)
    at async Object.executeAmplifyCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:292:9)
    at async executePluginModuleCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:142:5)
    at async executeCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:40:9)
    at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:165:13)

Could really use a better error message, updated documentation, or a workaround