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

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

Abierto
#73 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
13
Forks
16
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la invocación de AmplifyExportedBackend y el backend exportado que utiliza el despliegue de CDK. Inspecciona cómo se proporcionan los parámetros authRoleName y unauthRoleName cuando API y Auth se exportan conjuntamente, y compáralo con la exportación API-only que tiene éxito. La tarea estará completada cuando el backend exportado se despliegue correctamente en la cuenta y región de destino con Auth habilitado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
aws, typescript
Área
api, authentication, backend, cloud
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.