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
1 Antwort
1
Akzeptierte Antwort

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
EXPERTE
beantwortet vor 9 Monaten
profile pictureAWS
EXPERTE
überprüft vor 9 Monaten
  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen