aws-amplify / aws-amplify/amplify-cli-export-construct
cdk deploy error with amplify exported backend (appsync + auth)
- Vorherrschende Sprache
- TypeScript
- Sterne
- 13
- Forks
- 16
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Rechercherichtung
Beginne mit dem Aufruf von AmplifyExportedBackend und dem exportierten Backend, das für die CDK-Bereitstellung verwendet wird. Untersuche, wie die Parameter authRoleName und unauthRoleName bereitgestellt werden, wenn API und Auth gemeinsam exportiert werden, und vergleiche dies mit dem API-only-Export, der erfolgreich ist. Als abgeschlossen gilt die Aufgabe, wenn das exportierte Backend im Zielkonto und in der Zielregion mit aktiviertem Auth erfolgreich bereitgestellt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, typescript
- Bereich
- api, authentication, backend, cloud
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100