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

Cannot read new elasticsearch custom domain options #18583

Closed
fdw opened this issue Apr 6, 2021 · 3 comments
Closed

Cannot read new elasticsearch custom domain options #18583

fdw opened this issue Apr 6, 2021 · 3 comments
Labels
question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. service/elasticsearch Issues and PRs that pertain to the elasticsearch service.

Comments

@fdw
Copy link

fdw commented Apr 6, 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: 0.14.8
AWS Provider: 3.35.0

Affected Resource(s)

  • aws_elasticsearch_domain

Terraform Configuration Files

I cannot manage to read the value of the new custom domain options that were introduced with 3.35 (#16059).

resource "aws_elasticsearch_domain" "thingy" {
  [snip]
  domain_endpoint_options {
    custom_endpoint_enabled = true
    custom_endpoint = "something"
    custom_endpoint_certificate_arn = var.certificate
  }
}

resource "aws_route53_record" "thingy" {
  [snip]
  name    = aws_elasticsearch_domain.thingy.domain_endpoint_options.custom_endpoint
}

Expected Behavior

The custom domain name can be read and used by other resources.

Actual Behavior

Block type "domain_endpoint_options" is represented by a list of objects, so
it must be indexed using a numeric key, like .domain_endpoint_options[0].

Steps to Reproduce

Try the above config.

References

@ghost ghost added service/elasticsearch Issues and PRs that pertain to the elasticsearch service. service/route53 Issues and PRs that pertain to the route53 service. labels Apr 6, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 6, 2021
@bill-rich bill-rich added question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. and removed needs-triage Waiting for first response or review from a maintainer. service/route53 Issues and PRs that pertain to the route53 service. labels Apr 7, 2021
@bill-rich bill-rich self-assigned this Apr 7, 2021
@bill-rich
Copy link
Contributor

Hi @fdw! You should be able to access those values by using the numeric key.

resource "aws_route53_record" "thingy" {
  [snip]
  name    = aws_elasticsearch_domain.thingy.domain_endpoint_options[0].custom_endpoint
}

The reason for this is that the domain_endpoint_options attribute is stored as a list in the Terraform schema. Since there is only one, you can safely use the 0 identifier.

@fdw
Copy link
Author

fdw commented Apr 8, 2021

Thanks, then I misunderstood the error message. Maybe it makes sense to mention that in the documentation?

@ghost
Copy link

ghost commented May 8, 2021

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 as resolved and limited conversation to collaborators May 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. service/elasticsearch Issues and PRs that pertain to the elasticsearch service.
Projects
None yet
Development

No branches or pull requests

2 participants