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

provider/aws: aws_elasticache_cluster normalizes name to lowercase #3235

Merged
merged 1 commit into from
Oct 3, 2015

Conversation

thrashr888
Copy link
Member

This is a similar issue to #3120. That patch fixes the aws_elasticache_subnet_group while this patch fixes the aws_elasticache_cluster. It's nearly the same change.

AWS forces aws_elasticache_cluster.cluster_id to be lower case. Each time terraform apply is run it cannot find the matching case cluster_id in it's state and tries to create a new one. This patch forces the cluster_id in Terraform to be lower case so the state can keep track of the correct cluster_id.

The cluster_id string in my project is generated with a variable with mixed case values, so I couldn't just make it lower case as a work-around.

I've tweaked the TestAccAWSElasticacheCluster_vpc acceptance test to include a mixed case version of the cluster_id. The acceptance tests pass when running make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheCluster_vpc'. The regular tests pass as well.

@apparentlymart
Copy link
Contributor

👍 LGTM!

@apparentlymart
Copy link
Contributor

We had an apparent recurrence of this issue today:

-/+ aws_elasticache_cluster.web
    apply_immediately:      "" => "<computed>"
    cache_nodes.#:          "1" => "<computed>"
    cluster_id:             "omt-jsmith-dev" => "omt-jsmith-DEV" (forces new resource)
    configuration_endpoint: "omt-jsmith-dev.7dilrw.cfg.usw1.cache.amazonaws.com:11211" => "<computed>"
    engine:                 "memcached" => "memcached"
    engine_version:         "1.4.14" => "1.4.14"
    maintenance_window:     "tue:06:00-tue:07:00" => "<computed>"
    node_type:              "cache.m3.large" => "cache.m3.large"
    num_cache_nodes:        "1" => "1"
    parameter_group_name:   "default.memcached1.4" => "default.memcached1.4"
    port:                   "11211" => "11211"
    security_group_ids.#:   "0" => "<computed>"
    security_group_names.#: "0" => "<computed>"
    subnet_group_name:      "usw1-dev" => "usw1-dev"


Plan: 1 to add, 0 to change, 1 to destroy.

The config sets cluster_id to be omt-${var.env_name} where the environment name is set by an external system to jsmith-DEV. As we expect, the ElastiCache API normalized that to omt-jsmith-dev, but it looks like we didn't correctly apply the StateFunc to the config when making the diff, so Terraform wants to switch it back to uppercase again.

Just making a note of this for the moment so I don't lose this context. I'll try to circle back and look more closely at this in a little while.

bmcustodio pushed a commit to bmcustodio/terraform that referenced this pull request Sep 26, 2017
* oss/master:
  changelog++
  add support to use application default credentials to gcs storage backend (hashicorp#3257)
  Remove fake news about custom plugins
  Fix travis build on go 1.9
  changelog++
  stdout support for file backend via logger (hashicorp#3235)
  fix swallowed errors in pki package tests (hashicorp#3215)
  Fix API/AUTH/AppRole doc issue concerning bound_cidr_list (hashicorp#3205)
@ghost
Copy link

ghost commented Apr 30, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants