AWS CodePipeline CodeBuild Asset Names

0

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(
            self,
            "Pipeline",
            code_build_defaults=pipelines.CodeBuildOptions(
                build_environment=aws_codebuild.BuildEnvironment(
                    compute_type=aws_codebuild.ComputeType.MEDIUM,
                ),
            ),
            synth=pipelines.ShellStep(
                "Synth",
                input=pipelines.CodePipelineSource.connection(
                    repo_string="organization/repo",
                    branch="main",
                    connection_arn=GITHUB_CONNECTION_ARN,
                ),
                install_commands=[
                    "npm install -g aws-cdk",
                    "pip install -r requirements-dev.txt"
                ],
                commands=[
                    "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 回答
2
已接受的回答

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
已回答 1 年前
0

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
已回答 1 年前
  • 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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则