2
votes

Within AWS Cloudformation, I have a template file in YAML in which I am trying to create a new stack that builds a new Codecommit repo with code that is pulled from a zipped up folder in an S3 bucket.

Looking through the official AWS documentation, this seems possible. However, the documentation seems terse and I cannot for the life of me figure out how to do this.

AWS documentation reference - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-s3.html

Resources:
    CodeRepository:
        Type: AWS::CodeCommit::Repository
        Properties:
            RepositoryName: "repo-name"
            RepositoryDescription: "This is a Description"
            S3:
              Bucket: "S3-bucket-name"

The stack does not build, and I get the following rollback message --> 'Property validation failure: [Encountered unsupported properties in {/}: [Bucket]]'

Am I doing something wrong in my YAML, or is this an unsupported feature with Codecommit?

1
please consider upvoting the answer if it has helped you.shantanuo

1 Answers

0
votes

The Properties structure is a bit off and you are missing the required Key property for your S3 config


Properties:
    RepositoryName: "repo-name"
    RepositoryDescription: "This is a Description"
    Code 
        S3:
            Bucket: "S3-bucket-name"
            Key: "my-initial-code.zip"