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

Add support for getting EndpointURL directly from ElasticBeanstalk Environment resource #10015

Conversation

xsalazar
Copy link
Contributor

@xsalazar xsalazar commented Sep 5, 2019

Original PR: #9873 (changed to make PR from remote branch)

Summary

This PR adds the ability to pull the endpoint_url directly from the aws_elastic_beanstalk_environment resource. Previously, (one way) to get this value was: register an aws_elb data source using the registered load_balancers from the aws_elastic_beanstalk_environment; with this data source, you can reference the dns_name that corresponds to the load balancer.

data "aws_elb" "elb" {
  name = aws_elastic_beanstalk_environment.environment.load_balancers[0]
}

// ...

resource "aws_route53_record" "dns" {
  name    = var.hostname
  type    = "CNAME"
  zone_id = var.dns_hosted_zone_id
  ttl     = 600
  records = [data.aws_elb.elb.dns_name]
}

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Release Notes

Release note for CHANGELOG:

Add support for retrieving endpoint_url from the ElasticBeanstalk Environment.

For example:

resource "aws_route53_record" "dns" {
  name    = var.hostname
  type    = "CNAME"
  zone_id = var.dns_hosted_zone_id
  ttl     = 600
  records = [aws_elastic_beanstalk_environment.environment.endpoint_url]
}

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSBeanstalkEnv_outputs' TEST=./aws
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -parallel 20 -run=TestAccAWSBeanstalkEnv_outputs -timeout 120m
=== RUN   TestAccAWSBeanstalkEnv_outputs
=== PAUSE TestAccAWSBeanstalkEnv_outputs
=== CONT  TestAccAWSBeanstalkEnv_outputs
--- PASS: TestAccAWSBeanstalkEnv_outputs (378.61s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	378.838s

@xsalazar xsalazar requested a review from a team September 5, 2019 20:19
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Sep 5, 2019
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Sep 24, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to get this in once the documentation is updated. 👍

@@ -88,6 +88,10 @@ func resourceAwsElasticBeanstalkEnvironment() *schema.Resource {
Optional: true,
ForceNew: true,
},
"endpoint_url": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also add documentation for this in the attributes reference for the resource? Thanks! website/docs/r/elastic_beanstalk_environment.html.markdown

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Sep 24, 2019
@bflad bflad self-assigned this Sep 24, 2019
@ghost ghost added the documentation Introduces or discusses updates to documentation. label Sep 24, 2019
@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 24, 2019
@bflad bflad added this to the v2.30.0 milestone Sep 24, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @xsalazar 🚀

@bflad bflad merged commit ddf4698 into hashicorp:master Sep 24, 2019
bflad added a commit that referenced this pull request Sep 24, 2019
@ghost
Copy link

ghost commented Sep 26, 2019

This has been released in version 2.30.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@xsalazar xsalazar deleted the resource_aws_elastic_beanstalk_environment/endpoint_url branch October 4, 2019 15:35
@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
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants