Skip to content

Commit

Permalink
Merge pull request #12 from nikola-acuris/master
Browse files Browse the repository at this point in the history
Reverting some defaults
  • Loading branch information
marciogoda authored Apr 27, 2023
2 parents 3be71a8 + 4d39c10 commit fa3fe17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
}

resource "aws_lambda_function" "lambda_function" {
image_uri = var.image_uri != "" ? var.image_uri : null
image_uri = var.image_uri
s3_bucket = var.s3_bucket
s3_key = var.s3_key
function_name = var.function_name
Expand All @@ -14,11 +14,11 @@ resource "aws_lambda_function" "lambda_function" {
memory_size = var.memory_size
reserved_concurrent_executions = var.reserved_concurrent_executions
tags = var.tags
package_type = var.image_uri != "" ? "Image" : "Zip"
package_type = var.image_uri != null ? "Image" : "Zip"
layers = var.layers

dynamic "image_config" {
for_each = var.image_uri != "" ? [1] : []
for_each = var.image_uri != null ? [1] : []
content {
command = var.image_config_command
entry_point = var.image_config_entry_point
Expand Down
5 changes: 3 additions & 2 deletions test/files/create_lambda_container.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"resource_changes": [{
"resource_changes": [{
"address": "module.lambda.aws_cloudwatch_log_group.lambda_loggroup",
"module_address": "module.lambda",
"mode": "managed",
Expand Down Expand Up @@ -101,7 +101,7 @@
],
"image_uri": "image",
"kms_key_arn": null,
"layers": null,
"layers": [],
"memory_size": 128,
"package_type": "Image",
"publish": false,
Expand Down Expand Up @@ -133,6 +133,7 @@
],
"invoke_arn": true,
"last_modified": true,
"layers": [],
"qualified_arn": true,
"role": true,
"signing_job_arn": true,
Expand Down
8 changes: 4 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
variable "image_uri" {
type = string
description = "Optional ECR image (for image based lambda)"
default = ""
default = null
}

variable "image_config_command" {
type = list(string)
description = "Optional override of image's CMD"
default = null
default = []
}

variable "image_config_entry_point" {
type = list(string)
description = "Optional override of image's ENTRYPOINT"
default = null
default = []
}

variable "image_config_working_directory" {
Expand Down Expand Up @@ -129,5 +129,5 @@ variable "tags" {
variable "layers" {
type = list(string)
description = "ARNs of the layers to attach to the lambda function in order"
default = null
default = []
}

0 comments on commit fa3fe17

Please sign in to comment.