Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set 'Source version' for AWS CodeBuild project in Terraform

I am working with setting up a AWS CodeBuild project in Terraform. Looking at the Terraform docs https://www.terraform.io/docs/providers/aws/r/codebuild_project.html I cannot figure out which argument to use to define the source version as highlighted in the image:

Screenshot of the AWS CodeBuild UI

Is this option supported though Terraform? I would like the CodeBuild project to build from another branch's source code than master.

like image 337
Martin Stigen Avatar asked Oct 16 '25 13:10

Martin Stigen


1 Answers

You can use source_version as it mentioned in the doc you referenced https://www.terraform.io/docs/providers/aws/r/codebuild_project.html

source_version = "master"

Specifying branch in source_version works the same way as in AWS console, e.g.

source_version = "refs/heads/my-feature-branch"

Other examples with tag, pull requests can be found here: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html

like image 62
Arthur Shakhlamjian Avatar answered Oct 19 '25 01:10

Arthur Shakhlamjian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!