Hi, is it possible to import randomPassword (with ...
# getting-started
t
Hi, is it possible to import randomPassword (with parameters) without replace in consecutive pulumi up? having this import file, i need to import password that is storead later in azure key vault into the state
Copy code
{
  "resources": [
    {
      "type": "random:index/randomPassword:RandomPassword",
      "id": "myV3ryGoodPassword",
      "name": "resource_pass"
    },
    {
      "type": "azure-native:keyvault:Secret",
      "id": "**redacted**",
      "name": "resource_pass_secret"
    }
  ]
}
this is the reource
Copy code
const password = new random.RandomPassword(
      `resource_pass`,
      {
        length: 20,
        minLower: 1,
        minUpper: 1,
        minNumeric: 1,
        minSpecial: 1,
        special: true,
      }
    );
the problem is, it appears you cannot specify the parameters for password during import, which leads to the password being replaced on next pulumi up the whole purpose of importing password is for it not to get replaced. Is there any way around this, am I missing something?
oh, now I noticed I can replace
minUpper: 1
for
upper: true
and its fixed. Thanks for your help 😄
😀 1
e
There's a bit of usability gap here indeed, feel free to add an issue to pulumi/pulumi-random but glad you found a workaround
a
I have similar issue where the code has special: false, but the import sets it to true so next update it make a new password. Been trying both import file and cli but do not know how to set that property with import. What cli or json block did you use