terraform-aws-ecs-web-app icon indicating copy to clipboard operation
terraform-aws-ecs-web-app copied to clipboard

`aws_cloudwatch_log_group` not destroyed when enabled=false

Open bartelemi opened this issue 3 years ago • 0 comments
trafficstars

Describe the Bug

aws_cloudwatch_log_group resource should respect the context.enabled flag. Right now I have to set cloudwatch_log_group_enabled as well as enabled to false to destroy all the resources.

Expected Behavior

Setting up the enabled flag from the context should be enough to deprovision all the resources.

Steps to Reproduce

  1. Deploy this module to your AWS cloud.
  2. In next iteration, set the enabled flag to false
  3. Run the terraform apply command
  4. See error:
Error: "name" isn't a valid log group name (alphanumeric characters, underscores, hyphens, slashes, hash signs and dots are allowed): ""
  with aws_cloudwatch_log_group.app[0],
  on main.tf line 18, in resource "aws_cloudwatch_log_group" "app":
  18:   name              = module.this.id

bartelemi avatar Feb 03 '22 14:02 bartelemi