This message was deleted.
# golang
s
This message was deleted.
w
I think you want the TargetGroupAttachment resource https://www.pulumi.com/docs/reference/pkg/aws/alb/targetgroupattachment/ Specifically, https://www.pulumi.com/docs/reference/pkg/aws/alb/targetgroupattachment/#create And if you look at the TargetGroupAttachmentArgs you'll see a targetId property which is where you can specify IP addresses.
r
Thanks @witty-candle-66007! Is a way I can get my ECS task IP address via Pulumi to pass as the targetId? Not seeing it in https://www.pulumi.com/docs/reference/pkg/aws/ecs/gettaskdefinition/#taskdefinition_go.
w
If using ECS, you should be able to let AWS do the routing by referencing the load balancer in the ECS definition. This example may help: https://github.com/pulumi/examples/blob/master/aws-go-fargate/main.go In it, you see the various resources being defined and then in the ecs.NewService() call the LB is referenced. At this point AWS knows to route the traffic to the tasks appropriately. This page discusses this as well: https://docs.aws.amazon.com/AmazonECS/latest/userguide/create-application-load-balancer.html (See the Register targets and last sections specifically.)
r
Thanks Mitch, that was exactly what I needed!
👍 1