https://pulumi.com logo
#general
Title
# general
w

worried-engineer-33884

06/27/2019, 10:10 PM
Is there a way to assert that an output is a secret output? It seems that the property and helper function for this are both marked
@internal
. Is there another way?
w

white-balloon-205

06/27/2019, 10:17 PM
Wrapping any value in
pulumi.secret
should work here.
w

worried-engineer-33884

06/27/2019, 10:17 PM
thanks, i am using
pulumi.secret
, but I want to assert that in my test
e.g. i want to be able to:
Copy code
it("is a secret", function(done) {
    infra.someOutput.isSecretOutput().then(isSecret => {
        assert.ok(isSecret);
        done();
    });
});
or something like that
w

white-balloon-205

06/27/2019, 10:30 PM
Ahh - I see. Yes - it appears all the helpers that would answer this question are currently internal. It does look like
pulumi.isSecretOutput
is something that should be able to be exposed publicly. Note that you can still use this in the meantime - with something like:
Copy code
(pulumi as any).isSecretOutput(o)
Or for easier usage:
Copy code
const isSecretOutput: (o: Output<any>) => Promise<boolean> = (pulumi as any).isSecretOutput;
Opened https://github.com/pulumi/pulumi/issues/2886.
w

worried-engineer-33884

06/27/2019, 10:41 PM
awesome, that's working. thanks!
3 Views