By using AWS re:Post, you agree to the Terms of Use

AWS::CodePipeline::Pipeline Action configuration field 1000 character limit

0

Setting up a codebuild action inside codepipeline via a CF template (the AWS::CodePipeline::Pipeline resource), I keep running into a very limiting factor where the configuration fields are all limited to 1000 characters (see: https://docs.aws.amazon.com/codepipeline/latest/userguide/limits.html:

Maximum length of the action configuration value (for example, the value of the RepositoryName configuration in the CodeCommit action configuration should be less than 1000 characters: "RepositoryName": "my-repo-name-less-than-1000-characters") 

This limit is enough for most configuration fields, but when configuring a CodeBuild action, the EnvironmentVariables field expects a JSON string. This JSON string can very fast reach 1000 characters, with even as little as 10 environmental variables, especially if those variables are extracted from SECRETS_MANAGER. For example, declaring just one variable like this:

{"name":"MYSERVICE_VARIABLE","value":"aws:secretsmanager:ap-northeast-1:123458087:secret:my-secret-staging-name:password","type":"SECRETS_MANAGER"}

Will on its own be 148 characters. If the pipeline requires just 5 of these secrets and maybe 2-3 more short ones, the limit will be reached and deployment of the pipeline will fail. I was wondering if there is any chance this limit can get reviewed once more and maybe increased to, say, 1mb json string? Failing to do so will render this feature useful only in the simplest of use-cases...

Regards, Julian.

2 Answers
0

Hi, I would recommend to use AWS CodeBuild action EnvironmentVariables configuration parameter for values originating from the prior pipeline stages. See Example: Use a BranchName variable with CodeBuild environment variables. Values that do not depend on prior pipelines stages can be set as EnvironmentVariables (a different configuration with the same name) on the CodeBuild project directly. FYI, it is also mentioned in AWS CDK documentation for environmentVariables property of CodeBuildActionProps interface.

answered 7 months ago
0

Hi, thank you for your response!

Indeed this was the solution that I ended up employing, but only due to lack of better alternatives.

Originally I had a single CodeBuild project, and I injected different variables into it through CodePipeline based on the environment. I had a single CodeBuild project and multiple (staging, production, etc) CodePipeline pipelines. In the new setup, in order to accommodate more variables, I had to create multiple CodeBuild projects, one for each environment. Is this the end of the world? No, of course not. But I don't think it's ideal, and it shouldn't be too hard to just raise the size limit of this one property, should it?

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions