martysweet / cfn-lint

A CloudFormation JSON and YAML Validator
MIT License
163 stars 38 forks source link

Tags is not a valid property of AWS::ECR::Repository #241

Closed MatteoInfi closed 3 years ago

MatteoInfi commented 3 years ago

Not really sure what is wrong here

  ECRRepository:
    Type: AWS::ECR::Repository
    Properties:
      Tags:
        - Key: app
          Value: !Ref Appname
        - Key: env
          Value: !Ref Environment
        - Key: type
          Value: storage
      RepositoryName: !Sub ${Appname}-${Environment}
      RepositoryPolicyText:
        Version: "2012-10-17"
        Statement:
          - Sid: AllowPushPull
            Effect: Allow
            Principal:
              AWS:
                - !GetAtt BuildProject.Arn
            Action:
              - "ecr:GetDownloadUrlForLayer"
              - "ecr:BatchGetImage"
              - "ecr:BatchCheckLayerAvailability"
              - "ecr:PutImage"
              - "ecr:InitiateLayerUpload"
              - "ecr:UploadLayerPart"
              - "ecr:CompleteLayerUpload"

And I get this error:

Resource: Resources > ECRRepository > Properties > Tags
Message: Tags is not a valid property of AWS::ECR::Repository
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html
martysweet commented 3 years ago

This is most likely due to the CFN schema being out of date, we strongly advise you use cfn-python-lint at https://github.com/awslabs/cfn-python-lint instead of this project.

If you depend on this project, https://github.com/martysweet/cfn-lint#release-instructions discusses the process on updating the CFN schema specifications. Let me know and I can push this in a new version.

Marty

MatteoInfi commented 3 years ago

@martysweet thanks the reply, I see, I will switch to the python library then.