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 Risposta
1
Risposta accettata

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
ESPERTO
con risposta 9 mesi fa
profile pictureAWS
ESPERTO
verificato 9 mesi fa
  • 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.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande