-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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: Add Primary Endpoint Address attribute for aws_elasticache_replication_group
#8385
Conversation
`aws_elasticache_replication_group` Fixes #8377 Now we can output the endpoint of the primary ``` resource "aws_elasticache_replication_group" "bar" { replication_group_id = "tf-11111" replication_group_description = "test description" node_type = "cache.m1.small" number_cache_clusters = 2 port = 6379 parameter_group_name = "default.redis2.8" apply_immediately = true } output "primary_endpoint_address" { value = "${aws_elasticache_replication_group.bar.primary_endpoint_address}" } ``` This gives us: ``` % terraform apply ................... aws_elasticache_replication_group.bar: Creation complete Apply complete! Resources: 1 added, 0 changed, 0 destroyed. Outputs: primary_endpoint_address = tf-11111.d5jx4z.ng.0001.use1.cache.amazonaws.com ``` This was the addition of a computed field only so the basic test still works as expected: ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_basic' ✹ ==> Checking that code complies with gofmt requirements... /Users/stacko/Code/go/bin/stringer go generate $(go list ./... | grep -v /terraform/vendor/) 2016/08/22 17:11:13 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSElasticacheReplicationGroup_basic -timeout 120m === RUN TestAccAWSElasticacheReplicationGroup_basic --- PASS: TestAccAWSElasticacheReplicationGroup_basic (741.71s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 741.735s ```
aws_elasticache_replication_group
aws_elasticache_replication_group
@@ -215,6 +220,8 @@ func resourceAwsElasticacheReplicationGroupRead(d *schema.ResourceData, meta int | |||
d.Set("snapshot_window", c.SnapshotWindow) | |||
d.Set("snapshot_retention_limit", c.SnapshotRetentionLimit) | |||
|
|||
d.Set("primary_endpoint_address", rgp.NodeGroups[0].PrimaryEndpoint.Address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any possibility of this being empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as we have gotten into this block, we have passed a check to make sure that there is a NodeGroup available :) The first NodeGroup is the primary and we use that to populate all of the information above it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, otherwise LGTM |
* master: (100 commits) Update CHANGELOG.md providers/aws: Check error from resourceAwsRoute53RecordBuildSet and return err if set (hashicorp#8399) Update CHANGELOG.md provider/aws: Add support for ECS svc - LB target group (hashicorp#8190) Added example of how the Option settings works (hashicorp#8413) Update CHANGELOG.md Update CHANGELOG.md Update CHANGELOG.md provider/aws: Add support for `network_mode` to `aws_ecs_task_definition` (hashicorp#8391) Update CHANGELOG.md Update CHANGELOG.md provider/aws: Add Primary Endpoint Address output for (hashicorp#8385) Update CHANGELOG.md provider/aws: `aws_elasticache_replication_group_id` validation change (hashicorp#8381) provider/google: Remove redundant type declaration provider/google: Hook in state migration function provider/openstack: docs and tests for allowed_address_pairs Update CHANGELOG.md website: Docs for AWS API Gateway domain name and base path mapping provider/aws: aws_api_gateway_base_path_mapping resource implementation ...
Presumably there is a secondary endpoint on the structure which you could expose. Development now goes on in the AWS provider repo, which is the appropriate place to log an issue (after searching for an existing one) for this. |
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. |
Fixes #8377
Now we can output the endpoint of the primary
This gives us:
This was the addition of a computed field only so the basic test still works as expected: