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

[Enhancement]: skip_existing support for aws_cloudwatch_log_group #29786

Open
G-Rath opened this issue Mar 3, 2023 · 2 comments · May be fixed by #29787
Open

[Enhancement]: skip_existing support for aws_cloudwatch_log_group #29786

G-Rath opened this issue Mar 3, 2023 · 2 comments · May be fixed by #29787
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/logs Issues and PRs that pertain to the logs service.

Comments

@G-Rath
Copy link
Contributor

G-Rath commented Mar 3, 2023

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 as skip_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)

  • aws_cloudwatch_log_group

Potential Terraform Configuration

resource "aws_cloudwatch_log_group" "yada" {
  name = "Yada"

  skip_destroy  = true
  skip_existing = true

  tags = {
    Environment = "production"
    Application = "serviceA"
  }
}

References

No response

Would you like to implement a fix?

Yes

@G-Rath G-Rath added enhancement Requests to existing resources that expand the functionality or scope. needs-triage Waiting for first response or review from a maintainer. labels Mar 3, 2023
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/logs Issues and PRs that pertain to the logs service. label Mar 3, 2023
@G-Rath
Copy link
Contributor Author

G-Rath commented Mar 3, 2023

I've got an implementation for this with acceptance tests - will open a PR shortly

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/logs Issues and PRs that pertain to the logs service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants