How do I tell Pulumi to not complete a deletion fr...
# general
f
How do I tell Pulumi to not complete a deletion from a previous state? Cloud is AWS and the resource is a awsacmCertificate. Deleting / recreating it has ramifications (can't be used until validations pass for example) - I'm not sure why it wanted to delete it in the first place. - I don't want the resource to be deleted (and recreated). It exists, leave it alone. - I've exported, edited and imported the stack to remove the
pendingOperations
section. -
pulumi refresh
states "No resources will be modified as part of this refresh" -
pulumi preview
wants to
delete
then
create
with a knock effect for other resources -
pulumi up
hangs trying to complete the delete operation so I have to do a
pulimi cancel
Really scratching my head with this one. Any ideas?
Version info: v0.17.28
Copy code
{
  "name": "aws-typescript",
  "devDependencies": {
    "@types/node": "12.7.1"
  },
  "dependencies": {
    "@pulumi/aws": "0.18.27",
    "@pulumi/awsx": "0.18.8",
    "@pulumi/pulumi": "0.17.28"
  }
}
b
pulumi preview --diff
should show why does it want to recreate cert
f
Ok, will give it a go...
Used that flag and all it says is "completing deletion from previous update"
b
subjectAlternativeNames has been changed
these require cert to be re-issued
f
No they haven't
The ordering is different though.
(I blanked bits out for privacy reasons)
b
order might be seen as a diff still
f
Actual values.
Copy code
subjectAlternativeNames: [
        [0]: "*.<http://eu-central-1.dev.aws.lykkeservices.net|eu-central-1.dev.aws.lykkeservices.net>"
        [1]: "*.<http://dev.aws.lykkeservices.net|dev.aws.lykkeservices.net>"
    ]
vs
Copy code
subjectAlternativeNames: [
            [0]: "*.<http://dev.aws.lykkeservices.net|dev.aws.lykkeservices.net>"
            [1]: "*.<http://eu-central-1.dev.aws.lykkeservices.net|eu-central-1.dev.aws.lykkeservices.net>"
        ]
b
luckily you have jsut 2, so you can sort or reverse sort to get desired order and see if diff is still there
f
The order didn't change in code though 🤕
b
bummer
f
Always been like this since initial deployment
b
what if you clear pending deletion in state manually ,then run preview --diff again? does it show anything meaningful?
f
How do I clear the pending deletion? (Thanks for your assistance btw)
Reordering it in code to match the pending deletion had no effect.
b
- I've exported, edited and imported the stack to remove the
pendingOperations
section.
f
There is no
pendingOperations
. But I see this property on the resource itself:
Removing that and importing the stack removed the "pending deletion from previous operation" 🙂
b
what does diff show now?
f
Code on left, diff on right. So something has changed, possibly on the pulumi side, that originally stored these in reverse order.
I think I can patch the stack to fix this.
b
looks annoying
Seattle is about to wake up, they might help
f
I patched the stack to re-order the
subjectAlternativeNames
and changed the code to align with it. Pulumi no longer wanted to re-create the cert. I still don't know why it suddenly thought that the resource had changed, my spidey sense is pointing at a pulumi behaviour update somewhere. Anyway, thanks for asking the right questions @best-xylophone-83824! 🙂