aws-amplify / aws-amplify/amplify-cli-export-construct

cdk deploy error with amplify exported backend (appsync + auth)

Aperta
#73 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
13
Fork
16
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con l'invocazione di AmplifyExportedBackend e con il backend esportato utilizzato dal deployment CDK. Esamina come vengono forniti i parametri authRoleName e unauthRoleName quando API e Auth vengono esportati insieme, quindi confronta il risultato con l'esportazione API-only che ha esito positivo. L'attività è completata quando il backend esportato viene distribuito correttamente nell'account e nella regione di destinazione con Auth abilitato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, typescript
Ambito
api, authentication, backend, cloud
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.