Skip to content

Commit fa3fe17

Browse files
authored
Merge pull request #12 from nikola-acuris/master
Reverting some defaults
2 parents 3be71a8 + 4d39c10 commit fa3fe17

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
}
44

55
resource "aws_lambda_function" "lambda_function" {
6-
image_uri = var.image_uri != "" ? var.image_uri : null
6+
image_uri = var.image_uri
77
s3_bucket = var.s3_bucket
88
s3_key = var.s3_key
99
function_name = var.function_name
@@ -14,11 +14,11 @@ resource "aws_lambda_function" "lambda_function" {
1414
memory_size = var.memory_size
1515
reserved_concurrent_executions = var.reserved_concurrent_executions
1616
tags = var.tags
17-
package_type = var.image_uri != "" ? "Image" : "Zip"
17+
package_type = var.image_uri != null ? "Image" : "Zip"
1818
layers = var.layers
1919

2020
dynamic "image_config" {
21-
for_each = var.image_uri != "" ? [1] : []
21+
for_each = var.image_uri != null ? [1] : []
2222
content {
2323
command = var.image_config_command
2424
entry_point = var.image_config_entry_point

test/files/create_lambda_container.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"resource_changes": [{
2+
"resource_changes": [{
33
"address": "module.lambda.aws_cloudwatch_log_group.lambda_loggroup",
44
"module_address": "module.lambda",
55
"mode": "managed",
@@ -101,7 +101,7 @@
101101
],
102102
"image_uri": "image",
103103
"kms_key_arn": null,
104-
"layers": null,
104+
"layers": [],
105105
"memory_size": 128,
106106
"package_type": "Image",
107107
"publish": false,
@@ -133,6 +133,7 @@
133133
],
134134
"invoke_arn": true,
135135
"last_modified": true,
136+
"layers": [],
136137
"qualified_arn": true,
137138
"role": true,
138139
"signing_job_arn": true,

variables.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
variable "image_uri" {
22
type = string
33
description = "Optional ECR image (for image based lambda)"
4-
default = ""
4+
default = null
55
}
66

77
variable "image_config_command" {
88
type = list(string)
99
description = "Optional override of image's CMD"
10-
default = null
10+
default = []
1111
}
1212

1313
variable "image_config_entry_point" {
1414
type = list(string)
1515
description = "Optional override of image's ENTRYPOINT"
16-
default = null
16+
default = []
1717
}
1818

1919
variable "image_config_working_directory" {
@@ -129,5 +129,5 @@ variable "tags" {
129129
variable "layers" {
130130
type = list(string)
131131
description = "ARNs of the layers to attach to the lambda function in order"
132-
default = null
132+
default = []
133133
}

0 commit comments

Comments
 (0)