Skip to content

Commit 7985c9f

Browse files
committed
pr feedback
1 parent 09476a8 commit 7985c9f

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ No modules.
415415
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and Terraform will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration. | `string` | `""` | no |
416416
| <a name="input_lambda_at_edge"></a> [lambda\_at\_edge](#input\_lambda\_at\_edge) | Enable Lambda@Edge for your Node.js or Python functions. Required trust relationship and publishing of function versions will be configured. | `bool` | `false` | no |
417417
| <a name="input_layers"></a> [layers](#input\_layers) | List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. | `list(string)` | `[]` | no |
418-
| <a name="input_logging_config"></a> [logging\_config](#input\_logging\_config) | The function's Amazon CloudWatch Logs configuration settings. | <pre>object({<br/> log_format = string<br/> application_log_level = optional(string, null)<br/> log_group = optional(string, null)<br/> system_log_level = optional(string, null)<br/> })</pre> | `null` | no |
418+
| <a name="input_logging_config"></a> [logging\_config](#input\_logging\_config) | Configuration block for advanced logging settings. | <pre>object({<br/> log_format = string<br/> application_log_level = optional(string, null)<br/> log_group = optional(string, null)<br/> system_log_level = optional(string, null)<br/> })</pre> | `null` | no |
419419
| <a name="input_memory_size"></a> [memory\_size](#input\_memory\_size) | Amount of memory in MB your Lambda Function can use at runtime. | `number` | `128` | no |
420420
| <a name="input_package_type"></a> [package\_type](#input\_package\_type) | The Lambda deployment package type. Valid values are Zip and Image. | `string` | `"Zip"` | no |
421421
| <a name="input_publish"></a> [publish](#input\_publish) | Whether to publish creation/change as new Lambda Function Version. | `bool` | `false` | no |

examples/complete/main.tf

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,19 @@ module "lambda" {
3131
cloudwatch_lambda_insights_enabled = true
3232
layers = ["arn:aws:lambda:${local.region}:580247275435:layer:LambdaInsightsExtension-Arm64:23"]
3333

34-
environment = {
35-
variables = {
36-
key = "value"
37-
}
38-
}
39-
34+
// Advanced logging configuration
4035
logging_config = {
4136
log_format = "JSON"
4237
application_log_level = "INFO"
4338
system_log_level = "WARN"
4439
}
4540

41+
environment = {
42+
variables = {
43+
key = "value"
44+
}
45+
}
46+
4647
// AWS Systems Manager (SSM) Parameter Store
4748
ssm = {
4849
parameter_names = ["/internal/params", "/external/params"]

main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ resource "aws_lambda_function" "lambda" {
8787
}
8888
}
8989

90-
9190
// create the CloudWatch log group first so it's no create automatically
9291
// by AWS Lambda
9392
depends_on = [aws_cloudwatch_log_group.lambda]

variables.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,14 @@ variable "vpc_config" {
250250
}
251251

252252
variable "logging_config" {
253-
description = "The function's Amazon CloudWatch Logs configuration settings."
253+
description = "Configuration block for advanced logging settings."
254254
default = null
255255
type = object({
256256
log_format = string
257257
application_log_level = optional(string, null)
258258
log_group = optional(string, null)
259259
system_log_level = optional(string, null)
260260
})
261-
validation {
262-
condition = var.logging_config == null || (var.logging_config.log_format == "JSON" || var.logging_config.log_format == "Text")
263-
error_message = "log_format must be either 'JSON' or 'Text'"
264-
}
265261
}
266262

267263
variable "iam_role_name" {

0 commit comments

Comments
 (0)