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
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,26 +190,30 @@ module "lambda" {
190
190
191
191
The module will create a [CloudWatch Log Group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group)
192
192
for your Lambda function. It's retention period and [CloudWatch Logs subscription filters](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_subscription_filter)
193
-
to stream logs to other Lambda functions (e.g. to forward logs to Amazon Elasticsearch Service) can be declared inline.
193
+
to stream logs to other Lambda functions (e.g. to forward logs to Amazon OpenSearch Service) can be declared inline.
194
194
195
195
The module will create the required [Lambda permissions](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) automatically.
196
+
Sending logs to CloudWatch can be disabled with `cloudwatch_logs_enabled = false`
196
197
197
198
see [example](examples/with-cloudwatch-logs-subscription) for details
198
199
199
200
```hcl
200
201
module "lambda" {
201
202
// see above
202
203
204
+
// disable CloudWatch logs
205
+
// cloudwatch_logs_enabled = false
206
+
203
207
cloudwatch_logs_retention_in_days = 14
204
208
205
209
cloudwatch_log_subscription_filters = {
206
210
lambda_1 = {
207
211
//see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_subscription_filter for available arguments
| <aname="input_cloudwatch_event_rules"></a> [cloudwatch\_event\_rules](#input\_cloudwatch\_event\_rules)| Creates EventBridge (CloudWatch Events) rules invoking your Lambda function. Required Lambda invocation permissions will be generated. |`map(any)`|`{}`| no |
345
349
| <aname="input_cloudwatch_lambda_insights_enabled"></a> [cloudwatch\_lambda\_insights\_enabled](#input\_cloudwatch\_lambda\_insights\_enabled)| Enable CloudWatch Lambda Insights for your Lambda function. |`bool`|`false`| no |
346
350
| <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 |
351
+
| <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 |
347
352
| <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 |
348
353
| <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 |
349
354
| <aname="input_description"></a> [description](#input\_description)| Description of what your Lambda Function does. |`string`|`"Instruction set architecture for your Lambda function. Valid values are [\"x86_64\"] and [\"arm64\"]."`| no |
Copy file name to clipboardExpand all lines: docs/part1.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,26 +190,30 @@ module "lambda" {
190
190
191
191
The module will create a [CloudWatch Log Group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group)
192
192
for your Lambda function. It's retention period and [CloudWatch Logs subscription filters](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_subscription_filter)
193
-
to stream logs to other Lambda functions (e.g. to forward logs to Amazon Elasticsearch Service) can be declared inline.
193
+
to stream logs to other Lambda functions (e.g. to forward logs to Amazon OpenSearch Service) can be declared inline.
194
194
195
195
The module will create the required [Lambda permissions](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) automatically.
196
+
Sending logs to CloudWatch can be disabled with `cloudwatch_logs_enabled = false`
196
197
197
198
see [example](examples/with-cloudwatch-logs-subscription) for details
198
199
199
200
```hcl
200
201
module "lambda" {
201
202
// see above
202
203
204
+
// disable CloudWatch logs
205
+
// cloudwatch_logs_enabled = false
206
+
203
207
cloudwatch_logs_retention_in_days = 14
204
208
205
209
cloudwatch_log_subscription_filters = {
206
210
lambda_1 = {
207
211
//see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_subscription_filter for available arguments
Copy file name to clipboardExpand all lines: docs/part2.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,7 @@ No modules.
54
54
| <aname="input_cloudwatch_event_rules"></a> [cloudwatch\_event\_rules](#input\_cloudwatch\_event\_rules)| Creates EventBridge (CloudWatch Events) rules invoking your Lambda function. Required Lambda invocation permissions will be generated. |`map(any)`|`{}`| no |
55
55
| <aname="input_cloudwatch_lambda_insights_enabled"></a> [cloudwatch\_lambda\_insights\_enabled](#input\_cloudwatch\_lambda\_insights\_enabled)| Enable CloudWatch Lambda Insights for your Lambda function. |`bool`|`false`| no |
56
56
| <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 |
57
+
| <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 |
57
58
| <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 |
58
59
| <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 |
59
60
| <aname="input_description"></a> [description](#input\_description)| Description of what your Lambda Function does. |`string`|`"Instruction set architecture for your Lambda function. Valid values are [\"x86_64\"] and [\"arm64\"]."`| no |
description="Enables your Lambda function to send logs to CloudWatch. The IAM role of this Lambda function will be enhanced with required permissions."
36
+
type=bool
37
+
default=true
38
+
}
39
+
34
40
variable"cloudwatch_logs_kms_key_id" {
35
41
description="The ARN of the KMS Key to use when encrypting log data."
0 commit comments