diff --git a/README.md b/README.md index 6924d53..47f7150 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/apply-pipeline.tf b/apply-pipeline.tf index 3e76bb7..61267e6 100644 --- a/apply-pipeline.tf +++ b/apply-pipeline.tf @@ -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 } diff --git a/drift-pipeline.tf b/drift-pipeline.tf index 20efb6a..e9d08b8 100644 --- a/drift-pipeline.tf +++ b/drift-pipeline.tf @@ -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" { diff --git a/variables.tf b/variables.tf index 36dcf1b..3288dd5 100644 --- a/variables.tf +++ b/variables.tf @@ -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 +}