Commit 27d495f
authored
fix: add --import-existing-resources to CDK deploy in integration-suite (#1174)
## What changed and why
Added `--import-existing-resources` flag to the `npx cdk deploy` command
in the `integration-suite` CI job
(`.gitlab/templates/pipeline.yaml.tpl`).
**Root cause**: When a pipeline fails mid-deploy, some AWS resources
(specifically the dotnet Lambda log group
`/aws/lambda/integ-{IDENTIFIER}-{TEST_SUITE}-dotnet-lambda`) are created
in AWS but the CloudFormation stack is left in `ROLLBACK_COMPLETE`
state. On a pipeline retry for the same commit (same `IDENTIFIER` =
`CI_COMMIT_SHORT_SHA`), CDK attempts to create the already-existing log
group and fails with:
```
ToolkitError: ChangeSet 'cdk-deploy-change-set' on stack 'integ-{IDENTIFIER}-{TEST_SUITE}' failed early validation:
- Resource of type 'AWS::Logs::LogGroup' with identifier '/aws/lambda/integ-{IDENTIFIER}-{TEST_SUITE}-dotnet-lambda' already exists.
```
The `--import-existing-resources` flag tells CDK to import any
already-existing resources into the stack instead of failing validation,
which is the standard CDK solution for this exact scenario.
## Jira
[SVLS-8825](https://datadoghq.atlassian.net/browse/SVLS-8825)
[SVLS-8825]:
https://datadoghq.atlassian.net/browse/SVLS-8825?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ1 parent b67655d commit 27d495f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
| 511 | + | |
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| |||
0 commit comments