aws-amplify / aws-amplify/amplify-cli-export-construct
cdk deploy error with amplify exported backend (appsync + auth)
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
I have and amplify app that has an API Graphql and Auth. Both created from amplify cli. I then exported the amplify app using
`amplify export --out ` following this [guide](https://docs.amplify.aws/javascript/tools/cli/usage/export-to-cdk/#pageMain)
I then proceeded to add in into a CDK project to deploy it on another account and region following this [guide](https://docs.amplify.aws/javascript/tools/cli/usage/export-to-cdk/#use-cdk-for-cross-account-or-cross-region-amplify-backend-deployments)
```typescript
const amplifyBackend = new AmplifyExportedBackend(this, "amplifyExportedBackend", {
amplifyEnvironment: `dev-${cdk.Stack.of(this).region + cdk.Stack.of(this).account}`,
path: path.resolve('.', 'amplify-export-amplifyapp')
})
```
After running deploy I am getting this error:
```text
Failed resources:
amplify-amplifyapp-dev-us-west-2982135724133-151709 | 15:43:46 | CREATE_FAILED | AWS::CloudFormation::Stack | CdkversionStack/amplifyExportedBackend-amplify-backend-stack/AmplifyCfnInclude/apiamplifyapp/apiamplifyapp (apiamplifyapp) Parameters: [authRoleName, unauthRoleName] must have values
❌ CdkversionStack/amplifyExportedBackend-amplify-backend-stack (amplify-amplifyapp-dev-us-west-2982135724133-151709) failed: Error: The stack named amplify-amplifyapp-dev-us-west-2982135724133-151709 failed
creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Parameters: [authRoleName, unauthRoleName] must have values
at FullCloudFormationDeployment.monitorDeployment (C:\Users\xxxx\AppData\Roaming\nvm\v20.10.0\node_modules\aws-cdk\lib\index.js:430:10615)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.deployStack2 [as deployStack] (C:\Users\xxxx\AppData\Roaming\nvm\v20.10.0\node_modules\aws-cdk\lib\index.js:433:198753)
at async C:\Users\xxxx\AppData\Roaming\nvm\v20.10.0\node_modules\aws-cdk\lib\index.js:433:180693
❌ Deployment failed: Error: The stack named amplify-amplifyapp-dev-us-west-2982135724133-151709 failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Parameters: [authR
oleName, unauthRoleName] must have values
at FullCloudFormationDeployment.monitorDeployment (C:\Users\xxxx\AppData\Roaming\nvm\v20.10.0\node_modules\aws-cdk\lib\index.js:430:10615)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.deployStack2 [as deployStack] (C:\Users\xxxx\AppData\Roaming\nvm\v20.10.0\node_modules\aws-cdk\lib\index.js:433:198753)
at async C:\Users\xxxx\AppData\Roaming\nvm\v20.10.0\node_modules\aws-cdk\lib\index.js:433:180693
The stack named amplify-amplifyapp-dev-us-west-2982135724133-151709 failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Parameters: [authRoleName, unauthRoleName] must have values
```
Expected Behavior
stack should be deployed in the account and region
This works if I remove the auth, export the amplify app again and only deploy the api.
Node version: v20.10.0
Amplify CLI version: 12.10.1
Contributor guide
Assessment
This issue has not been assessed yet.