Skip to content

(ecr): ECR is generating invalid cloudformation #13418

@cplee

Description

@cplee

When creating an ECR repository with image_scan_on_push enabled, the resulting CloudFormation template is invalid and reports an error.

ecr_repo = ecr.Repository(
                self,
                "ecr-repository",
                image_scan_on_push=True,
                repository_name=ecr_repo_name,
            )

Stack operations on resource archivemicrosoftecrrepository7FB5D8DF would fail starting from 03/01/2021 as the template has invalid properties. Please refer to the resource documentation to fix the template. Properties validation failed for resource archivemicrosoftecrrepository7FB5D8DF with message: #/ImageScanningConfiguration: extraneous key [scanOnPush] is not permitted

Reproduction Steps

What did you expect to happen?

CloudFormation template should look like:

"ImageScanningConfiguration" : {
      "ScanOnPush": "true"
    }

What actually happened?

"ImageScanningConfiguration" : {
      "scanOnPush": "true"
    }

Environment

  • CDK CLI Version : 1.91.0
  • Framework Version: 1.91.0
  • Node.js Version: v14.11.0
  • OS : macOS
  • Language (Version): Python 3.8.6

Other


This is 🐛 Bug Report

Metadata

Metadata

Labels

@aws-cdk/aws-cloudformationRelated to AWS CloudFormation@aws-cdk/aws-ecrRelated to Amazon Elastic Container RegistrybugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions