Skip to content

Commit 00286b6

Browse files
committed
add appspec_filename variable
1 parent b974704 commit 00286b6

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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. |

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)