https://pulumi.com logo
Title
d

damp-painting-47843

11/14/2022, 5:54 PM
Trying to replace an AWS TargetGroup. The problem is the TargetGroup is referenced by a ListenerAction. Shouldn’t Pulumi automatically update the ListenerAction’s action? Isn’t a new TargetGroup is created before the old TargetGroup is destroyed? If not, how do I force the update of the Listener Action to the new action when a TargetGroup is replaced?
b

billowy-army-68599

11/14/2022, 5:55 PM
what error are you getting?
d

damp-painting-47843

11/14/2022, 6:01 PM
deleting Target Group: ResourceInUse: Target group ‘arn:aws:elasticloadbalancing:us-east-1:UUID:targetgroup/RESOURCENAME/UUID’ is currently in use by a listener or a rule
b

billowy-army-68599

11/14/2022, 6:03 PM
do you have code to repro?
d

damp-painting-47843

11/14/2022, 6:06 PM
Sure. What’s the best way to share? Enormous copy/paste or a gist or something?
b

billowy-army-68599

11/14/2022, 6:07 PM
gist would be awesome
d

damp-painting-47843

11/14/2022, 6:09 PM
Let me get the relevant portion…
b

billowy-army-68599

11/14/2022, 6:26 PM
this is happening because you’re setting the name explicitly:
name: targetGroupName
I’d recommend removing the explicit name and using autonaming. If you don’t want to do that, set the resource property `DeleteBeforeReplace`: https://www.pulumi.com/docs/intro/concepts/resources/options/deletebeforereplace/
d

damp-painting-47843

11/14/2022, 8:14 PM
I do specifically want to change its name.
I’ll try deleteBeforeReplace although that seems counterintuitive to me.
Same error. Target group is currently in. use by a listener or rule.
Which it is, of course, but replacing it should remove it from the listener I would think.
Appears that this is an existing issue: https://github.com/pulumi/pulumi/issues/5900
Since 2020 😬