CloudFormation Create Repository with Multiple Branches

0

Hello,

Please how do i create multiple branch in cloudformation when setting up my repository

I want to create [Dev|Test|Prod] Branch in CloudFormation.

please with a sample code.

IACCodeCommitRepo:
    Type: AWS::CodeCommit::Repository
    DeletionPolicy: Retain
    Properties:
      RepositoryName: !Ref AppId
      RepositoryDescription: !Sub IaC Repository for ProptterAccount
      # To Add Code Repository from S3
      Code:
        BranchName: main
        S3:
          Bucket: !Ref SourceCodeBucketName
          Key: !Ref SourceCodeBucketKey
Nafiu
已提问 9 个月前307 查看次数
1 回答
1
已接受的回答

Hello.
I don't think it is possible to create a non-default branch in CloudFormation.
So I think it is necessary to create it from the git command or management console after the CodeCommit repository is created.
https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-branch.html

profile picture
专家
已回答 9 个月前
profile pictureAWS
专家
已审核 9 个月前
  • Cloudformation stack would be account specific and can't be branched. You may want to leverage code pipeline where you create the webhooks in each aws Account(environment per say) and that particular branch from source repository would be sourced. Take a look at this blog post, if you want to consider branch based deployment.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则