Skip to content

Commit 6e84469

Browse files
authored
fix/SA-251 - trivy errors and cloudwatch retention default (#39)
* fix: resetting default cloudwatch retention to infinite and trivy ignores on module
1 parent 7decd91 commit 6e84469

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ The purpose of this module is to provide a building block for processing and del
99
## Usage
1010

1111
```hcl
12-
module "notifications" {
1312
module "notifications" {
1413
source = "github.com/appvia/terraform-aws-notifications?ref=main"
1514
@@ -124,7 +123,7 @@ Frequently (quartley at least) check and upgrade:
124123
| <a name="input_allowed_aws_principals"></a> [allowed\_aws\_principals](#input\_allowed\_aws\_principals) | Optional, list of AWS accounts able to publish via the SNS topic (when creating topic) e.g 123456789012 | `list(string)` | `[]` | no |
125124
| <a name="input_allowed_aws_services"></a> [allowed\_aws\_services](#input\_allowed\_aws\_services) | Optional, list of AWS services able to publish via the SNS topic (when creating topic) e.g cloudwatch.amazonaws.com | `list(string)` | `[]` | no |
126125
| <a name="input_cloudwatch_log_group_kms_key_id"></a> [cloudwatch\_log\_group\_kms\_key\_id](#input\_cloudwatch\_log\_group\_kms\_key\_id) | The KMS key id to use for encrypting the cloudwatch log group (default is none) | `string` | `null` | no |
127-
| <a name="input_cloudwatch_log_group_retention"></a> [cloudwatch\_log\_group\_retention](#input\_cloudwatch\_log\_group\_retention) | The retention period for the cloudwatch log group (for lambda function logs) in days | `string` | `"3"` | no |
126+
| <a name="input_cloudwatch_log_group_retention"></a> [cloudwatch\_log\_group\_retention](#input\_cloudwatch\_log\_group\_retention) | The retention period for the cloudwatch log group (for lambda function logs) in days | `string` | `"0"` | no |
128127
| <a name="input_create_sns_topic"></a> [create\_sns\_topic](#input\_create\_sns\_topic) | Whether to create an SNS topic for notifications | `bool` | `false` | no |
129128
| <a name="input_email"></a> [email](#input\_email) | The configuration for Email notifications | <pre>object({<br> addresses = optional(list(string))<br> # The email addresses to send notifications to<br> })</pre> | `null` | no |
130129
| <a name="input_enable_slack"></a> [enable\_slack](#input\_enable\_slack) | To send to slack, set to true | `bool` | `false` | no |

modules/notify/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ locals {
7878
)
7979
}
8080

81+
#trivy:ignore:avd-aws-0059
82+
#trivy:ignore:avd-aws-0057
8183
data "aws_iam_policy_document" "lambda" {
8284
for_each = toset(["slack", "teams"])
8385

@@ -102,6 +104,7 @@ resource "aws_cloudwatch_log_group" "lambda" {
102104
tags = merge(var.tags, var.cloudwatch_log_group_tags)
103105
}
104106

107+
#trivy:ignore:avd-aws-0095
105108
resource "aws_sns_topic" "this" {
106109
count = var.create_sns_topic && var.create ? 1 : 0
107110

@@ -182,6 +185,7 @@ resource "local_file" "notification_emblems_python" {
182185
# ]
183186
# }
184187

188+
#trivy:ignore:avd-aws-0067
185189
module "lambda" {
186190
for_each = toset(["slack", "teams"])
187191

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ variable "sns_topic_policy" {
6666
variable "cloudwatch_log_group_retention" {
6767
description = "The retention period for the cloudwatch log group (for lambda function logs) in days"
6868
type = string
69-
default = "3"
69+
default = "0"
7070
}
7171

7272
variable "cloudwatch_log_group_kms_key_id" {

0 commit comments

Comments
 (0)