sparse-intern-71089
05/26/2020, 6:25 PMrhythmic-finland-36256
05/26/2020, 6:28 PMACR (container registry) I also want to export the push credential of that component so that I can use it from the CI system.rhythmic-finland-36256
05/26/2020, 6:28 PMrhythmic-finland-36256
05/26/2020, 6:30 PMadditionalResourceOutputs but this only works with `CustomResource`s and not with `ComponentResource`s and I would like to handle that inside my component and don’t want to make the consumer of the component responsible to do so… https://www.pulumi.com/docs/intro/concepts/programming-model/#additionalsecretoutputsrhythmic-finland-36256
05/26/2020, 6:32 PMCustomResourceOptions but not for ComponentResourceOptions class…rhythmic-finland-36256
05/26/2020, 6:32 PMrhythmic-finland-36256
05/26/2020, 6:34 PMregisterOutputs but just assigned the fields…rhythmic-finland-36256
05/26/2020, 6:37 PMreadonly property that must be initialized undefined to later set the value. I remember having some issues with not populated fields when I used constructor-local variables and called registerOutputs on those fields https://github.com/pulumi/pulumi/issues/2653rhythmic-finland-36256
05/26/2020, 6:38 PMregisterOutputs to conform to the desired behaviour of telling pulumi that I’m done setting the fields…rhythmic-finland-36256
05/26/2020, 6:43 PMregisterOutputs part. I just wanted to make sure that I might be using it wrong because I don’t pass the values there. But it seems that calling this method differently would not help either.rhythmic-finland-36256
05/26/2020, 6:47 PMComponentResource and inside create a RandomPassword and want to expose that as an output (aka readonly property of my ComponentResource) how can I mark this property to be treated as a secret value so that if someone does a top-level export const pass = myComponentResource.password; won’t print in clear text? It would also be fine to pass in something when creating the resource. But as said, additionalSecretOutputs is not there for ComponentResourceOptions.white-balloon-205
If I build aIn this case, the key thing to do is to make sure the output of theand inside create aComponentResourceand want to expose that as an output (akaRandomPasswordproperty of myreadonly) how can I mark this property to be treated as a secret value so that if someone does a top-levelComponentResourcewon’t print in clear text?export const pass = myComponentResource.password;
RandomPassword is secret. If you don't do that, the output of that resource will end up in plaintext in the statefile regardless of what your component decides to do with its outputs.
So you will want to use additionalSecretOutputs on the RandomPassword . Then, that output will be marked as secret, and everywhere else it flows it will remain a secret - including as an output of your component.
Note that once https://github.com/pulumi/pulumi-terraform-bridge/issues/10 is addressed, this whole thing should be automatic - the output of RandomPassword will automatically be a secret without you needing to say anything, and thay will flow through the rest of the Pulumi code naturally.
Does that help?rhythmic-finland-36256
05/27/2020, 3:25 PMadditionalSecretOutputs on `ComponentResource`s. Marking the result on the RandomPassword accordingly did the trick. I had expected this to be the default for this resource that’s why I was wondering if I need to specify it again on my `ComponentResource`s. Might be great to have this in the samples/docs as for now basically everyone should do it like this when creating a RandomPassword. Thanks for your help! 👍