NASA-IMPACT / veda-backend

Backend services for VEDA
Other
13 stars 5 forks source link

Update definition for IAM role for STAC Ingestor to be unique #308

Open botanical opened 9 months ago

botanical commented 9 months ago

What

We need to resolve the ingest-api's IAM role unique resource ID error blocking backend deployments.

Error below:

 ❌  veda-backend-uah-dev failed: Error: The stack named veda-backend-uah-dev failed to deploy: UPDATE_ROLLBACK_COMPLETE: delta-backend-staging-stac-ingestion-api-runner already exists in stack arn:aws:cloudformation:us-west-2:853558080719:stack/veda-backend-uah-staging/5fa6c060-3064-11ed-9b7d-06b9b4784963
    at FullCloudFormationDeployment.monitorDeployment (/opt/hostedtoolcache/node/17.9.1/x64/lib/node_modules/aws-cdk/lib/index.js:431:10615)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.deployStack2 [as deployStack] (/opt/hostedtoolcache/node/17.9.1/x64/lib/node_modules/aws-cdk/lib/index.js:434:196750)
    at async /opt/hostedtoolcache/node/17.9.1/x64/lib/node_modules/aws-cdk/lib/index.js:434:178719

 ❌ Deployment failed: Error: The stack named veda-backend-uah-dev failed to deploy: UPDATE_ROLLBACK_COMPLETE: delta-backend-staging-stac-ingestion-api-runner already exists in stack arn:aws:cloudformation:us-west-2:853558080719:stack/veda-backend-uah-staging/5fa6c060-3064-11ed-9b7d-06b9b4784963
    at FullCloudFormationDeployment.monitorDeployment (/opt/hostedtoolcache/node/17.9.1/x64/lib/node_modules/aws-cdk/lib/index.js:431:10615)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.deployStack2 [as deployStack] (/opt/hostedtoolcache/node/17.9.1/x64/lib/node_modules/aws-cdk/lib/index.js:434:196750)
    at async /opt/hostedtoolcache/node/17.9.1/x64/lib/node_modules/aws-cdk/lib/index.js:434:178719
The stack named veda-backend-uah-dev failed to deploy: UPDATE_ROLLBACK_COMPLETE: delta-backend-staging-stac-ingestion-api-runner already exists in stack arn:aws:cloudformation:us-west-2:853558080719:stack/veda-backend-uah-staging/5fa6c060-3064-11ed-9b7d-06b9b4784963

Why

Notes

Currently, the role is defined to be "delta-backend-staging-stac-ingestion-api-{stage}" where stage is being set by https://github.com/NASA-IMPACT/veda-backend/blob/b5d5e3b6892e194abab88b77d607edc24df12fab/ingest_api/infrastructure/config.py#L13-L22 which will return runner as a the default.

We need to update the construct to generate a unique construct name so that a unique logical ID is produced by CDK.

Consider updating the resource to use stack_name.

AC