- Newest
- Most votes
- Most comments
The issue you're experiencing with your AWS CodePipeline appears to be related to the self-mutation feature and how it interacts with asset naming.
In CDK pipelines, the self-mutation feature automatically updates the pipeline when changes are detected. However, this can sometimes lead to unexpected behavior, especially when asset names are changing between runs.
The change in asset naming you've observed (from static names like FileAsset1 to dynamic names like <glueJobName>Job_CodeYYUSTlsVLvvM:f11f86f1-052c-435d-b5d2-cbf9a490fed4) is likely due to updates in how CDK generates asset names. This change in naming could be triggering the pipeline to detect a change and attempt to update itself, leading to the infinite loop you're experiencing.
Turning off self-mutation (self_mutation=False) as you've done is a temporary solution, but as you noted, it's not ideal for long-term use as it removes the pipeline's ability to automatically update itself.
To address this issue while keeping the self-mutation feature enabled, you could try the following:
-
Ensure that your CDK version is up to date. Some issues with asset naming and self-mutation have been addressed in recent versions.
-
Consider using asset hashing to create more stable asset names. This can be done by setting the
assetHashTypeproperty in your CDK stack. -
If the issue persists, you might need to implement a custom asset naming strategy or use the
assetIdproperty to provide more stable identifiers for your assets. -
Review your pipeline's change detection settings. You might be able to configure it to ignore certain types of changes that don't require a full pipeline update.
-
If you're using cross-account or cross-region deployments, ensure that your bootstrap stacks are up to date in all accounts and regions.
Remember to test these changes carefully in a non-production environment before applying them to your main pipeline. If the issue continues after trying these suggestions, you may need to reach out to AWS support for further assistance, as there could be underlying changes in the CodePipeline or CDK services that are affecting your specific use case.
Sources
aws-cdk-lib.pipelines module · AWS CDK
AWS CodePipeline adds native Amazon EC2 deployment support - AWS
I figured out the fix and the most likely culprit as well. https://github.com/aws/aws-cdk-cli/pull/175/files this was released on the 4th of April and most likely had a direct impact on the issue. Even when I added the custom hash on the glue job assets, it still didn't fix the issue however after updating cdk library for glue and adding the display_name to the code, it fixed the issue.
Relevant content
- asked 3 years ago
- asked 3 years ago
- asked a year ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 2 years ago
