https://pulumi.com logo
#general
Title
# general
f

fresh-summer-65887

08/13/2019, 12:33 PM
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

best-xylophone-83824

08/13/2019, 12:42 PM
pulumi preview --diff
should show why does it want to recreate cert
f

fresh-summer-65887

08/13/2019, 12:50 PM
Ok, will give it a go...
Used that flag and all it says is "completing deletion from previous update"
b

best-xylophone-83824

08/13/2019, 2:11 PM
subjectAlternativeNames has been changed
these require cert to be re-issued
f

fresh-summer-65887

08/13/2019, 2:13 PM
No they haven't
The ordering is different though.
(I blanked bits out for privacy reasons)
b

best-xylophone-83824

08/13/2019, 2:15 PM
order might be seen as a diff still
f

fresh-summer-65887

08/13/2019, 2:15 PM
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

best-xylophone-83824

08/13/2019, 2:16 PM
luckily you have jsut 2, so you can sort or reverse sort to get desired order and see if diff is still there
f

fresh-summer-65887

08/13/2019, 2:16 PM
The order didn't change in code though 🤕
b

best-xylophone-83824

08/13/2019, 2:17 PM
bummer
f

fresh-summer-65887

08/13/2019, 2:18 PM
Always been like this since initial deployment
b

best-xylophone-83824

08/13/2019, 2:18 PM
what if you clear pending deletion in state manually ,then run preview --diff again? does it show anything meaningful?
f

fresh-summer-65887

08/13/2019, 2:19 PM
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

best-xylophone-83824

08/13/2019, 2:23 PM
- I've exported, edited and imported the stack to remove the
pendingOperations
section.
f

fresh-summer-65887

08/13/2019, 2:26 PM
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

best-xylophone-83824

08/13/2019, 2:30 PM
what does diff show now?
f

fresh-summer-65887

08/13/2019, 2:35 PM
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

best-xylophone-83824

08/13/2019, 2:45 PM
looks annoying
Seattle is about to wake up, they might help
f

fresh-summer-65887

08/13/2019, 3:37 PM
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! 🙂
4 Views