diff --git a/README.md b/README.md index be44d05..6e242d6 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ CodeBuild job to deploy it. | ------------------------- | --------------------------------------------------------------------------| ------------ | | github_url | GitHub URL of function or layer code. Enables CodeBuild. Assumes buildspec.yml at root of repo. Requires github_token_ssm_param | "" | | codebuild_credential_arn | AWS Codebuild source credential for accessing github | "" | +| build_timeout | Codebuild Timeout in minutes. | "60" | ### lambda_function Many of the module arguments map directly to the [aws_lambda_function](https://www.terraform.io/docs/providers/aws/r/lambda_function.html) resource arguments: diff --git a/lambda_function/ci.tf b/lambda_function/ci.tf index f41a098..3c08f95 100644 --- a/lambda_function/ci.tf +++ b/lambda_function/ci.tf @@ -56,7 +56,7 @@ resource "aws_codebuild_project" "lambda" { count = var.github_url == "" ? 0 : 1 name = var.function_name - build_timeout = "5" + build_timeout = var.build_timeout service_role = aws_iam_role.codebuild[0].arn artifacts { diff --git a/lambda_function/variables.tf b/lambda_function/variables.tf index c3d7c65..be0c064 100644 --- a/lambda_function/variables.tf +++ b/lambda_function/variables.tf @@ -105,16 +105,21 @@ variable "reserved_concurrent_executions" { } variable "github_url" { - type = string + type = string default = "" } variable "layers" { - type = list(string) + type = list(string) default = [] } variable "codebuild_credential_arn" { type = string default = "" -} \ No newline at end of file +} + +variable "build_timeout" { + type = string + default = "60" +} diff --git a/lambda_layer/ci.tf b/lambda_layer/ci.tf index 4993ce0..8781d2c 100644 --- a/lambda_layer/ci.tf +++ b/lambda_layer/ci.tf @@ -56,7 +56,7 @@ resource "aws_codebuild_project" "lambda" { count = var.github_url == "" ? 0 : 1 name = var.layer_name - build_timeout = "5" + build_timeout = var.build_timeout service_role = aws_iam_role.codebuild[0].arn artifacts { diff --git a/lambda_layer/variables.tf b/lambda_layer/variables.tf index 7000ef6..6a28f5c 100644 --- a/lambda_layer/variables.tf +++ b/lambda_layer/variables.tf @@ -46,3 +46,8 @@ variable "codebuild_credential_arn" { type = string default = "" } + +variable "build_timeout" { + type = string + default = "60" +}