Skip to content

Commit

Permalink
v3.1.0; add log_retention_in_days variable
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-e-allen committed May 11, 2022
1 parent f137d40 commit da919b6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Terraform module to create Terraform drift, plan, and apply CodePipelines.

## Change Log

### 3.1.0
- added global tags to `build-drift` CloudWatch log group
- added `log_retention_in_days` variable to allow customization of how long logs are kept

### 3.0.1
- Added tags to `build-plan` CodeBuild project, which was missed in v3.0.0 release.

Expand Down
4 changes: 2 additions & 2 deletions apply-pipeline.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ resource "aws_codepipeline" "apply-pipeline" {

resource "aws_cloudwatch_log_group" "build-plan" {
name = local.build_project_name_plan
retention_in_days = 90
retention_in_days = var.log_retention_in_days
tags = var.global_tags
}

resource "aws_cloudwatch_log_group" "build-apply" {
name = local.build_project_name_apply
retention_in_days = 90
retention_in_days = var.log_retention_in_days
tags = var.global_tags
}

Expand Down
3 changes: 2 additions & 1 deletion drift-pipeline.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ resource "aws_codepipeline" "drift-pipeline" {

resource "aws_cloudwatch_log_group" "build-drift" {
name = local.build_project_name_drift
retention_in_days = 90
retention_in_days = log_retention_in_days
tags = var.global_tags
}

resource "aws_codebuild_project" "build-drift" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@ variable "tf_log" {
description = "value for the TF_LOG variable in Terraform plan/apply operations"
default = null
}

variable "log_retention_in_days" {
type = number
description = "number of days to retain CodePipeline and CodeBuild logs"
default = 90
}

0 comments on commit da919b6

Please sign in to comment.