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

Tags cannot be updated on redis aws_elasticache_replication_group resources #5366

Closed
mikefodor opened this issue Jul 27, 2018 · 9 comments
Closed
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service.

Comments

@mikefodor
Copy link

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 "me too" comments, 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 Version

> ./terraform -v
Terraform v0.11.7
+ provider.aws v1.29.0

Affected Resource(s)

  • aws_elasticache_replication_group

Terraform Configuration Files

provider "aws" {
  shared_credentials_file = "CREDENTIAL_FILE"
  profile                 = "AWS_PROFILE"
  region                  = "us-east-1"
}

resource "aws_elasticache_replication_group" "test-redis" {
  replication_group_id          = "test-redis"
  replication_group_description = "test-redis"
  node_type                     = "cache.t2.medium"
  engine                        = "redis"
  engine_version                = "3.2.4"
  parameter_group_name          = "default.redis3.2"
  port                          = 6379
  number_cache_clusters         = 1 
  automatic_failover_enabled    = false

  security_group_ids = ["${var.redis-sg}"]
  subnet_group_name  = "${aws_elasticache_subnet_group.default.name}"

  tags {
    Name        = "TestRedis"
    Environment = "Dev"
    CostCenter  = "Cost"
    tagone      = "oldtag1"
    tagtwo      = "oldtag2"
    tagthree    = "oldtag3"
  }
}

resource "aws_elasticache_subnet_group" "default" {
  name       = "test-subnet"
  subnet_ids = ["SUBNET-ID1", "SUBNET-ID2"]
}

Debug Output

https://gist.github.com/mikefodor/b41dc4ad06897b66355366babd0e8e05

Panic Output

Expected Behavior

The Tags on existing cache clusters in the aws_elasticache_replication_group should be updated with the new values.

Actual Behavior

When applying changes to the tags on the aws_elasticache_replication_group the tags on the
Terraform behaves like it applied the change but no change was made in AWS

aws_elasticache_replication_group.test-redis: Modifying... (ID: test-redis)
  tags.tagone:   "oldtag1" => "newtag1"
  tags.tagthree: "oldtag3" => "newtag3"
  tags.tagtwo:   "oldtag2" => "newtag2"
aws_elasticache_replication_group.test-redis: Still modifying... (ID: test-redis, 10s elapsed)
aws_elasticache_replication_group.test-redis: Still modifying... (ID: test-redis, 20s elapsed)
aws_elasticache_replication_group.test-redis: Modifications complete after 20s (ID: test-redis)

If new cache clusters are created in this aws_elasticache_replication_group they have the old set of tags. The tags only get applied on the initial creation of the aws_elasticache_replication_group. To apply a new set of tags appears to require destroying and rebuilding the aws_elasticache_replication_group.

Steps to Reproduce

  1. terraform apply
  2. Modify tags in the redis-test.tf file
  3. terraform apply

Important Factoids

References

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service. labels Jul 27, 2018
@bflad
Copy link
Contributor

bflad commented Jul 27, 2018

This is semi-related to #1615 -- the Elasticache API and Terraform treat the underlying Elasticache clusters as separate resources compared to the top level replication group.

@mangobatao
Copy link

@bflad but the first time you create the replication group it will be populated to the underlying clusters, do you have any workaround for this?

@rneu31
Copy link

rneu31 commented Jun 17, 2019

Running into the same issue myself. @bflad @mangobatao have either of you found a workaround? Appreciate it.

@zhangxin511
Copy link

@bflad @mikefodor I am experiencing related problem: #5021

I tried to destroy and applied a new one, the problem is able to workaround. I am using an older version though:

λ terraform version
Terraform v0.11.14
+ provider.aws v2.24.0

Your version of Terraform is out of date! The latest version
is 0.12.6. You can update by downloading from www.terraform.io/downloads.html

@mangobatao
Copy link

@zhangxin511 what's your workaround? can you share the details?

@zhangxin511
Copy link

@mangobatao Sorry for confuse you, I mean by run terraform destroy and terraform apply, the tags will be "updated". The problem of this bug is tags can only by added first time the terraform applied.

@ryndaniels
Copy link
Contributor

Hi @mikefodor - as noted here, this functionality isn't supported by the AWS API right now, and since we as a general rule are only committing to providing the same functionality supported by the underlying APIs, this ability to modify tags isn't something that we're planning to add right now.

@BenMusch
Copy link

Does this same issue apply to aws_elasticache_cluster resources?

@ghost
Copy link

ghost commented Nov 1, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/elasticache Issues and PRs that pertain to the elasticache service.
Projects
None yet
Development

No branches or pull requests

7 participants