aws-amplify / aws-amplify/amplify-cli

Export CDK doesn't work when stack contains imported auth

Open
#9,772 17 comments 4 reactions 0 assignees View on GitHub
bug extensibility p3
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] 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)

```graphql
# 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 ()
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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.