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

tall-terabyte-42834

11/01/2019, 11:04 PM
Hi pulumi, I'd like to know is it possible to
protect
a resource without having to run
pulumi up
? i.e. to add the
protect: true
to something directly. More context on why in the thread:
So I previously had a thread on a problem where
pulumi preview
is showing that changes will happen, without me having changed anything. https://pulumi-community.slack.com/archives/C84L4E3N1/p1570135724281600
This led to filing of an issue https://github.com/pulumi/pulumi/issues/3301
And there does seem to be a PR out that may address the issue, at https://github.com/pulumi/pulumi/pull/3327
Basically there's a stack that I can't
pulumi up
because of the risk that it'll destroy everything. But I want to add new resources to the stack. Maybe I can do this by manually adding
protect: true
to all the resources at risk of being recreated, before doing
pulumi up
. Would that work?
w

white-balloon-205

11/01/2019, 11:38 PM
You can
pulumi stack export
, then add the protect:true, then
pulumi stack import
. We don’t yet have a direct command to do this in one set, but we do have a command for the opposite -
pulumi state unprotected <urn>
, which we should probably expand to support this scenario as well.
t

tall-terabyte-42834

11/01/2019, 11:53 PM
Thanks, I'll try
export
and
import
!