[Enhancement]: skip_existing
support for aws_cloudwatch_log_group
#29786
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
service/logs
Issues and PRs that pertain to the logs service.
Description
This is something of a follow-on from #26752, making it a bit nicer to use by allowing
aws_cloudwatch_log_group
resources to skip creation if a matching group already exists, and do an update instead.There has been discussion about supporting this in Terraform core, with I think hashicorp/terraform#26364 being the latest iteration of this, but it's slow going and unlikely to be resolved soon; there has also been #20635 which was for general resources but mentioned
aws_cloudwatch_log_group
- that was closed in favor of #14394 though that issue is about better error messaging at plan-time.While this behaviour would mean the plan shown for resources with
skip_existing
enabled could arguably be slightly wrong because it would not reflect if the group existed and if so what changes would be made, I think that is acceptable given this is an opt-in flag, has similar value asskip_destroy
especially when paired with things like the CloudWatch Agent that can automatically create log groups if they don't exist, and from what I can tell it sounds like improving this case would require a change in Terraform core which will probably take a while.Affected Resource(s) and/or Data Source(s)
Potential Terraform Configuration
References
No response
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: