-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(pipelines): Need a way to get Stack Outputs as file artifact if they are > 1000 chars #17067
Comments
Any known workaround? This seems to be more or less related to the same limit as: #12747 |
I've run in to this as well, but only in one specific AWS account. I use the same CDK code in other accounts and it works as expected. I'm not sure what the difference is yet since they all have the same number of variables in the build step and reference SSM params of the same names. |
For now, I've used a workaround to dump half of my environment variables in a file within a preliminary Unfortunately, the #17074 has broken this workaround from CDK 1.129.0. See my #17074 (comment) |
This is unfortunate. I'm not sure it's fixable, this is a limitation imposed by CodePipeline. I guess an alternative would be to make the outputs available as a JSON file which you can consume in CodeBuild as you desire. |
@rix0rrr OK got it, thanks. That's what I did, dumping in multiple steps to an environment file.
Edit: actually, this has already been fixed. See update in #17074 (comment) |
I use the following workaround: CodeBuildStep('StepId',
commands=[
'aws sts get-caller-identity', # you don't need this but it prints out the role for debugging purposes
'export MY_VAR=$(aws cloudformation describe-stacks --query "Stacks[?StackName==\'stack-name\'][].Outputs[?OutputKey==\'my-output-key\'].OutputValue" --output text)',
'echo $MY_VAR'
],
role_policy_statements=[
PolicyStatement(
actions=['cloudFormation:DescribeStacks'],
resources=['*'],
),
]
) |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Is there any specific reason this hasn't been resolved yet? What's the reason to limit the evaluation to 1000 characters? For my pipeline I have a workaround but that's all it is, a workaround |
What is the problem?
It looks like
CodeBuildStep.envFromCfnOutputs
property is limited to 1-1000 characters. When injecting variables, it can quickly reaches this limit and the CodePipeline build fails with:Reproduction Steps
Include many environment variables from CloudFormation output in
CodeBuildStep.envFromCfnOutputs
.What did you expect to happen?
CodeBuildStep successful.
What actually happened?
CodeBuildStep failure with too vague error message.
CDK CLI Version
1.127.0
Framework Version
No response
Node.js Version
14.x
OS
macOS 11.6
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: