sparse-intern-71089
10/12/2020, 1:26 AMlittle-cartoon-10569
10/12/2020, 1:27 AMup first, to apply the change, then remove it from your code to delete it.worried-queen-62794
10/12/2020, 1:29 AMup is what is failinglittle-cartoon-10569
10/12/2020, 1:29 AMworried-queen-62794
10/12/2020, 1:30 AMup failed when I first set protect=True and now if I run up again it tries to delete it and fails. If I set protect=False and run up it also fails.little-cartoon-10569
10/12/2020, 1:30 AMworried-queen-62794
10/12/2020, 1:31 AMpulumi-python:dynamic:Resource (WriteSSHAuthorizedKeys):
error: Preview failed: refusing to delete protected resource 'urn:pulumi:prod::tlayen-infrastructure::pulumi-python:dynamic:Resource::WriteSSHAuthorizedKeys'
pulumi:pulumi:Stack (tlayen-infrastructure-prod):
error: preview failed
perhaps that preview failed (whatever that means) is relevant.little-cartoon-10569
10/12/2020, 1:33 AMlittle-cartoon-10569
10/12/2020, 1:33 AMup. After that works, you can then delete the code and up again: this will destroy the resource.worried-queen-62794
10/12/2020, 1:37 AMlittle-cartoon-10569
10/12/2020, 1:39 AMworried-queen-62794
10/12/2020, 1:43 AMlittle-cartoon-10569
10/12/2020, 1:45 AMpulumi state unprotect and pulumi state delete to make Pulumi forget about the resource, and then you can delete it at your leisure. Then you can up again to create the new version.little-cartoon-10569
10/12/2020, 1:45 AMpulumi stack export --file state.json and pulumi stack import --file state.json to achieve the same thing, manually.little-cartoon-10569
10/12/2020, 1:45 AM