terraform-provider-aws
terraform-provider-aws copied to clipboard
It would be nice to have aws_globalaccelerator_listener data source
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
Hi @ewbankkit I want to work on issue .So can I pick up this issue?
https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/globalaccelerator#Client.ListAccelerators
@Nitin052 , any luck?
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:
This is very much required. Especially in terramate configurations where a reliance on data sources is far greater.
Any news? 👀
Please implement this. This is super required for any global infrastructure management using AWS GA.
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