{"id":26575955,"url":"https://github.com/tomarv2/terraform-aws-codebuild","last_synced_at":"2026-05-05T03:34:15.427Z","repository":{"id":42683465,"uuid":"339798712","full_name":"tomarv2/terraform-aws-codebuild","owner":"tomarv2","description":"Terraform module for AWS CodeBuild","archived":false,"fork":false,"pushed_at":"2022-07-27T17:31:41.000Z","size":96,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T15:49:52.168Z","etag":null,"topics":["aws","aws-codebuild","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomarv2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-17T17:14:36.000Z","updated_at":"2022-03-03T21:50:10.000Z","dependencies_parsed_at":"2022-08-28T05:02:21.230Z","dependency_job_id":null,"html_url":"https://github.com/tomarv2/terraform-aws-codebuild","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-aws-codebuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-aws-codebuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-aws-codebuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-aws-codebuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomarv2","download_url":"https://codeload.github.com/tomarv2/terraform-aws-codebuild/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245048012,"owners_count":20552433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-codebuild","terraform","terraform-module"],"created_at":"2025-03-23T02:35:52.141Z","updated_at":"2026-05-05T03:34:15.388Z","avatar_url":"https://github.com/tomarv2.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/tomarv2/terraform-aws-codebuild/actions/workflows/pre-commit.yml\" alt=\"Pre Commit\"\u003e\n        \u003cimg src=\"https://github.com/tomarv2/terraform-aws-codebuild/actions/workflows/pre-commit.yml/badge.svg?branch=main\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.apache.org/licenses/LICENSE-2.0\" alt=\"license\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/tomarv2/terraform-aws-codebuild\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/tomarv2/terraform-aws-codebuild/tags\" alt=\"GitHub tag\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/tag/tomarv2/terraform-aws-codebuild\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/tomarv2/terraform-aws-codebuild/pulse\" alt=\"Activity\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/commit-activity/m/tomarv2/terraform-aws-codebuild\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://stackoverflow.com/users/6679867/tomarv2\" alt=\"Stack Exchange reputation\"\u003e\n        \u003cimg src=\"https://img.shields.io/stackexchange/stackoverflow/r/6679867\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://twitter.com/intent/follow?screen_name=varuntomar2019\" alt=\"follow on Twitter\"\u003e\n        \u003cimg src=\"https://img.shields.io/twitter/follow/varuntomar2019?style=social\u0026logo=twitter\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Terraform module for AWS CodeBuild\n\n### Versions\n\n- Module tested for Terraform 1.0.1.\n- AWS provider version [3.74](https://registry.terraform.io/providers/hashicorp/aws/latest).\n- `main` branch: Provider versions not pinned to keep up with Terraform releases.\n- `tags` releases: Tags are pinned with versions (use \u003ca href=\"https://github.com/tomarv2/terraform-aws-codebuild/tags\" alt=\"GitHub tag\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/tag/tomarv2/terraform-aws-codebuild\" /\u003e\u003c/a\u003e).\n\n### Usage\n\n#### Option 1:\n\n```\nterrafrom init\nterraform plan -var='teamid=tryme' -var='prjid=project1'\nterraform apply -var='teamid=tryme' -var='prjid=project1'\nterraform destroy -var='teamid=tryme' -var='prjid=project1'\n```\n**Note:** With this option please take care of remote state storage\n\n#### Option 2:\n\n##### Recommended method (stores remote state in S3 using `prjid` and `teamid` to create directory structure):\n\n- Create python 3.6+ virtual environment\n```\npython3 -m venv \u003cvenv name\u003e\n```\n\n- Install package:\n```\npip install tfremote --upgrade\n```\n\n- Set below environment variables:\n```\nexport TF_AWS_BUCKET=\u003cremote state bucket name\u003e\nexport TF_AWS_BUCKET_REGION=us-west-2\nexport TF_AWS_PROFILE=\u003cprofile from ~/.ws/credentials\u003e\n```\n\nor\n\n- Set below environment variables:\n```\nexport TF_AWS_BUCKET=\u003cremote state bucket name\u003e\nexport TF_AWS_BUCKET_REGION=us-west-2\nexport AWS_ACCESS_KEY_ID=\u003caws_access_key_id\u003e\nexport AWS_SECRET_ACCESS_KEY=\u003caws_secret_access_key\u003e\n```\n\n- Updated `examples` directory with required values.\n\n- Run and verify the output before deploying:\n```\ntf -c=aws plan -var='teamid=foo' -var='prjid=bar'\n```\n\n- Run below to deploy:\n```\ntf -c=aws apply -var='teamid=foo' -var='prjid=bar'\n```\n\n- Run below to destroy:\n```\ntf -c=aws destroy -var='teamid=foo' -var='prjid=bar'\n```\n\n**Note:** Read more on [tfremote](https://github.com/tomarv2/tfremote)\n### CodeBuild\n```\nmodule \"codebuild\" {\n  source = \"git::git@github.com:tomarv2/terraform-aws-codebuild.git\"\n\n  build_source_location   = \"https://github.com/tomarv2/test-cicd\"\n  source_credential_token = var.source_credential_token\n  codebuild_role          = \"arn:aws:iam::123456789012:role/codebuild-role\"\n  environment_vars = [\n    {\n      name  = \"AWS_REGION\",\n      value = \"us-east-2\",\n      type  = \"PLAINTEXT\"\n  }]\n  filter_group = [{\n    filter = [{\n      exclude_matched_pattern = false\n      type                    = \"EVENT\"\n      pattern                 = \"PUSH\"\n      },\n      {\n        exclude_matched_pattern = false\n        type                    = \"HEAD_REF\"\n        pattern                 = \"dev\" # branch name\n    }]\n  }]\n\n  # To configure schedule\n  schedule            = \"rate(1 minute)\"\n  deploy_event_rule   = true\n  deploy_event_target = true\n  #-----------------------------------------------\n  # Note: Do not change teamid and prjid once set.\n  teamid = var.teamid\n  prjid  = var.prjid\n}\n```\n\nPlease refer to example directory [link](examples) for references.\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.0.1 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | ~\u003e 3.74 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | ~\u003e 3.74 |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_cloudwatch\"\u003e\u003c/a\u003e [cloudwatch](#module\\_cloudwatch) | git::git@github.com:tomarv2/terraform-aws-cloudwatch.git | v0.0.7 |\n| \u003ca name=\"module_cloudwatch_event\"\u003e\u003c/a\u003e [cloudwatch\\_event](#module\\_cloudwatch\\_event) | git::git@github.com:tomarv2/terraform-aws-cloudwatch-events.git | v0.0.4 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_codebuild_project.codebuild](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codebuild_project) | resource |\n| [aws_codebuild_source_credential.authorization](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codebuild_source_credential) | resource |\n| [aws_codebuild_source_credential.source_credentials](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codebuild_source_credential) | resource |\n| [aws_codebuild_webhook.codebuild_webook](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codebuild_webhook) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_badge_enabled\"\u003e\u003c/a\u003e [badge\\_enabled](#input\\_badge\\_enabled) | Generates a publicly-accessible URL for the projects build badge. Available as badge\\_url attribute when enabled | `bool` | `false` | no |\n| \u003ca name=\"input_branch\"\u003e\u003c/a\u003e [branch](#input\\_branch) | cloudwatch event branch | `string` | `\"main\"` | no |\n| \u003ca name=\"input_build_artifact_type\"\u003e\u003c/a\u003e [build\\_artifact\\_type](#input\\_build\\_artifact\\_type) | Build output artifact's type. Valid values: CODEPIPELINE, NO\\_ARTIFACTS, S3. | `string` | `\"NO_ARTIFACTS\"` | no |\n| \u003ca name=\"input_build_container_image\"\u003e\u003c/a\u003e [build\\_container\\_image](#input\\_build\\_container\\_image) | Docker image to use for this build project. Valid values include Docker images provided by CodeBuild (e.g aws/codebuild/standard:2.0). | `string` | `\"aws/codebuild/amazonlinux2-x86_64-standard:3.0\"` | no |\n| \u003ca name=\"input_build_source_location\"\u003e\u003c/a\u003e [build\\_source\\_location](#input\\_build\\_source\\_location) | Information about the build output artifact location. If type is set to CODEPIPELINE or NO\\_ARTIFACTS, this value is ignored. If type is set to S3, this is the name of the output bucket. | `string` | `null` | no |\n| \u003ca name=\"input_build_source_type\"\u003e\u003c/a\u003e [build\\_source\\_type](#input\\_build\\_source\\_type) | Type of repository that contains the source code to be built. Valid values: CODECOMMIT, CODEPIPELINE, GITHUB, GITHUB\\_ENTERPRISE, BITBUCKET or S3 | `string` | `\"GITHUB\"` | no |\n| \u003ca name=\"input_build_timeout\"\u003e\u003c/a\u003e [build\\_timeout](#input\\_build\\_timeout) | Number of minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed. The default is 60 minutes. | `string` | `\"60\"` | no |\n| \u003ca name=\"input_build_type\"\u003e\u003c/a\u003e [build\\_type](#input\\_build\\_type) | The type of build this webhook will trigger. Valid values for this parameter are: BUILD, BUILD\\_BATCH. | `string` | `\"BUILD\"` | no |\n| \u003ca name=\"input_buildspec_filepath\"\u003e\u003c/a\u003e [buildspec\\_filepath](#input\\_buildspec\\_filepath) | Build specification to use for this build project's related builds. | `string` | `\"\"` | no |\n| \u003ca name=\"input_cloudwatch_logs_status\"\u003e\u003c/a\u003e [cloudwatch\\_logs\\_status](#input\\_cloudwatch\\_logs\\_status) | Current status of logs in CloudWatch Logs for a build project. Valid values: ENABLED, DISABLED. Defaults to ENABLED. | `string` | `\"ENABLED\"` | no |\n| \u003ca name=\"input_cloudwatch_path\"\u003e\u003c/a\u003e [cloudwatch\\_path](#input\\_cloudwatch\\_path) | Name of the log group | `string` | `\"/codebuild\"` | no |\n| \u003ca name=\"input_codebuild_role\"\u003e\u003c/a\u003e [codebuild\\_role](#input\\_codebuild\\_role) | Service role to be used by cicd | `string` | n/a | yes |\n| \u003ca name=\"input_compute_type\"\u003e\u003c/a\u003e [compute\\_type](#input\\_compute\\_type) | Information about the compute resources the build project will use. Valid values: BUILD\\_GENERAL1\\_SMALL, BUILD\\_GENERAL1\\_MEDIUM, BUILD\\_GENERAL1\\_LARGE, BUILD\\_GENERAL1\\_2XLARGE. BUILD\\_GENERAL1\\_SMALL is only valid if type is set to LINUX\\_CONTAINER. When type is set to LINUX\\_GPU\\_CONTAINER, compute\\_type must be BUILD\\_GENERAL1\\_LARGE. | `string` | `\"BUILD_GENERAL1_MEDIUM\"` | no |\n| \u003ca name=\"input_concurrent_build_limit\"\u003e\u003c/a\u003e [concurrent\\_build\\_limit](#input\\_concurrent\\_build\\_limit) | Specify a maximum number of concurrent builds for the project. The value specified must be greater than 0 and less than the account concurrent running builds limit. | `number` | `1` | no |\n| \u003ca name=\"input_container_type\"\u003e\u003c/a\u003e [container\\_type](#input\\_container\\_type) | Type of build environment to use for related builds. Valid values: LINUX\\_CONTAINER, LINUX\\_GPU\\_CONTAINER, WINDOWS\\_CONTAINER (deprecated), WINDOWS\\_SERVER\\_2019\\_CONTAINER, ARM\\_CONTAINER. For additional information, see the CodeBuild User Guide. | `string` | `\"LINUX_CONTAINER\"` | no |\n| \u003ca name=\"input_custom_tags\"\u003e\u003c/a\u003e [custom\\_tags](#input\\_custom\\_tags) | Custom extra tags | `any` | `null` | no |\n| \u003ca name=\"input_deploy_event_rule\"\u003e\u003c/a\u003e [deploy\\_event\\_rule](#input\\_deploy\\_event\\_rule) | Deploy cloudwatch event rule | `bool` | `false` | no |\n| \u003ca name=\"input_deploy_event_target\"\u003e\u003c/a\u003e [deploy\\_event\\_target](#input\\_deploy\\_event\\_target) | Deploy cloudwatch event trigger | `bool` | `false` | no |\n| \u003ca name=\"input_description\"\u003e\u003c/a\u003e [description](#input\\_description) | Short description of the project. | `string` | `null` | no |\n| \u003ca name=\"input_environment_vars\"\u003e\u003c/a\u003e [environment\\_vars](#input\\_environment\\_vars) | A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build | \u003cpre\u003elist(object({\u003cbr\u003e    name  = string\u003cbr\u003e    value = string\u003cbr\u003e    type  = string\u003cbr\u003e  }))\u003c/pre\u003e | \u003cpre\u003e[\u003cbr\u003e  {\u003cbr\u003e    \"name\": \"NO_ADDITIONAL_BUILD_VARS\",\u003cbr\u003e    \"type\": \"PLAINTEXT\",\u003cbr\u003e    \"value\": \"TRUE\"\u003cbr\u003e  }\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_filter_group\"\u003e\u003c/a\u003e [filter\\_group](#input\\_filter\\_group) | nested block: NestingSet, min items: 0, max items: 0 | \u003cpre\u003eset(object(\u003cbr\u003e    {\u003cbr\u003e      filter = list(object(\u003cbr\u003e        {\u003cbr\u003e          exclude_matched_pattern = bool\u003cbr\u003e          pattern                 = string\u003cbr\u003e          type                    = string\u003cbr\u003e        }\u003cbr\u003e      ))\u003cbr\u003e    }\u003cbr\u003e  ))\u003c/pre\u003e | `[]` | no |\n| \u003ca name=\"input_git_clone_depth\"\u003e\u003c/a\u003e [git\\_clone\\_depth](#input\\_git\\_clone\\_depth) | Truncate git history to this many commits. Use 0 for a Full checkout which you need to run commands like git branch --show-current. See AWS CodePipeline User Guide: Tutorial: Use full clone with a GitHub pipeline source for details. | `number` | `1` | no |\n| \u003ca name=\"input_override_artifact_name\"\u003e\u003c/a\u003e [override\\_artifact\\_name](#input\\_override\\_artifact\\_name) | Whether a name specified in the build specification overrides the artifact name. | `bool` | `false` | no |\n| \u003ca name=\"input_private_repository\"\u003e\u003c/a\u003e [private\\_repository](#input\\_private\\_repository) | Set to true to login into private repository with credentials supplied in source\\_credential variable. | `bool` | `true` | no |\n| \u003ca name=\"input_privileged_mode\"\u003e\u003c/a\u003e [privileged\\_mode](#input\\_privileged\\_mode) | Whether to enable running the Docker daemon inside a Docker container. Defaults to false. | `bool` | `false` | no |\n| \u003ca name=\"input_prjid\"\u003e\u003c/a\u003e [prjid](#input\\_prjid) | Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply' | `string` | n/a | yes |\n| \u003ca name=\"input_queued_timeout\"\u003e\u003c/a\u003e [queued\\_timeout](#input\\_queued\\_timeout) | Number of minutes, from 5 to 480 (8 hours), a build is allowed to be queued before it times out. The default is 8 hours. | `string` | `\"30\"` | no |\n| \u003ca name=\"input_schedule\"\u003e\u003c/a\u003e [schedule](#input\\_schedule) | cloudwatch event schedule | `string` | `null` | no |\n| \u003ca name=\"input_source_credential_auth_type\"\u003e\u003c/a\u003e [source\\_credential\\_auth\\_type](#input\\_source\\_credential\\_auth\\_type) | The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. | `string` | `\"PERSONAL_ACCESS_TOKEN\"` | no |\n| \u003ca name=\"input_source_credential_server_type\"\u003e\u003c/a\u003e [source\\_credential\\_server\\_type](#input\\_source\\_credential\\_server\\_type) | The source provider used for this project. | `string` | `\"GITHUB\"` | no |\n| \u003ca name=\"input_source_credential_token\"\u003e\u003c/a\u003e [source\\_credential\\_token](#input\\_source\\_credential\\_token) | For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. | `string` | n/a | yes |\n| \u003ca name=\"input_source_credential_user_name\"\u003e\u003c/a\u003e [source\\_credential\\_user\\_name](#input\\_source\\_credential\\_user\\_name) | Bitbucket username when the authType is BASIC\\_AUTH. This parameter is not valid for other types of source providers or connections. | `string` | `\"\"` | no |\n| \u003ca name=\"input_source_version\"\u003e\u003c/a\u003e [source\\_version](#input\\_source\\_version) | A string that identifies the action type. | `string` | `null` | no |\n| \u003ca name=\"input_teamid\"\u003e\u003c/a\u003e [teamid](#input\\_teamid) | Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply' | `string` | n/a | yes |\n| \u003ca name=\"input_vpc_config\"\u003e\u003c/a\u003e [vpc\\_config](#input\\_vpc\\_config) | Configuration for the builds to run inside a VPC. | `any` | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_codebuild_project_arn\"\u003e\u003c/a\u003e [codebuild\\_project\\_arn](#output\\_codebuild\\_project\\_arn) | The ARN of the CodeBuild project. |\n| \u003ca name=\"output_codebuild_project_name\"\u003e\u003c/a\u003e [codebuild\\_project\\_name](#output\\_codebuild\\_project\\_name) | The name of the AWS codebuild. |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomarv2%2Fterraform-aws-codebuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomarv2%2Fterraform-aws-codebuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomarv2%2Fterraform-aws-codebuild/lists"}