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

Fixed the documentation for ElastiCache Replication Group address #1542

Merged

Conversation

Projects
None yet
3 participants
@Ninir
Copy link
Collaborator

commented Aug 30, 2017

Fixes #375

As exposed in the code, primary_endpoint_address is set when there are node groups, so when in a cluster mode.
configuration_endpoint_address is the exact opposite.

@Ninir Ninir added the documentation label Aug 30, 2017

@radeksimko
Copy link
Contributor

left a comment

👍 Thanks.

@Ninir Ninir merged commit 7f90d33 into terraform-providers:master Aug 31, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Ninir Ninir deleted the Ninir:d-elasticache-replication-group branch Aug 31, 2017

nbaztec pushed a commit to nbaztec/terraform-provider-aws that referenced this pull request Sep 26, 2017

Merge pull request terraform-providers#1542 from Ninir/d-elasticache-…
…replication-group

Fixed the documentation for ElastiCache Replication Group address
@phunehehe

This comment has been minimized.

Copy link

commented Dec 6, 2017

I'm not sure what I'm missing but I'm seeing the opposite: configuration endpoint only exists if cluster mode is enabled, and primary endpoint only exists if cluster mode is disabled...

@radeksimko

This comment has been minimized.

Copy link
Contributor

commented Dec 10, 2017

@phunehehe Do you mind sharing a config which leads you to that conclusion?

I used the following (practically clustered Redis with 2 nodes):

resource "aws_vpc" "network" {
  cidr_block = "10.10.0.0/16"
}

resource "aws_subnet" "main" {
  cidr_block = "10.10.0.0/24"
  availability_zone = "eu-west-2a"
  vpc_id = "${aws_vpc.network.id}"
}

resource "aws_subnet" "secondary" {
  cidr_block = "10.10.5.0/24"
  availability_zone = "eu-west-2b"
  vpc_id = "${aws_vpc.network.id}"
}

resource "aws_elasticache_subnet_group" "main" {
  name = "radek-test"
  subnet_ids = ["${aws_subnet.main.id}", "${aws_subnet.secondary.id}"]
}

resource "aws_elasticache_replication_group" "autoscaling_event_update_route53" {
  replication_group_id          = "asgevnt-route53"
  replication_group_description = "Autoscaling events updating Route53"

  engine_version                = "3.2.4"
  node_type                     = "cache.m4.large"
  number_cache_clusters         = "2"
  port                          = 6379

  subnet_group_name             = "${aws_elasticache_subnet_group.main.name}"
  parameter_group_name          = "default.redis3.2"

  automatic_failover_enabled    = "true"
  availability_zones            = ["eu-west-2a", "eu-west-2b"]
  apply_immediately             = "true"
  maintenance_window            = "sun:01:00-sun:02:00"

  tags {
    Name                        = "autoscaling_event_update_route53"
    environment                 = "core"
    service                     = "main"
  }
}

and it does expose the primary_endpoint_address:

$ echo 'aws_elasticache_replication_group.autoscaling_event_update_route53.primary_endpoint_address' | terraform console
asgevnt-route53.g4wffw.ng.0001.euw2.cache.amazonaws.com

so I believe @Ninir is right.

@phunehehe

This comment has been minimized.

Copy link

commented Dec 11, 2017

So I created a setup with various configurations https://gist.github.com/phunehehe/9657cb33d7ba0ab48a113e9c3bc54475 and here's the output:

single	primary_endpoint_address	yes
single	configuration_endpoint_address	no
cluster	primary_endpoint_address	yes
cluster	configuration_endpoint_address	no
native_cluster	primary_endpoint_address	yes
native_cluster	configuration_endpoint_address	no
native_single	primary_endpoint_address	yes
native_single	configuration_endpoint_address	no
sharding	primary_endpoint_address	no
sharding	configuration_endpoint_address	yes

It would seem like configuration_endpoint_address exists when sharding is enabled, and primary_endpoint_address exists otherwise. When sharding is enabled, AWS console displays "Clustered Redis" in the "Mode" column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.