Skip to content

Commit 6b10064

Browse files
authored
feat: Added interpreter variable to control script runtime in deploy module (#92)
1 parent fd23e3e commit 6b10064

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

iam.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ data "aws_iam_policy_document" "assume_role" {
2323

2424
principals {
2525
type = "Service"
26-
identifiers = distinct(concat(slice(list("lambda.amazonaws.com", "edgelambda.amazonaws.com"), 0, var.lambda_at_edge ? 2 : 1), var.trusted_entities))
26+
identifiers = distinct(concat(slice(["lambda.amazonaws.com", "edgelambda.amazonaws.com"], 0, var.lambda_at_edge ? 2 : 1), var.trusted_entities))
2727
}
2828
}
2929
}

modules/deploy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ No Modules.
160160
| description | Description to use for the deployment | `string` | `""` | no |
161161
| force\_deploy | Force deployment every time (even when nothing changes) | `bool` | `false` | no |
162162
| function\_name | The name of the Lambda function to deploy | `string` | `""` | no |
163+
| interpreter | List of interpreter arguments used to execute deploy script, first arg is path | `list(string)` | <pre>[<br> "/bin/bash",<br> "-c"<br>]</pre> | no |
163164
| save\_deploy\_script | Save deploy script locally | `bool` | `false` | no |
164165
| target\_version | Target version of Lambda function version to deploy | `string` | `""` | no |
165166
| triggers | Map of triggers which will be notified when event happens. Valid options for event types are DeploymentStart, DeploymentSuccess, DeploymentFailure, DeploymentStop, DeploymentRollback, DeploymentReady (Applies only to replacement instances in a blue/green deployment), InstanceStart, InstanceSuccess, InstanceFailure, InstanceReady. Note that not all are applicable for Lambda deployments. | `map(any)` | `{}` | no |

modules/deploy/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ resource "null_resource" "deploy" {
113113
}
114114

115115
provisioner "local-exec" {
116-
command = local.script
116+
command = local.script
117+
interpreter = var.interpreter
117118
}
118119
}
119120

modules/deploy/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ variable "after_allow_traffic_hook_arn" {
4040
default = ""
4141
}
4242

43+
variable "interpreter" {
44+
description = "List of interpreter arguments used to execute deploy script, first arg is path"
45+
type = list(string)
46+
default = ["/bin/bash", "-c"]
47+
}
48+
4349
variable "description" {
4450
description = "Description to use for the deployment"
4551
type = string

outputs.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,9 @@ output "local_filename" {
121121

122122
output "s3_object" {
123123
description = "The map with S3 object data of zip archive deployed (if deployment was from S3)"
124-
value = map("bucket", local.s3_bucket, "key", local.s3_key, "version_id", local.s3_object_version)
124+
value = {
125+
bucket = local.s3_bucket
126+
key = local.s3_key
127+
version_id = local.s3_object_version
128+
}
125129
}

0 commit comments

Comments
 (0)