I recently changed the binding of a parent/child r...
# general
t
I recently changed the binding of a parent/child relationship for an
aws.sqs.QueuePolicy
. When it was updated, it created a
replacement
and deleted the old one. Turns out that they’re not distinct entities, they’re just a property of the
aws.sqs.Queue
. That means creating a replacement then deleting the prior essential just deleted the property all together, thus breaking our workflow and losing a few hours of messages for the Queue. This seems to be a bug in the update strategy. Should I create an issue on
pulumi/pulumi-aws
or am I missing something?
b
@thousands-hairdresser-72380 when you say you changed the parent child relationship, you mean as a resource option? If so, this is expected behaviour and you can use an alias to prevent a replacement
t
@billowy-army-68599 Yes as a resource option. Replacing isn’t an issue in itself. The issue is it didn’t create two entities, it just modified the same property on the
Queue
entity. So the order of operations was 1. Create the replacement
QueuePolicy
a. This equates to updating the
policy
attribute for the
Queue
b. This is not a separate entity but a property of the
Queue
2. Delete the previous
QueuePolicy
a. Since the
policy
is not a separate entity but a property of the
Queue
, it just deleted the
policy
attribute altogether. The resolution ended up being running
pulumi refresh
so it detected that the policy had been deleted, then running
pulumi up
again.
b
Again, using an alias would have entirely prevented this
t
@billowy-army-68599 I’m not sure that an alias is the correct solution here. To provide more context and evidence of that claim, I’ve created an issue here Thank you for taking time to help out!