Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add log group #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# c7n-left-demo

demo of custodian shift left capabilities
17 changes: 17 additions & 0 deletions policies/cost-log-retain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
policies:
- name: cost-log-group-retain-qa
description: "qa environments should retain cloud watch logs group for a max of 30 days"
resource: terraform.aws_cloudwatch_log_group
metadata:
severity: medium
categories: [cost]
filters:
- or:
- type: value
key: retention_in_days
value: absent

- type: value
key: retention_in_days
value: 30
op: lte
8 changes: 8 additions & 0 deletions root-module/log.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "aws_cloudwatch_log_group" "yada" {

Check failure on line 1 in root-module/log.tf

View workflow job for this annotation

GitHub Actions / Policies

terraform.aws_cloudwatch_log_group - policy:cost-log-group-retain-qa severity:medium

qa environments should retain cloud watch logs group for a max of 30 days
name = "Yada"

tags = {
Env = "Dev"
Application = "serviceA"
}
}
Loading