AWS CodePipeline CodeBuild Asset Names


I have an AWS CodePipeline defined using CDK that generates a lot of AWS CodeBuild file assets, which have names FileAsset1, FileAsset2, etc. Is it possible to give those assets more descriptive names? It'd be nice if the name was generated automatically using the logical ID of the associated CloudFormation resource, for example LogicalIdAsset1. The code to generate the pipeline looks like the following:

        pipeline = pipelines.CodePipeline(
                    "npm install -g aws-cdk",
                    "pip install -r requirements-dev.txt"
                    "make build",
                    "cdk synth",

The file artifacts and associated names are generated automatically based on the CDK synth but it seems to be CodeBuild / CodePipeline that gives them names. I'm not seeing anywhere in the CDK pipeline options to specify names.

2 Answers
Accepted Answer

This is currently not possible using the CDK Pipelines - the asset names will be auto-generated, but a feature request for asset display names has been already submitted on GitHub.

You can watch this GitHub issue for the implementation progress.

profile pictureAWS
answered a year ago

Yes, it is possible to give AWS CodeBuild file assets more descriptive names. In the AWS CodeBuild console, you can click on the project you want to customize and select the "Edit" option. From there, you can specify a custom name for each of the file assets. You can also use CloudFormation to define the names of the file assets by specifying a "filename" parameter in the CodeBuild Project resource.

profile picture
answered a year ago
  • Thanks for your reply! I gave a bad explanation of what I'm trying to do. The pipeline is defined using CDK and the artifacts names are coming out of that process. I think it's CDK that creates the artifacts but then CodeBuild / CodePipeline that gives them names. Do you know if it's possible to specify names in the CDK code? I updated my question with some boilerplate code for how the pipeline is defined.

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