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

Tagging on default resources not supported aws_elasticache_subnet_group #19213

Closed
Luminoth opened this issue May 3, 2021 · 4 comments · Fixed by #19267
Closed

Tagging on default resources not supported aws_elasticache_subnet_group #19213

Luminoth opened this issue May 3, 2021 · 4 comments · Fixed by #19267
Assignees
Labels
bug Addresses a defect in current functionality. service/elasticache Issues and PRs that pertain to the elasticache service.
Milestone

Comments

@Luminoth
Copy link
Contributor

Luminoth commented May 3, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.14.8

  • provider registry.terraform.io/hashicorp/aws v3.38.0

Affected Resource(s)

  • aws_elasticache_subnet_group

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

provider "aws" {
  region  = var.region
  profile = var.profile

  default_tags {
    tags = {
      Name = "terraform-default"
    }
  }
}

resource "aws_elasticache_subnet_group" "default" {
  name        = "default"
  description = "Default CacheSubnetGroup"
  subnet_ids  = data.aws_subnet_ids.public.ids
}

Expected Behavior

I would expect Terraform to skip applying default tags to resources that can't have them.

Actual Behavior

Error: error updating tags: error tagging resource (arn:aws:elasticache:[snip]:subnetgroup:default): InvalidParameterValue: Tagging on default resources is not supported

in resource "aws_elasticache_subnet_group" "default":
resource "aws_elasticache_subnet_group" "default" {

Steps to Reproduce

  1. terraform apply

Related:

@ghost ghost added the service/elasticache Issues and PRs that pertain to the elasticache service. label May 3, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label May 3, 2021
@anGie44 anGie44 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels May 5, 2021
@anGie44 anGie44 self-assigned this May 6, 2021
@anGie44
Copy link
Contributor

anGie44 commented May 6, 2021

Hi @Luminoth, thank you for reporting this! In the meantime I believe adding a lifecycle config block to your existing config should prevent changes being detected; however, if you're creating the resource from scratch, the workaround is not applicable. In this case, the attribute to ignore is tags_all as it represents provider-level tags + resource-tags (if any) instead of tags which in this case is an empty map e.g.

resource "aws_elasticache_subnet_group" "default" {
  name        = "default"
  description = "Default CacheSubnetGroup"
  subnet_ids  = data.aws_subnet_ids.public.ids

  lifecycle {
    ignore_changes = [tags_all["Name"]] # or more generally just tags_all since this resource won't have resource-level tags
  }
}

@Luminoth
Copy link
Contributor Author

Luminoth commented May 7, 2021

That workaround worked perfectly. Thank you!

@anGie44 anGie44 added this to the v3.42.0 milestone May 19, 2021
@ghost
Copy link

ghost commented May 20, 2021

This has been released in version 3.42.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/elasticache Issues and PRs that pertain to the elasticache service.
Projects
None yet
2 participants