I am trying to pull some outputs out of Terraform ...
# typescript
e
I am trying to pull some outputs out of Terraform and into Pulumi using @pulumi/terraform following this article. It is working as described. My issue is they are not getting recognized as secrets and I am struggling to describe to Pulumi that they should be treated as secrets using common methods. They are marked as sensitive in the Terraform output. Here is a sanitized snippet of my code. Does anyone have any thoughts around this? Thanks!
Copy code
const certState = new terraform.state.RemoteStateReference("certs", {
    backendType: "remote",
    token: tfeToken,
    organization: org,
    workspaces: {
        name: "acme-tf"
    },
});

const certificate = new azure.keyvault.Certificate("cert-name", {
    keyVaultId: vaultId,
    certificate: {
        contents: certState.getOutput("certificate_p12"),
        password: certState.getOutput("certificate_p12_password"),
    },
    name: "cert-name"
});
e
e
For example:
Copy code
certState.getOutput("certificate_p12") as pulumi.Output<Secret>
That does not work... Type 'Output<Secret>' is not assignable to type 'Input<string>'.
e
pulumi.secret(certState.getOutput("certificate_p12"))
e
Wow... I feel like a noob! Thank you so much!!
e
n/p 🙂
e
@echoing-dinner-19531 The first block of code for terraform.state.RemoteStateReference was still producing plaintext output, even after we resolved it for the second block with your recommendation. I found that adding
Copy code
additionalSecretOutputs: ["outputs"]
to the first block resolved it there too.