From 141af4e717d6a4b30eae1ab475d0f4d5a8e8f460 Mon Sep 17 00:00:00 2001 From: Robin Bowes Date: Mon, 21 Aug 2017 00:42:53 +0100 Subject: [PATCH] Allow optional buildspec to be passed to build project (#2) --- README.md | 1 + main.tf | 3 ++- variables.tf | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 517f96a..7d5b06e 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ resource "aws_iam_role_policy_attachment" "codebuild_s3" { | name | codebuild | Name | | image | alpine | Docker image used as environment | | instance_size | BUILD_GENERAL1_SMALL | Instance size for job. Possible values are: ```BUILD_GENERAL1_SMALL``` ```BUILD_GENERAL1_MEDIUM``` ```BUILD_GENERAL1_LARGE``` | +| buildspec | "" | Optional buildspec declaration to use for building the project | ## Output diff --git a/main.tf b/main.tf index fa3953f..fc7555d 100644 --- a/main.tf +++ b/main.tf @@ -73,7 +73,8 @@ resource "aws_codebuild_project" "default" { } source { - type = "CODEPIPELINE" + buildspec = "${var.buildspec}" + type = "CODEPIPELINE" } tags = "${module.label.tags}" diff --git a/variables.tf b/variables.tf index 8cb8394..9c119fb 100644 --- a/variables.tf +++ b/variables.tf @@ -17,3 +17,8 @@ variable "image" { variable "instance_size" { default = "BUILD_GENERAL1_SMALL" } + +variable "buildspec" { + default = "" + description = "Optional buildspec declaration to use for building the project" +}