Skip to content

Import with different parameters #480

@antdking

Description

@antdking

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Currently, it's possible to import a RandomPassword with the below command (as documented):

pulumi import random:index/randomPassword:RandomPassword newPassword supersecret

which will generate the below code:

new_password = random.RandomPassword("newPassword",
    length=11,
    lower=True,
    number=True,
    numeric=True,
    special=True,
    upper=True,
    opts=pulumi.ResourceOptions(protect=True))

It isn't possible, however, to import with different parameters, such as with special=False.

Terraform provides a work-around by use of ignore_changes, where you can temporarily mark a parameter as ignored while you change it, then remove the ignore afterwards.
This doesn't work in Pulumi, as the input remains unchanged in state when the parameter is ignored.

This means making the change isn't possible without either losing the value, or manually modifying the state:

    numeric=True,
-    special=True,
+    special=False,
    upper=True,

The example above uses RandomPassword, however it's assumed this also impacts RandomString as well.

Originally raised in Slack

Affected area/feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/importAn issue related to `pulumi import` or the import resource option.kind/enhancementImprovements or new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions