From 86447313a9604e187e1e3278cddaa3e99d8fc220 Mon Sep 17 00:00:00 2001 From: lior Date: Sat, 26 Mar 2022 00:02:01 -0700 Subject: [PATCH 1/8] add support for ephemeral storage size configuration --- README.md | 1 + examples/ephemeral-stoage/.gitignore | 1 + examples/ephemeral-stoage/README.md | 71 ++++++++++++++++++ examples/ephemeral-stoage/main.tf | 27 +++++++ examples/ephemeral-stoage/outputs.tf | 99 ++++++++++++++++++++++++++ examples/ephemeral-stoage/variables.tf | 0 examples/ephemeral-stoage/versions.tf | 8 +++ main.tf | 4 ++ variables.tf | 6 ++ versions.tf | 2 +- 10 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 examples/ephemeral-stoage/.gitignore create mode 100644 examples/ephemeral-stoage/README.md create mode 100644 examples/ephemeral-stoage/main.tf create mode 100644 examples/ephemeral-stoage/outputs.tf create mode 100644 examples/ephemeral-stoage/variables.tf create mode 100644 examples/ephemeral-stoage/versions.tf diff --git a/README.md b/README.md index 1f89893f..c909279d 100644 --- a/README.md +++ b/README.md @@ -702,6 +702,7 @@ No modules. | [docker\_pip\_cache](#input\_docker\_pip\_cache) | Whether to mount a shared pip cache folder into docker environment or not | `any` | `null` | no | | [docker\_with\_ssh\_agent](#input\_docker\_with\_ssh\_agent) | Whether to pass SSH\_AUTH\_SOCK into docker environment or not | `bool` | `false` | no | | [environment\_variables](#input\_environment\_variables) | A map that defines environment variables for the Lambda Function. | `map(string)` | `{}` | no | +| [ephemeral\_storage\_size](#input\_ephemeral\_storage\_size) | Amount of ephemeral storage size (`/tmp`) in MB your Lambda Function can use at runtime. Valid value between 512 MB to 10,240 MB (10 GB). | `number` | `512` | no | | [event\_source\_mapping](#input\_event\_source\_mapping) | Map of event source mapping | `any` | `{}` | no | | [file\_system\_arn](#input\_file\_system\_arn) | The Amazon Resource Name (ARN) of the Amazon EFS Access Point that provides access to the file system. | `string` | `null` | no | | [file\_system\_local\_mount\_path](#input\_file\_system\_local\_mount\_path) | The path where the function can access the file system, starting with /mnt/. | `string` | `null` | no | diff --git a/examples/ephemeral-stoage/.gitignore b/examples/ephemeral-stoage/.gitignore new file mode 100644 index 00000000..b205ba3d --- /dev/null +++ b/examples/ephemeral-stoage/.gitignore @@ -0,0 +1 @@ +builds/* diff --git a/examples/ephemeral-stoage/README.md b/examples/ephemeral-stoage/README.md new file mode 100644 index 00000000..4e2ea2e4 --- /dev/null +++ b/examples/ephemeral-stoage/README.md @@ -0,0 +1,71 @@ +# Ephemeral storage example + +Example how to configure emphemeral storage size (`/tmp`). + +## Usage + +To run this example you need to execute: + +```bash +$ terraform init +$ terraform plan +$ terraform apply +``` + +Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 0.13.1 | +| [aws](#requirement\_aws) | >= 4.8.0 | +| [random](#requirement\_random) | >= 2 | + +## Providers + +| Name | Version | +|------|---------| +| [random](#provider\_random) | >= 2 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [lambda\_function](#module\_lambda\_function) | ../../ | n/a | + +## Resources + +| Name | Type | +|------|------| +| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource | + +## Inputs + +No inputs. + +## Outputs + +| Name | Description | +|------|-------------| +| [lambda\_cloudwatch\_log\_group\_arn](#output\_lambda\_cloudwatch\_log\_group\_arn) | The ARN of the Cloudwatch Log Group | +| [lambda\_function\_arn](#output\_lambda\_function\_arn) | The ARN of the Lambda Function | +| [lambda\_function\_invoke\_arn](#output\_lambda\_function\_invoke\_arn) | The Invoke ARN of the Lambda Function | +| [lambda\_function\_kms\_key\_arn](#output\_lambda\_function\_kms\_key\_arn) | The ARN for the KMS encryption key of Lambda Function | +| [lambda\_function\_last\_modified](#output\_lambda\_function\_last\_modified) | The date Lambda Function resource was last modified | +| [lambda\_function\_name](#output\_lambda\_function\_name) | The name of the Lambda Function | +| [lambda\_function\_qualified\_arn](#output\_lambda\_function\_qualified\_arn) | The ARN identifying your Lambda Function Version | +| [lambda\_function\_source\_code\_hash](#output\_lambda\_function\_source\_code\_hash) | Base64-encoded representation of raw SHA-256 sum of the zip file | +| [lambda\_function\_source\_code\_size](#output\_lambda\_function\_source\_code\_size) | The size in bytes of the function .zip file | +| [lambda\_function\_version](#output\_lambda\_function\_version) | Latest published version of Lambda Function | +| [lambda\_layer\_arn](#output\_lambda\_layer\_arn) | The ARN of the Lambda Layer with version | +| [lambda\_layer\_created\_date](#output\_lambda\_layer\_created\_date) | The date Lambda Layer resource was created | +| [lambda\_layer\_layer\_arn](#output\_lambda\_layer\_layer\_arn) | The ARN of the Lambda Layer without version | +| [lambda\_layer\_source\_code\_size](#output\_lambda\_layer\_source\_code\_size) | The size in bytes of the Lambda Layer .zip file | +| [lambda\_layer\_version](#output\_lambda\_layer\_version) | The Lambda Layer version | +| [lambda\_role\_arn](#output\_lambda\_role\_arn) | The ARN of the IAM role created for the Lambda Function | +| [lambda\_role\_name](#output\_lambda\_role\_name) | The name of the IAM role created for the Lambda Function | +| [local\_filename](#output\_local\_filename) | The filename of zip archive deployed (if deployment was from local) | +| [s3\_object](#output\_s3\_object) | The map with S3 object data of zip archive deployed (if deployment was from S3) | + diff --git a/examples/ephemeral-stoage/main.tf b/examples/ephemeral-stoage/main.tf new file mode 100644 index 00000000..a3023082 --- /dev/null +++ b/examples/ephemeral-stoage/main.tf @@ -0,0 +1,27 @@ +provider "aws" { + region = "eu-west-1" + + # Make it faster by skipping something + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_region_validation = true + skip_credentials_validation = true + skip_requesting_account_id = true +} + +resource "random_pet" "this" { + length = 2 +} + +module "lambda_function" { + source = "../../" + + publish = true + + function_name = "${random_pet.this.id}-lambda-ephemeral-stoage" + handler = "index.lambda_handler" + runtime = "python3.8" + ephemeral_storage = 10240 + +} + diff --git a/examples/ephemeral-stoage/outputs.tf b/examples/ephemeral-stoage/outputs.tf new file mode 100644 index 00000000..83dbee63 --- /dev/null +++ b/examples/ephemeral-stoage/outputs.tf @@ -0,0 +1,99 @@ +# Lambda Function +output "lambda_function_arn" { + description = "The ARN of the Lambda Function" + value = module.lambda_function.lambda_function_arn +} + +output "lambda_function_invoke_arn" { + description = "The Invoke ARN of the Lambda Function" + value = module.lambda_function.lambda_function_invoke_arn +} + +output "lambda_function_name" { + description = "The name of the Lambda Function" + value = module.lambda_function.lambda_function_name +} + +output "lambda_function_qualified_arn" { + description = "The ARN identifying your Lambda Function Version" + value = module.lambda_function.lambda_function_qualified_arn +} + +output "lambda_function_version" { + description = "Latest published version of Lambda Function" + value = module.lambda_function.lambda_function_version +} + +output "lambda_function_last_modified" { + description = "The date Lambda Function resource was last modified" + value = module.lambda_function.lambda_function_last_modified +} + +output "lambda_function_kms_key_arn" { + description = "The ARN for the KMS encryption key of Lambda Function" + value = module.lambda_function.lambda_function_kms_key_arn +} + +output "lambda_function_source_code_hash" { + description = "Base64-encoded representation of raw SHA-256 sum of the zip file" + value = module.lambda_function.lambda_function_source_code_hash +} + +output "lambda_function_source_code_size" { + description = "The size in bytes of the function .zip file" + value = module.lambda_function.lambda_function_source_code_size +} + +# Lambda Layer +output "lambda_layer_arn" { + description = "The ARN of the Lambda Layer with version" + value = module.lambda_function.lambda_layer_arn +} + +output "lambda_layer_layer_arn" { + description = "The ARN of the Lambda Layer without version" + value = module.lambda_function.lambda_layer_layer_arn +} + +output "lambda_layer_created_date" { + description = "The date Lambda Layer resource was created" + value = module.lambda_function.lambda_layer_created_date +} + +output "lambda_layer_source_code_size" { + description = "The size in bytes of the Lambda Layer .zip file" + value = module.lambda_function.lambda_layer_source_code_size +} + +output "lambda_layer_version" { + description = "The Lambda Layer version" + value = module.lambda_function.lambda_layer_version +} + +# IAM Role +output "lambda_role_arn" { + description = "The ARN of the IAM role created for the Lambda Function" + value = module.lambda_function.lambda_role_arn +} + +output "lambda_role_name" { + description = "The name of the IAM role created for the Lambda Function" + value = module.lambda_function.lambda_role_name +} + +# CloudWatch Log Group +output "lambda_cloudwatch_log_group_arn" { + description = "The ARN of the Cloudwatch Log Group" + value = module.lambda_function.lambda_cloudwatch_log_group_arn +} + +# Deployment package +output "local_filename" { + description = "The filename of zip archive deployed (if deployment was from local)" + value = module.lambda_function.local_filename +} + +output "s3_object" { + description = "The map with S3 object data of zip archive deployed (if deployment was from S3)" + value = module.lambda_function.s3_object +} diff --git a/examples/ephemeral-stoage/variables.tf b/examples/ephemeral-stoage/variables.tf new file mode 100644 index 00000000..e69de29b diff --git a/examples/ephemeral-stoage/versions.tf b/examples/ephemeral-stoage/versions.tf new file mode 100644 index 00000000..9e58d511 --- /dev/null +++ b/examples/ephemeral-stoage/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_version = ">= 0.13.1" + + required_providers { + aws = ">= 4.8.0" + random = ">= 2" + } +} diff --git a/main.tf b/main.tf index 24f81116..ed6d0978 100644 --- a/main.tf +++ b/main.tf @@ -37,6 +37,10 @@ resource "aws_lambda_function" "this" { package_type = var.package_type architectures = var.architectures + ephemeral_storage { + size = var.ephemeral_storage_size + } + filename = local.filename source_code_hash = var.ignore_source_code_hash ? null : (local.filename == null ? false : fileexists(local.filename)) && !local.was_missing ? filebase64sha256(local.filename) : null diff --git a/variables.tf b/variables.tf index 24243bfa..b1751877 100644 --- a/variables.tf +++ b/variables.tf @@ -103,6 +103,12 @@ variable "memory_size" { default = 128 } +variable "ephemeral_storage_size" { + description = "Amount of ephemeral storage (/tmp) in MB your Lambda Function can use at runtime. Valid value between 512 MB to 10,240 MB (10 GB)." + type = number + default = 512 +} + variable "publish" { description = "Whether to publish creation/change as new Lambda Function Version." type = bool diff --git a/versions.tf b/versions.tf index 3727a394..e54af37b 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 3.69" + version = ">= 4.8.0" } external = { source = "hashicorp/external" From 04d09a6e5b3e8fcf6bbe35bd6608e666cbd06214 Mon Sep 17 00:00:00 2001 From: lior Date: Sat, 26 Mar 2022 00:05:22 -0700 Subject: [PATCH 2/8] Upgrade aws provider version --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c909279d..6c50c4f1 100644 --- a/README.md +++ b/README.md @@ -594,7 +594,7 @@ Q4: What does this error mean - `"We currently do not support adding policies fo | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 3.69 | +| [aws](#requirement\_aws) | >= 4.8.0 | | [external](#requirement\_external) | >= 1.0 | | [local](#requirement\_local) | >= 1.0 | | [null](#requirement\_null) | >= 2.0 | @@ -603,7 +603,7 @@ Q4: What does this error mean - `"We currently do not support adding policies fo | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 3.69 | +| [aws](#provider\_aws) | >= 4.8.0 | | [external](#provider\_external) | >= 1.0 | | [local](#provider\_local) | >= 1.0 | | [null](#provider\_null) | >= 2.0 | From 562e7c7410181ad76b920bc2d3186dbad345b486 Mon Sep 17 00:00:00 2001 From: lior Date: Sat, 26 Mar 2022 00:14:40 -0700 Subject: [PATCH 3/8] replace deprecated resource 'aws_s3_bucket_object' to 'aws_s3_object' --- main.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index ed6d0978..5296554c 100644 --- a/main.tf +++ b/main.tf @@ -15,7 +15,7 @@ locals { # s3_* - to get package from S3 s3_bucket = var.s3_existing_package != null ? lookup(var.s3_existing_package, "bucket", null) : (var.store_on_s3 ? var.s3_bucket : null) s3_key = var.s3_existing_package != null ? lookup(var.s3_existing_package, "key", null) : (var.store_on_s3 ? var.s3_prefix != null ? format("%s%s", var.s3_prefix, replace(local.archive_filename_string, "/^.*//", "")) : replace(local.archive_filename_string, "/^\\.//", "") : null) - s3_object_version = var.s3_existing_package != null ? lookup(var.s3_existing_package, "version_id", null) : (var.store_on_s3 ? try(aws_s3_bucket_object.lambda_package[0].version_id, null) : null) + s3_object_version = var.s3_existing_package != null ? lookup(var.s3_existing_package, "version_id", null) : (var.store_on_s3 ? try(aws_s3_object.lambda_package[0].version_id, null) : null) } @@ -100,7 +100,7 @@ resource "aws_lambda_function" "this" { # When a lambda function is invoked, AWS creates the log group automatically if it doesn't exist yet. # Without the dependency, this can result in a race condition if the lambda function is invoked before # Terraform can create the log group. - depends_on = [null_resource.archive, aws_s3_bucket_object.lambda_package, aws_cloudwatch_log_group.lambda] + depends_on = [null_resource.archive, aws_s3_object.lambda_package, aws_cloudwatch_log_group.lambda] } resource "aws_lambda_layer_version" "this" { @@ -121,10 +121,10 @@ resource "aws_lambda_layer_version" "this" { s3_key = local.s3_key s3_object_version = local.s3_object_version - depends_on = [null_resource.archive, aws_s3_bucket_object.lambda_package] + depends_on = [null_resource.archive, aws_s3_object.lambda_package] } -resource "aws_s3_bucket_object" "lambda_package" { +resource "aws_s3_object" "lambda_package" { count = local.create && var.store_on_s3 && var.create_package ? 1 : 0 bucket = var.s3_bucket From d319b32feea385f22a6719246076d041a3fbc2a8 Mon Sep 17 00:00:00 2001 From: lior Date: Sat, 26 Mar 2022 00:26:55 -0700 Subject: [PATCH 4/8] fix bug of ephemeral storage field name --- examples/ephemeral-stoage/main.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/ephemeral-stoage/main.tf b/examples/ephemeral-stoage/main.tf index a3023082..b6a30bef 100644 --- a/examples/ephemeral-stoage/main.tf +++ b/examples/ephemeral-stoage/main.tf @@ -18,10 +18,10 @@ module "lambda_function" { publish = true - function_name = "${random_pet.this.id}-lambda-ephemeral-stoage" - handler = "index.lambda_handler" - runtime = "python3.8" - ephemeral_storage = 10240 + function_name = "${random_pet.this.id}-lambda-ephemeral-stoage" + handler = "index.lambda_handler" + runtime = "python3.8" + ephemeral_storage_size = 10240 } From aa82d0a7b2ef1760cff5f1bc02f1323f65cbdd44 Mon Sep 17 00:00:00 2001 From: lior Date: Sat, 26 Mar 2022 00:30:43 -0700 Subject: [PATCH 5/8] replace deprecated resource 'aws_s3_bucket_object' to 'aws_s3_object' --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6c50c4f1..7d2959c7 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ resource "aws_s3_bucket" "builds" { acl = "private" } -resource "aws_s3_bucket_object" "my_function" { +resource "aws_s3_object" "my_function" { bucket = aws_s3_bucket.builds.id key = "${filemd5(local.my_function_source)}.zip" source = local.my_function_source @@ -165,7 +165,7 @@ module "lambda_function_existing_package_s3" { create_package = false s3_existing_package = { bucket = aws_s3_bucket.builds.id - key = aws_s3_bucket_object.my_function.id + key = aws_s3_object.my_function.id } } ``` @@ -643,7 +643,7 @@ No modules. | [aws_lambda_permission.current_version_triggers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource | | [aws_lambda_permission.unqualified_alias_triggers](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource | | [aws_lambda_provisioned_concurrency_config.current_version](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_provisioned_concurrency_config) | resource | -| [aws_s3_bucket_object.lambda_package](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_object) | resource | +| [aws_s3_object.lambda_package](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_object) | resource | | [local_file.archive_plan](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource | | [null_resource.archive](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | | [aws_arn.log_group_arn](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/arn) | data source | From 576af9cc517c3165cb92197534d41c350fa30fc7 Mon Sep 17 00:00:00 2001 From: lior Date: Sat, 26 Mar 2022 00:55:18 -0700 Subject: [PATCH 6/8] pre-commit end of file fixer --- examples/ephemeral-stoage/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/ephemeral-stoage/main.tf b/examples/ephemeral-stoage/main.tf index b6a30bef..4fc7f795 100644 --- a/examples/ephemeral-stoage/main.tf +++ b/examples/ephemeral-stoage/main.tf @@ -24,4 +24,3 @@ module "lambda_function" { ephemeral_storage_size = 10240 } - From 2647ec15e7cd98dc6d0e973934de934fcf297c1a Mon Sep 17 00:00:00 2001 From: liortct Date: Sat, 26 Mar 2022 21:52:45 +0300 Subject: [PATCH 7/8] add ephemeral storage example --- examples/complete/main.tf | 13 ++-- examples/ephemeral-stoage/.gitignore | 1 - examples/ephemeral-stoage/README.md | 71 ------------------ examples/ephemeral-stoage/main.tf | 26 ------- examples/ephemeral-stoage/outputs.tf | 99 -------------------------- examples/ephemeral-stoage/variables.tf | 0 examples/ephemeral-stoage/versions.tf | 8 --- 7 files changed, 7 insertions(+), 211 deletions(-) delete mode 100644 examples/ephemeral-stoage/.gitignore delete mode 100644 examples/ephemeral-stoage/README.md delete mode 100644 examples/ephemeral-stoage/main.tf delete mode 100644 examples/ephemeral-stoage/outputs.tf delete mode 100644 examples/ephemeral-stoage/variables.tf delete mode 100644 examples/ephemeral-stoage/versions.tf diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 4c4a0208..56bc0383 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -17,12 +17,13 @@ provider "aws" { module "lambda_function" { source = "../../" - function_name = "${random_pet.this.id}-lambda1" - description = "My awesome lambda function" - handler = "index.lambda_handler" - runtime = "python3.8" - architectures = ["x86_64"] - publish = true + function_name = "${random_pet.this.id}-lambda1" + description = "My awesome lambda function" + handler = "index.lambda_handler" + runtime = "python3.8" + ephemeral_storage_size = 10240 + architectures = ["x86_64"] + publish = true source_path = "${path.module}/../fixtures/python3.8-app1" diff --git a/examples/ephemeral-stoage/.gitignore b/examples/ephemeral-stoage/.gitignore deleted file mode 100644 index b205ba3d..00000000 --- a/examples/ephemeral-stoage/.gitignore +++ /dev/null @@ -1 +0,0 @@ -builds/* diff --git a/examples/ephemeral-stoage/README.md b/examples/ephemeral-stoage/README.md deleted file mode 100644 index 4e2ea2e4..00000000 --- a/examples/ephemeral-stoage/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# Ephemeral storage example - -Example how to configure emphemeral storage size (`/tmp`). - -## Usage - -To run this example you need to execute: - -```bash -$ terraform init -$ terraform plan -$ terraform apply -``` - -Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. - - -## Requirements - -| Name | Version | -|------|---------| -| [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 4.8.0 | -| [random](#requirement\_random) | >= 2 | - -## Providers - -| Name | Version | -|------|---------| -| [random](#provider\_random) | >= 2 | - -## Modules - -| Name | Source | Version | -|------|--------|---------| -| [lambda\_function](#module\_lambda\_function) | ../../ | n/a | - -## Resources - -| Name | Type | -|------|------| -| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource | - -## Inputs - -No inputs. - -## Outputs - -| Name | Description | -|------|-------------| -| [lambda\_cloudwatch\_log\_group\_arn](#output\_lambda\_cloudwatch\_log\_group\_arn) | The ARN of the Cloudwatch Log Group | -| [lambda\_function\_arn](#output\_lambda\_function\_arn) | The ARN of the Lambda Function | -| [lambda\_function\_invoke\_arn](#output\_lambda\_function\_invoke\_arn) | The Invoke ARN of the Lambda Function | -| [lambda\_function\_kms\_key\_arn](#output\_lambda\_function\_kms\_key\_arn) | The ARN for the KMS encryption key of Lambda Function | -| [lambda\_function\_last\_modified](#output\_lambda\_function\_last\_modified) | The date Lambda Function resource was last modified | -| [lambda\_function\_name](#output\_lambda\_function\_name) | The name of the Lambda Function | -| [lambda\_function\_qualified\_arn](#output\_lambda\_function\_qualified\_arn) | The ARN identifying your Lambda Function Version | -| [lambda\_function\_source\_code\_hash](#output\_lambda\_function\_source\_code\_hash) | Base64-encoded representation of raw SHA-256 sum of the zip file | -| [lambda\_function\_source\_code\_size](#output\_lambda\_function\_source\_code\_size) | The size in bytes of the function .zip file | -| [lambda\_function\_version](#output\_lambda\_function\_version) | Latest published version of Lambda Function | -| [lambda\_layer\_arn](#output\_lambda\_layer\_arn) | The ARN of the Lambda Layer with version | -| [lambda\_layer\_created\_date](#output\_lambda\_layer\_created\_date) | The date Lambda Layer resource was created | -| [lambda\_layer\_layer\_arn](#output\_lambda\_layer\_layer\_arn) | The ARN of the Lambda Layer without version | -| [lambda\_layer\_source\_code\_size](#output\_lambda\_layer\_source\_code\_size) | The size in bytes of the Lambda Layer .zip file | -| [lambda\_layer\_version](#output\_lambda\_layer\_version) | The Lambda Layer version | -| [lambda\_role\_arn](#output\_lambda\_role\_arn) | The ARN of the IAM role created for the Lambda Function | -| [lambda\_role\_name](#output\_lambda\_role\_name) | The name of the IAM role created for the Lambda Function | -| [local\_filename](#output\_local\_filename) | The filename of zip archive deployed (if deployment was from local) | -| [s3\_object](#output\_s3\_object) | The map with S3 object data of zip archive deployed (if deployment was from S3) | - diff --git a/examples/ephemeral-stoage/main.tf b/examples/ephemeral-stoage/main.tf deleted file mode 100644 index 4fc7f795..00000000 --- a/examples/ephemeral-stoage/main.tf +++ /dev/null @@ -1,26 +0,0 @@ -provider "aws" { - region = "eu-west-1" - - # Make it faster by skipping something - skip_get_ec2_platforms = true - skip_metadata_api_check = true - skip_region_validation = true - skip_credentials_validation = true - skip_requesting_account_id = true -} - -resource "random_pet" "this" { - length = 2 -} - -module "lambda_function" { - source = "../../" - - publish = true - - function_name = "${random_pet.this.id}-lambda-ephemeral-stoage" - handler = "index.lambda_handler" - runtime = "python3.8" - ephemeral_storage_size = 10240 - -} diff --git a/examples/ephemeral-stoage/outputs.tf b/examples/ephemeral-stoage/outputs.tf deleted file mode 100644 index 83dbee63..00000000 --- a/examples/ephemeral-stoage/outputs.tf +++ /dev/null @@ -1,99 +0,0 @@ -# Lambda Function -output "lambda_function_arn" { - description = "The ARN of the Lambda Function" - value = module.lambda_function.lambda_function_arn -} - -output "lambda_function_invoke_arn" { - description = "The Invoke ARN of the Lambda Function" - value = module.lambda_function.lambda_function_invoke_arn -} - -output "lambda_function_name" { - description = "The name of the Lambda Function" - value = module.lambda_function.lambda_function_name -} - -output "lambda_function_qualified_arn" { - description = "The ARN identifying your Lambda Function Version" - value = module.lambda_function.lambda_function_qualified_arn -} - -output "lambda_function_version" { - description = "Latest published version of Lambda Function" - value = module.lambda_function.lambda_function_version -} - -output "lambda_function_last_modified" { - description = "The date Lambda Function resource was last modified" - value = module.lambda_function.lambda_function_last_modified -} - -output "lambda_function_kms_key_arn" { - description = "The ARN for the KMS encryption key of Lambda Function" - value = module.lambda_function.lambda_function_kms_key_arn -} - -output "lambda_function_source_code_hash" { - description = "Base64-encoded representation of raw SHA-256 sum of the zip file" - value = module.lambda_function.lambda_function_source_code_hash -} - -output "lambda_function_source_code_size" { - description = "The size in bytes of the function .zip file" - value = module.lambda_function.lambda_function_source_code_size -} - -# Lambda Layer -output "lambda_layer_arn" { - description = "The ARN of the Lambda Layer with version" - value = module.lambda_function.lambda_layer_arn -} - -output "lambda_layer_layer_arn" { - description = "The ARN of the Lambda Layer without version" - value = module.lambda_function.lambda_layer_layer_arn -} - -output "lambda_layer_created_date" { - description = "The date Lambda Layer resource was created" - value = module.lambda_function.lambda_layer_created_date -} - -output "lambda_layer_source_code_size" { - description = "The size in bytes of the Lambda Layer .zip file" - value = module.lambda_function.lambda_layer_source_code_size -} - -output "lambda_layer_version" { - description = "The Lambda Layer version" - value = module.lambda_function.lambda_layer_version -} - -# IAM Role -output "lambda_role_arn" { - description = "The ARN of the IAM role created for the Lambda Function" - value = module.lambda_function.lambda_role_arn -} - -output "lambda_role_name" { - description = "The name of the IAM role created for the Lambda Function" - value = module.lambda_function.lambda_role_name -} - -# CloudWatch Log Group -output "lambda_cloudwatch_log_group_arn" { - description = "The ARN of the Cloudwatch Log Group" - value = module.lambda_function.lambda_cloudwatch_log_group_arn -} - -# Deployment package -output "local_filename" { - description = "The filename of zip archive deployed (if deployment was from local)" - value = module.lambda_function.local_filename -} - -output "s3_object" { - description = "The map with S3 object data of zip archive deployed (if deployment was from S3)" - value = module.lambda_function.s3_object -} diff --git a/examples/ephemeral-stoage/variables.tf b/examples/ephemeral-stoage/variables.tf deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/ephemeral-stoage/versions.tf b/examples/ephemeral-stoage/versions.tf deleted file mode 100644 index 9e58d511..00000000 --- a/examples/ephemeral-stoage/versions.tf +++ /dev/null @@ -1,8 +0,0 @@ -terraform { - required_version = ">= 0.13.1" - - required_providers { - aws = ">= 4.8.0" - random = ">= 2" - } -} From eca1a2c0e69c6280118c88a4600054b5fde08f43 Mon Sep 17 00:00:00 2001 From: liortct Date: Sat, 26 Mar 2022 22:09:06 +0300 Subject: [PATCH 8/8] upgrade aws provider version --- examples/complete/versions.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf index a32909ec..9e58d511 100644 --- a/examples/complete/versions.tf +++ b/examples/complete/versions.tf @@ -2,7 +2,7 @@ terraform { required_version = ">= 0.13.1" required_providers { - aws = ">= 2.67" + aws = ">= 4.8.0" random = ">= 2" } }