sparse-library-18327
10/09/2025, 8:06 PMpulumi preview  --show-sames=false --show-secrets=true --diff
But the output always indicates it's replacing because of the password.
Type                               Name                  Plan        Info
 +   pulumi:pulumi:Stack                directory_import-dev  create
 +   ├─ pulumi:providers:aws            provider              create
 +-  └─ aws:directoryservice:Directory  directory             replace     [diff: +password]; 1 warningmodern-zebra-45309
10/09/2025, 8:51 PMpulumi import? And how are you specifying your password?sparse-library-18327
10/09/2025, 8:54 PM"""An AWS Python Pulumi program"""
import pulumi
import pulumi_aws as aws
provider =  aws.Provider(
    "provider",
    profile="ocor-services-cloudplay",
    region="us-east-2"
)
directory = aws.directoryservice.Directory(
    f"directory",
    name="d1.local",
    short_name="d1",
    password="77xasdfsf!sdfdD5",
    edition="Enterprise",
    type="MicrosoftAD",
    desired_number_of_domain_controllers=2,
    vpc_settings={
        "vpc_id": "vpc-0e432c6301bfb44d4",
        "subnet_ids": ["subnet-0d188846ea46a1bc5","subnet-0a6592cf9f2f75ce1"], 
    },
    tags={
        "Project": "foo",
    },
    opts=pulumi.ResourceOptions(
        provider=provider,
        import_ = "d-9a6767287b",
        ignore_changes=["tags"]
    )
)
I'm doing a ResourceOptions importmodern-zebra-45309
10/09/2025, 8:56 PMmodern-zebra-45309
10/09/2025, 8:57 PMsparse-library-18327
10/09/2025, 8:57 PMmodern-zebra-45309
10/09/2025, 8:58 PMDirectory.get(...).password.apply( ... == "77x...")sparse-library-18327
10/09/2025, 9:00 PMmodern-zebra-45309
10/09/2025, 9:01 PMmodern-zebra-45309
10/09/2025, 9:02 PMsparse-library-18327
10/09/2025, 9:02 PMmodern-zebra-45309
10/09/2025, 9:03 PMsparse-library-18327
10/09/2025, 9:03 PMsparse-library-18327
10/09/2025, 9:03 PMsparse-library-18327
10/09/2025, 9:04 PMsparse-library-18327
10/09/2025, 9:04 PMmodern-zebra-45309
10/09/2025, 9:04 PMsparse-library-18327
10/09/2025, 9:05 PMmodern-zebra-45309
10/09/2025, 9:05 PMsparse-library-18327
10/09/2025, 9:06 PMmodern-zebra-45309
10/09/2025, 9:06 PMif I use the get function, I can't use .apply to get the output properties throughout the rest of the code. thus I'd need to add lots of conditions in other locations.I'm not suggesting you use this as the permanent solution 🙂 Just as an experiment
sparse-library-18327
10/09/2025, 9:07 PMsparse-library-18327
10/09/2025, 9:07 PMsparse-library-18327
10/09/2025, 9:07 PMmodern-zebra-45309
10/09/2025, 9:10 PMIs there any clean way to get outputs from either the actual deployment of the resource or the get method output without lots of conditions?You want everything as Pulumi Outputs, right? In that case, have a look at
get_directory_output at https://github.com/pulumi/pulumi-aws/blob/6800a7473ac4c2c2803787b7f414821db921c924/sdk/python/pulumi_aws/directoryservice/get_directory.py#L289modern-zebra-45309
10/09/2025, 9:11 PMsparse-library-18327
10/09/2025, 9:12 PMsparse-library-18327
10/09/2025, 9:16 PMmodern-zebra-45309
10/09/2025, 9:23 PMpulumi state edit) and add the password to the resource's outputs. You'll have to place the encrypted ciphertext there, but I believe you can come up with a way to obtain this, e.g., store it as a secret value in your config and copy the encrypted value. (The entire operation is probably easiest to pull off if you have another Directory to compare to, and you definitely want to have a backup or first try this in a stack that contains nothing but your Directory.)
Then Pulumi has something to compare your new input to, and will be able to determine that the password has not changed.sparse-library-18327
10/09/2025, 9:31 PM