You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,16 +256,10 @@ module "lambda" {
256
256
// remove CloudWatch logs IAM permissions
257
257
// cloudwatch_logs_enabled = false
258
258
259
-
// configure retention time for the module managed log group
259
+
// configure module managed log group
260
+
cloudwatch_logs_log_group_class = "STANDARD"
260
261
cloudwatch_logs_retention_in_days = 7
261
-
262
-
cloudwatch_log_subscription_filters = {
263
-
sub_1 = {
264
-
// see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_subscription_filter for available arguments
265
-
destination_arn = module.sub_1.arn
266
-
filter_pattern = "%Lambda%"
267
-
}
268
-
}
262
+
cloudwatch_logs_skip_destroy = false
269
263
270
264
// advanced logging config including a custom CloudWatch log group managed by the module
271
265
logging_config = {
@@ -274,6 +268,15 @@ module "lambda" {
274
268
log_group = "/custom/my_function_name"
275
269
system_log_level = "WARN"
276
270
}
271
+
272
+
// register log subscription filters for the functions log group
273
+
cloudwatch_log_subscription_filters = {
274
+
sub_1 = {
275
+
// see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_subscription_filter for available arguments
276
+
destination_arn = module.sub_1.arn
277
+
filter_pattern = "%Lambda%"
278
+
}
279
+
}
277
280
}
278
281
279
282
resource "aws_cloudwatch_log_group" "existing" {
@@ -433,7 +436,9 @@ No modules.
433
436
| <aname="input_cloudwatch_log_subscription_filters"></a> [cloudwatch\_log\_subscription\_filters](#input\_cloudwatch\_log\_subscription\_filters)| CloudWatch Logs subscription filter resources. Currently supports only Lambda functions as destinations. |`map(any)`|`{}`| no |
434
437
| <aname="input_cloudwatch_logs_enabled"></a> [cloudwatch\_logs\_enabled](#input\_cloudwatch\_logs\_enabled)| Enables your Lambda function to send logs to CloudWatch. The IAM role of this Lambda function will be enhanced with required permissions. |`bool`|`true`| no |
435
438
| <aname="input_cloudwatch_logs_kms_key_id"></a> [cloudwatch\_logs\_kms\_key\_id](#input\_cloudwatch\_logs\_kms\_key\_id)| The ARN of the KMS Key to use when encrypting log data. |`string`|`null`| no |
439
+
| <aname="input_cloudwatch_logs_log_group_class"></a> [cloudwatch\_logs\_log\_group\_class](#input\_cloudwatch\_logs\_log\_group\_class)| Specified the log class of the log group. Possible values are: `STANDARD`, `INFREQUENT_ACCESS`, or `DELIVERY`. |`string`|`null`| no |
436
440
| <aname="input_cloudwatch_logs_retention_in_days"></a> [cloudwatch\_logs\_retention\_in\_days](#input\_cloudwatch\_logs\_retention\_in\_days)| Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653, and 0. If you select 0, the events in the log group are always retained and never expire. |`number`|`null`| no |
441
+
| <aname="input_cloudwatch_logs_skip_destroy"></a> [cloudwatch\_logs\_skip\_destroy](#input\_cloudwatch\_logs\_skip\_destroy)| Set to true if you do not wish the log group (and any logs it may contain) to be deleted at destroy time, and instead just remove the log group from the Terraform state. |`bool`|`false`| no |
437
442
| <aname="input_create_cloudwatch_log_group"></a> [create\_cloudwatch\_log\_group](#input\_create\_cloudwatch\_log\_group)| Create and manage the CloudWatch Log Group for the Lambda function. Set to `false` to reuse an existing log group. |`bool`|`true`| no |
438
443
| <aname="input_description"></a> [description](#input\_description)| Description of what your Lambda Function does. |`string`|`""`| no |
439
444
| <aname="input_environment"></a> [environment](#input\_environment)| Environment (e.g. env variables) configuration for the Lambda function enable you to dynamically pass settings to your function code and libraries | <pre>object({<br/> variables = map(string)<br/> })</pre> |`null`| no |
description="Specified the log class of the log group. Possible values are: `STANDARD`, `INFREQUENT_ACCESS`, or `DELIVERY`."
50
+
default=null
51
+
type=string
52
+
}
53
+
47
54
variable"cloudwatch_logs_retention_in_days" {
48
55
description="Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653, and 0. If you select 0, the events in the log group are always retained and never expire."
49
56
default=null
50
57
type=number
51
58
}
52
59
60
+
variable"cloudwatch_logs_skip_destroy" {
61
+
description="Set to true if you do not wish the log group (and any logs it may contain) to be deleted at destroy time, and instead just remove the log group from the Terraform state."
62
+
type=bool
63
+
default=false
64
+
}
65
+
53
66
variable"cloudwatch_log_subscription_filters" {
54
67
description="CloudWatch Logs subscription filter resources. Currently supports only Lambda functions as destinations."
0 commit comments