terraform-provider-aws icon indicating copy to clipboard operation
terraform-provider-aws copied to clipboard

It would be nice to have aws_globalaccelerator_listener data source

Open dmnfortytwo opened this issue 3 years ago • 5 comments

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

Description

It would be nice to have aws_globalaccelerator_listener data source. It will allow to add LB's to Global Accelerator described in another module.

New or Affected Resource(s)

  • aws_globalaccelerator_listener

Potential Terraform Configuration

# Looks a bit weird :( No idea if there's better option to select listener
data "aws_globalaccelerator_listener" "reader" {
  globalaccelerator_accelerator_name = "reader"
  protocol = "TCP"
  port_range_from = "443"
  port_range_to = "443"
}

resource "aws_globalaccelerator_endpoint_group" "read" {
  listener_arn = data.aws_globalaccelerator_listener.reader.id

  endpoint_configuration {
    endpoint_id = aws_lb.read.arn
    weight      = 100
 }
}

References

dmnfortytwo avatar Feb 10 '22 20:02 dmnfortytwo

Hi @ewbankkit I want to work on issue .So can I pick up this issue?

Nitin052 avatar Mar 21 '22 05:03 Nitin052

https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/globalaccelerator#Client.ListAccelerators

danquack avatar Jul 23 '22 18:07 danquack

@Nitin052 , any luck?

vchepkov avatar Dec 07 '23 23:12 vchepkov

Hey, we need this as well! I'd like to work on it.

I'll assign this to myself since nobody else did so far, but if you're already working on this please let me know.

EDIT: huh, I can't assign this to myself. If someone with permissions comes across this... :pray:

LCaparelli avatar Jan 02 '24 16:01 LCaparelli

This is very much required. Especially in terramate configurations where a reliance on data sources is far greater.

asininemonkey avatar Feb 22 '24 12:02 asininemonkey

Any news? 👀

thiagolsfortunato avatar Jul 22 '24 20:07 thiagolsfortunato

Please implement this. This is super required for any global infrastructure management using AWS GA.

migueleliasweb avatar Aug 12 '24 23:08 migueleliasweb

A workaround for the missing data source is:

data "external" "aws-ga-listener-lookup" {

  program = [
    "aws",
    "--region us-west-2",
    "globalaccelerator list-listeners",
    "--accelerator-arn ${data.aws_globalaccelerator_accelerator.my-aws-ga.arn}",
  ]
}

With this, you can access the listener arn with data.external.aws-ga-listener-lookup.result

migueleliasweb avatar Aug 12 '24 23:08 migueleliasweb