Skip to content

Commit 20080c0

Browse files
authored
Merge pull request #13 from byu-oit/appspec-filename
appspec filename
2 parents 6511bd8 + 56d393e commit 20080c0

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Also Note: CodePipeline and CodeDeploy cannot be used together to deploy a Lambd
2626
## Usage
2727
```hcl
2828
module "lambda_api" {
29-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.1.0"
29+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.2.0"
3030
app_name = "my-lambda"
3131
env = "dev"
3232
codedeploy_service_role_arn = module.acs.power_builder_role.arn
@@ -90,6 +90,7 @@ module "lambda_api" {
9090
| hosted_zone | [object](#hosted_zone) | Hosted Zone object to redirect to ALB. (Can pass in the aws_hosted_zone object). A and AAAA records created in this hosted zone. |
9191
| https_certificate_arn | string | ARN of the HTTPS certificate of the hosted zone/domain. |
9292
| codedeploy_lifecycle_hooks | [object](#codedeploy_lifecycle_hooks) | Define Lambda Functions for CodeDeploy lifecycle event hooks. Or set this variable to null to not have any lifecycle hooks invoked. Defaults to null | null
93+
| appspec_filename | string | Filename (including path) to use when outputing appspec json. | `appspec.json` in the current working directory (i.e. where you ran `terraform apply`) |
9394
| codedeploy_test_listener_port | number | The port for a codedeploy test listener. If provided CodeDeploy will use this port for test traffic on the new replacement set during the blue-green deployment process before shifting production traffic to the replacement set. Defaults to null | null
9495
| vpc_id | string | VPC ID to deploy ALB and Lambda (If specified). |
9596
| public_subnet_ids | list(string) | List of subnet IDs for the ALB. |

examples/no-codedeploy/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "acs" {
99

1010
module "lambda_api" {
1111
# source = "../../"
12-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.1.0"
12+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.2.0"
1313
app_name = "my-lambda"
1414
env = "dev"
1515
lambda_zip_file = "./src/lambda.zip"

examples/simple-lambda-in-vpc/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "acs" {
99

1010
module "lambda_api" {
1111
# source = "../../"
12-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.1.0"
12+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.2.0"
1313
app_name = "my-lambda"
1414
env = "dev"
1515
lambda_zip_file = "./src/lambda.zip"

examples/simple-lambda-with-deploy-test/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "acs" {
99

1010
module "lambda_api" {
1111
# source = "../../"
12-
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.1.0"
12+
source = "github.com/byu-oit/terraform-aws-lambda-api?ref=v1.2.0"
1313
app_name = "my-lambda-codedeploy"
1414
env = "dev"
1515
codedeploy_service_role_arn = module.acs.power_builder_role.arn

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ resource "aws_iam_role_policy_attachment" "lambda_cloudwatch_attach" {
332332

333333
resource "local_file" "appspec_json" {
334334
count = var.use_codedeploy ? 1 : 0
335-
filename = "${path.cwd}/appspec.json"
335+
filename = var.appspec_filename != null ? var.appspec_filename : "${path.cwd}/appspec.json"
336336
content = jsonencode({
337337
version = 1
338338
Resources = [{

variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ variable "codedeploy_lifecycle_hooks" {
6666
default = null
6767
}
6868

69+
variable "appspec_filename" {
70+
type = string
71+
description = "Filename (including path) to use when outputing appspec json."
72+
default = null
73+
}
74+
6975
variable "codedeploy_test_listener_port" {
7076
type = number
7177
description = "The port for a codedeploy test listener. If provided CodeDeploy will use this port for test traffic on the new replacement set during the blue-green deployment process before shifting production traffic to the replacement set. Defaults to null"
@@ -120,4 +126,4 @@ variable "memory_size" {
120126
type = number
121127
description = "Memory Size of the lambda"
122128
default = 128
123-
}
129+
}

0 commit comments

Comments
 (0)