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 réponse
1
Réponse acceptée

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
EXPERT
répondu il y a 9 mois
profile pictureAWS
EXPERT
vérifié il y a 9 mois
  • 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.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions