Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import with different parameters #480

Open
antdking opened this issue Nov 15, 2023 · 2 comments
Open

Import with different parameters #480

antdking opened this issue Nov 15, 2023 · 2 comments
Labels
area/import An issue related to `pulumi import` or the import resource option. kind/enhancement Improvements or new features

Comments

@antdking
Copy link

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

@antdking antdking added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Nov 15, 2023
@antdking
Copy link
Author

This is likely the same problem as #312, however I've opted to open a new issue as the OP was unresponsive.
This also makes it a feature request, as it's a limitation as opposed to a bug.

@mikhailshilkov mikhailshilkov added area/import An issue related to `pulumi import` or the import resource option. and removed needs-triage Needs attention from the triage team labels Nov 15, 2023
@rcalosso
Copy link

Posted same issue in slack before coming here: https://pulumi-community.slack.com/archives/C01PF3E1B8V/p1730332078767319

+1 to fix please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/import An issue related to `pulumi import` or the import resource option. kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

3 participants