aws-cdk: (pipelines) Environment variables placed in Pipeline > Stages > Action > Configuration break deploy
Environment variables were previously placed in AWS::CodeBuildProject > Properties > Environment as a list.
Now it is placed in Pipeline > Stages > Action > Configuration as a string which causes:
1 validation error detected: Value at 'pipeline.stages.2.member.actions.1.member.configuration' failed to satisfy constrain
t: Map value must satisfy constraint: [Member must have length less than or equal to 1000, Member must have length greater than or equal to 1] (Service: AWSCodePipeline; Status Code: 400; Error Code: ValidationException; Request ID: e4
df2712-2f07-45e6-a0bd-9ebf10a0b8c2; Proxy: null)
and I am unable to deploy pipeline.
Reproduction Steps
environment_variables = {name: codebuild.BuildEnvironmentVariable(value=value.value)
for name, value in EnvVars.__members__.items()}
pipeline = pipelines.CdkPipeline(self, "Pipeline",
cloud_assembly_artifact=cloud_assembly_artifact,
pipeline_name="MyPipeline",
source_action=cp_actions.CodeCommitSourceAction(
action_name="GetSourceCode",
output=source_artifact,
repository=repository),
synth_action=pipelines.SimpleSynthAction(
environment={"privileged": True},
environment_variables=environment_variables,
source_artifact=source_artifact,
cloud_assembly_artifact=cloud_assembly_artifact,
install_commands=["npm install -g aws-cdk"],
synth_command="cdk synth")
)
- 1.87.0
- Framework Version:
- node v14.15.1
- Windows 10
- Python 3.8
This is 🐛 Bug Report
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (12 by maintainers)
Commits related to this issue
- docs(pipelines): add a note about the size limit in environmentVariables for SimpleSynthAction (#15275) Clarifies that providing too many environment variables in `SimpleSynthOptions.environmentVaria... — committed to aws/aws-cdk by gshpychka 3 years ago
- docs(pipelines): add a note about the size limit in environmentVariables for SimpleSynthAction (#15275) Clarifies that providing too many environment variables in `SimpleSynthOptions.environmentVaria... — committed to hollanddd/aws-cdk by gshpychka 3 years ago
Next steps would be me reviewing the PR 🙂.
How about we base it on the error the OP encountered?
“If you encounter an error similar to this, try this instead”, something like that?
@skinny85 This resolved my issue, thanks!