aws-cdk-lib/pipelines: CodeBuildStep should support CodePipeline variables #16684
Labels
@aws-cdk/pipelines
CDK Pipelines library
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
The current
CodeBuildStep
API doesn't includevariable
property andCodeBuildStepProps
doesn't includevariablesNamespace
property. As a result variables exported in CodeBuild (exporting variable usingexport VARIABLE_NAME
in script and defining the variable in buildspec'senv
-block usingexported-variables
) are not visible as CodePipeline variables.Currently this can be done by using
CodeBuildAction
from codepipeline_actions library along withICodePipelineActionFactory
. However, implementing this kind of wrapper creates unnecessary increase in the amount of code.Use Case
In some cases I need to resolve artifact version in CodeBuild and pass it to downstream actions in pipeline.
Proposed Solution
CodeBuildStepProps
API to take variablesNamespace and expose variables exported in CodeBuild to CodePipeline variables.CodeBuildStep
API to includevariable
-property so the variables defined inCodeBuildStep
can be referenced in downstream actions using syntax likemyCodeBuildStep.variable('MY_FUNNY_VARIABLE')
in cdk code.Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: