Java CDK: Create ECR inserts a "null" in the repository name

0

Hello,

I'm using Java CDK to create a new ECR instance. Here is a code fragment:

Repository.Builder.create(scope, id).imageScanOnPush(true)
  .repositoryName("my-registry").removalPolicy(RemovalPolicy.DESTROY).build();

Looking in the AWS Console, the name of the new created repository is "null/my-registry" instead of "my-registry". If I create the new ECR instance in AWS Console then its name is created as expected, i.e. "my-registry" and not "null/my-registry".

What am I doing wrong here ?

Many thanks in advance.

Nicolas

  • I tried to replicate this issue, but it works fine for me. What's your CDK version?

3 Answers
0

I'm using the 2.69.0 (build 60a5b2a) version of CDK.

profile picture
Nicolas
answered a year ago
  • ok, I tried with same version and I don't see the issue. Are you setting this as a public repository?

0

ECS

No, that's a private one. I've attached a screen copy showing a couple of registries created with the code excerpt above.

profile picture
Nicolas
answered a year ago
0

Could anybody help with this issue please ?

profile picture
Nicolas
answered a year 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