README
¶
This repository provides the basic template for an AWS Codebuild Project
Requirements
| Name | Version |
|---|---|
| terraform | ~> 1.5.0 |
| aws | ~>5.0 |
| random | >= 2.1 |
Providers
| Name | Version |
|---|---|
| aws | 5.74.0 |
Modules
No modules.
Resources
| Name | Type |
|---|---|
| aws_codebuild_project.default | resource |
| aws_iam_role.codebuild_role | resource |
| aws_iam_role_policy.codebuild_policy | resource |
| aws_iam_policy_document.codebuild_assume_role_policy | data source |
| aws_iam_policy_document.codebuild_policy | data source |
Inputs
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| artifacts | list of artifacts for the codebuild project | list(object({ |
n/a | yes |
| badge_enabled | Generates a publicly-accessible URL for the projects build badge. Available as badge_url attribute when enabled | bool |
n/a | yes |
| build_compute_type | Instance type of the build instance | string |
n/a | yes |
| build_image | Docker image for build environment, e.g. 'aws/codebuild/standard:2.0' or 'aws/codebuild/eb-nodejs-6.10.0-amazonlinux-64:4.0.0'. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref.html | string |
n/a | yes |
| build_image_pull_credentials_type | Type of credentials AWS CodeBuild uses to pull images in your build.Valid values: CODEBUILD, SERVICE_ROLE. When you use a cross-account or private registry image, you must use SERVICE_ROLE credentials. | string |
"CODEBUILD" |
no |
| build_timeout | How long in 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 | number |
n/a | yes |
| build_type | The type of build environment, e.g. 'LINUX_CONTAINER' or 'WINDOWS_CONTAINER' | string |
n/a | yes |
| buildspec | Optional buildspec declaration to use for building the project | string |
"" |
no |
| cache_type | The type of storage that will be used for the AWS CodeBuild project cache. Valid values: NO_CACHE, LOCAL, and S3. Defaults to NO_CACHE. If cache_type is S3, the name of the S3 bucket will need to be provided | string |
"NO_CACHE" |
no |
| caches_modes | The type of data caching between builds. The inputs values are LOCAL_SOURCE_CACHE, LOCAL_DOCKER_LAYER_CACHE, LOCAL_CUSTOM_CACHE | string |
"LOCAL_CUSTOM_CACHE" |
no |
| class_env | (Required) Environment where resource is going to be deployed. For example. dev, qa, uat | string |
"dev" |
no |
| 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 |
null |
no |
| context | Single object for setting entire context at once. See description of individual variables for details. Leave string and numeric variables as null to use default value.Individual variable settings (non-null) override settings in context object, except for attributes, tags, and additional_tag_map, which are merged. |
any |
{ |
no |
| description | Short description of the CodeBuild project | string |
"Managed by Terraform" |
no |
| encryption_key | AWS Key Management Service (AWS KMS) customer master key (CMK) to be used for encrypting the build project's build output artifacts. | string |
null |
no |
| environment_variables | A list of maps, that contain the keys 'name', 'value', and 'type' to be used as additional environment variables for the build. Valid types are 'PLAINTEXT', 'PARAMETER_STORE', or 'SECRETS_MANAGER' | list(object( |
[] |
no |
| fetch_git_submodules | If set to true, fetches Git submodules for the AWS CodeBuild build project. | bool |
false |
no |
| file_system_locations | A set of file system locations to to mount inside the build. File system locations are documented below. | any |
{} |
no |
| git_clone_depth | Truncate git history to this many commits. | number |
null |
no |
| instance_env | Number that represents the instance of the environment. | number |
0 |
no |
| instance_resource | Number that represents the instance of the resource. | number |
0 |
no |
| label_key_case | Controls the letter case of the tags keys (label names) for tags generated by this module.Does not affect keys of tags passed in via the tags input.Possible values: lower, title, upper.Default value: title. |
string |
null |
no |
| label_value_case | Controls the letter case of ID elements (labels) as included in id,set as tag values, and output by this module individually. Does not affect values of tags passed in via the tags input.Possible values: lower, title, upper and none (no transformation).Set this to title and set delimiter to "" to yield Pascal Case IDs.Default value: lower. |
string |
null |
no |
| logical_product_family | (Required) Name of the product family for which the resource is created. Example: org_name, department_name. |
string |
"launch" |
no |
| logical_product_service | (Required) Name of the product service for which the resource is created. For example, backend, frontend, middleware etc. |
string |
"servicename" |
no |
| logs_config | Configuration for the builds to store log data to CloudWatch or S3. | any |
{} |
no |
| privileged_mode | (Optional) If set to true, enables running the Docker daemon inside a Docker container on the CodeBuild instance. Used when building Docker images | bool |
n/a | yes |
| project_name | Name of the codebuild project. | string |
n/a | yes |
| report_build_status | Set to true to report the status of a build's start and finish to your source provider. This option is only valid when the source_type is BITBUCKET or GITHUB | bool |
false |
no |
| secondary_artifacts | List of secondary artifacts for the codebuild project | list(object({ |
n/a | yes |
| secondary_sources | (Optional) secondary source for the codebuild project in addition to the primary location | list(object( |
[] |
no |
| service_role_arn | The ARN of the IAM role for Codebuild | string |
n/a | yes |
| source_location | The location of the source code from git or s3 | string |
"" |
no |
| source_type | The type of repository that contains the source code to be built. Valid values for this parameter are: CODECOMMIT, CODEPIPELINE, GITHUB, GITHUB_ENTERPRISE, BITBUCKET or S3 | string |
n/a | yes |
| source_version | A version of the build input to be built for this project. If not specified, the latest version is used. | string |
"" |
no |
| tags | Additional tags (e.g. {'BusinessUnit': 'XYZ'}).Neither the tag keys nor the tag values will be modified by this module. |
map(string) |
{} |
no |
| vpc_config | Configuration for the builds to run inside a VPC. | any |
{} |
no |
Outputs
| Name | Description |
|---|---|
| badge_url | The URL of the build badge when badge_enabled is enabled |
| buildspec | The buildspec used with the CodeBuild project |
| project_arn | Project ARN |
| project_id | Project ID |
| project_name | Project name |
| service_role_arn | The arn of the service role created for the codebuild project |
Click to show internal directories.
Click to hide internal directories.