I have this CDKv2 code (fragment shown below):
const dockerImageUriParameter = ssm.StringParameter
.fromStringParameterName(
this, 'DockerImageUriParam', '/codebuild-image-uri');
const ecrRepo = ecr.Repository.fromRepositoryName(
this, 'EcrRepo', dockerImageUriParameter.stringValue);
const dockerImage = codebuild.LinuxBuildImage.fromEcrRepository(ecrRepo);
const project = new codebuild.Project(this, 'AppCodeBuildProject', {
projectName: cdk.Stack.of(this).stackName,
description: 'my Application CodeBuild Project',
environment: {
privileged: true,
computeType: codebuild.ComputeType.MEDIUM,
buildImage: dockerImage
},
... rest of code omitted for clarity ...
Upon inspection in the AWS Console, I see that the SSM parameter has the correct value, something like:
123456789012.dkr.ecr.us-west-2.amazonaws.com/cdk-xxxxxxxxx-container-assets-123456789012-us-west-2:888888e16a7935f3e9488835692573393ae1372efa06fd469999999999999999
However, the codebuild project gets configured with an incorrect-looking (based on Console inspection) image uri:
123456789012.dkr.ecr.us-west-2.amazonaws.com/123456789012.dkr.ecr.us-west-2.amazonaws.com/cdk-xxxxxxxxx-container-assets-123456789012-us-west-2:888b01e16a7935f3e9488835692573393ae1372efa06fd469999999999999999
Note how part of the URI is repeated.
What is going on here?