Join Slack
Powered by
This message was deleted.
# golang
s
sparse-intern-71089
10/02/2020, 5:55 PM
This message was deleted.
w
witty-candle-66007
10/02/2020, 6:06 PM
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
rich-exabyte-94739
10/05/2020, 2:42 PM
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
witty-candle-66007
10/05/2020, 3:20 PM
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
rich-exabyte-94739
10/05/2020, 5:43 PM
Thanks Mitch, that was exactly what I needed!
👍 1
3
Views
Open in Slack
Previous
Next