Skip to content

Commit 1e66cb4

Browse files
sthomas1618ostermanactions-bot
authored
Add Build Type option (#55)
* Add built_type Allow build environments other than LINUX_CONTAINER. * Update readme * variable order * Updated README.md Co-authored-by: Erik Osterman <[email protected]> Co-authored-by: actions-bot <[email protected]>
1 parent 303e737 commit 1e66cb4

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Available targets:
155155
| build_compute_type | Instance type of the build instance | string | `BUILD_GENERAL1_SMALL` | no |
156156
| 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 | `aws/codebuild/standard:2.0` | no |
157157
| 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 | string | `60` | no |
158+
| build_type | The type of build environment, e.g. 'LINUX_CONTAINER' or 'WINDOWS_CONTAINER' | string | `LINUX_CONTAINER` | no |
158159
| buildspec | Optional buildspec declaration to use for building the project | string | `` | no |
159160
| cache_bucket_suffix_enabled | The cache bucket generates a random 13 character string to generate a unique bucket name. If set to false it uses terraform-null-label's id value. It only works when cache_type is 'S3 | bool | `true` | no |
160161
| cache_expiration_days | How many days should the build cache be kept. It only works when cache_type is 'S3' | string | `7` | no |

docs/terraform.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
| build_compute_type | Instance type of the build instance | string | `BUILD_GENERAL1_SMALL` | no |
1111
| 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 | `aws/codebuild/standard:2.0` | no |
1212
| 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 | string | `60` | no |
13+
| build_type | The type of build environment, e.g. 'LINUX_CONTAINER' or 'WINDOWS_CONTAINER' | string | `LINUX_CONTAINER` | no |
1314
| buildspec | Optional buildspec declaration to use for building the project | string | `` | no |
1415
| cache_bucket_suffix_enabled | The cache bucket generates a random 13 character string to generate a unique bucket name. If set to false it uses terraform-null-label's id value. It only works when cache_type is 'S3 | bool | `true` | no |
1516
| cache_expiration_days | How many days should the build cache be kept. It only works when cache_type is 'S3' | string | `7` | no |

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ resource "aws_codebuild_project" "default" {
194194
environment {
195195
compute_type = var.build_compute_type
196196
image = var.build_image
197-
type = "LINUX_CONTAINER"
197+
type = var.build_type
198198
privileged_mode = var.privileged_mode
199199

200200
environment_variable {

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ variable "build_timeout" {
8383
description = "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"
8484
}
8585

86+
variable "build_type" {
87+
type = string
88+
default = "LINUX_CONTAINER"
89+
description = "The type of build environment, e.g. 'LINUX_CONTAINER' or 'WINDOWS_CONTAINER'"
90+
}
91+
8692
variable "buildspec" {
8793
type = string
8894
default = ""

0 commit comments

Comments
 (0)