Skip to content

Commit

Permalink
Merge pull request #9 from clouddrove/CD-147
Browse files Browse the repository at this point in the history
little bug fix
  • Loading branch information
Nikita Dugar authored Apr 15, 2020
2 parents 9853c35 + 0fecb6d commit 515f11f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Here are some examples of how you can use this module in your inventory structur
names = [
"python_layer"
]
layer_filename = "./../../lambda/packages/Python3-lambda.zip"
layer_filenames = ["./../../lambda/packages/Python3-lambda.zip"]
compatible_runtimes = [
["python3.8"]
]
Expand Down Expand Up @@ -172,7 +172,7 @@ Here are some examples of how you can use this module in your inventory structur
| iam\_actions | The actions for Iam Role Policy. | list | `<list>` | no |
| kms\_key\_arn | The ARN for the KMS encryption key. | string | `""` | no |
| label\_order | Label order, e.g. `name`,`application`. | list | `<list>` | no |
| layer\_filename | The path to the function's deployment package within the local filesystem. If defined, The s3\_-prefixed options cannot be used. | string | `""` | no |
| layer\_filenames | The path to the function's deployment package within the local filesystem. If defined, The s3\_-prefixed options cannot be used. | list | `<list>` | no |
| layers | List of Lambda Layer Version ARNs \(maximum of 5\) to attach to your Lambda Function. | string | `""` | no |
| license\_infos | License info for your Lambda Layer. See License Info. | list | `<list>` | no |
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `"anmol@clouddrove.com"` | no |
Expand Down
2 changes: 1 addition & 1 deletion README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ usage : |-
names = [
"python_layer"
]
layer_filename = "./../../lambda/packages/Python3-lambda.zip"
layer_filenames = ["./../../lambda/packages/Python3-lambda.zip"]
compatible_runtimes = [
["python3.8"]
]
Expand Down
2 changes: 1 addition & 1 deletion _example/complete-function/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module "lambda" {
names = [
"python_layer"
]
layer_filename = "./../../lambda/packages/Python3-lambda.zip"
layer_filenames = ["./../../lambda/packages/Python3-lambda.zip"]
compatible_runtimes = [
["python3.8"]
]
Expand Down
3 changes: 1 addition & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@ resource "aws_iam_role_policy_attachment" "default" {
# Description : Terraform module to create Lambda layers resource on AWS.
resource "aws_lambda_layer_version" "default" {
count = length(var.names) > 0 && var.enabled ? length(var.names) : 0
filename = length(var.layer_filename) > 0 ? var.layer_filename : null
filename = length(var.layer_filenames) > 0 ? element(var.layer_filenames, count.index) : null
s3_bucket = length(var.s3_buckets) > 0 ? element(var.s3_buckets, count.index) : null
s3_key = length(var.s3_keies) > 0 ? element(var.s3_keies, count.index) : null
s3_object_version = length(var.s3_object_versions) > 0 ? element(var.s3_object_versions, count.index) : null
layer_name = element(var.names, count.index)
compatible_runtimes = element(var.compatible_runtimes, count.index)
description = length(var.descriptions) > 0 ? element(var.descriptions, count.index) : ""
license_info = length(var.license_infos) > 0 ? element(var.license_infos, count.index) : ""
source_code_hash = length(var.layer_filename) > 0 ? filesha256(var.layer_filename) : ""
}

# Module : Archive file
Expand Down
6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ variable "kms_key_arn" {
description = "The ARN for the KMS encryption key."
}

variable "layer_filename" {
type = string
default = ""
variable "layer_filenames" {
type = list
default = []
description = "The path to the function's deployment package within the local filesystem. If defined, The s3_-prefixed options cannot be used."
}

Expand Down

0 comments on commit 515f11f

Please sign in to comment.