(assets): Allow using exported variables from Assets stage steps #20031
Labels
@aws-cdk/assets
Related to the @aws-cdk/assets package
@aws-cdk/core
Related to core CDK functionality
feature-request
A feature should be added or improved.
p2
Describe the feature
Way to refer to variables in latter CodePipeline steps that are exported from Assets stage's steps.
Use Case
This would speed up pipeline run quite a lot, when we can do container security scanning in Asset stage (which is already possible) and get the ID of the scan to be included in latter created documents about the builds.
We can export the value as it's doable in partialBuildSpec, but we can't refer that in latter steps as Asset stage steps doesn't have namespace set.
We can dynamically get the asset steps that build docker images in Synth step with jq and exported variables.
If there would even be static namespace (in example
Assets
, it would be possible to use those value later).Proposed Solution
Export Asset steps' CodeBuildSteps same way as Synth has those exposed so that it's possible to use variable referencing from steps in Asset stage. Kind of issue here could be that it would also require calculation of amount of needed asset steps earlier than now.
Other option would be just hardcode the namespace also to Asset stage steps so exported values from those could manually be referred. If namespace would be as in other
Asset@DockerAsset1
etc., still above used way to get the needed steps would be needed. But this would still work.Other Information
We have CodeBuild projects that CDK created CodePipeline uses deployed to our custom VPC, meaning that provisioning time is minimum around 90 seconds. We also do security scanning of the built image, and image is created at the Asset stage.
Acknowledgements
CDK version used
2.20.0
Environment details (OS name and version, etc.)
Debian bullseye
The text was updated successfully, but these errors were encountered: