-
Issues I have:
- my pulumi preview continuously shows some differences to the outputs (https://gitlab.com/-/snippets/2101279#LC1) - but in the diff there are no properties changed
- I cannot see userId and password outputs (specified as outputs of my dynamic resource) to be included in the outputs (https://gitlab.com/-/snippets/2101279#LC20)
- I am not sure how I should declare that the User.password output property is a secret - shall I use additionalSecretOutputs in the provider opts to the User super constructor call (at https://gitlab.com/-/snippets/2101279#LC124)?
-
I've found causes of my issues:
-
https://github.com/pulumi/pulumi/issues/6718 - when a resource object is exported directly it contains some "hidden" properties that cause differences but these properties are not shown in the output (properties like
__aliases
,__provider
etc.) -
Resource
args
passed to the dynamic resourcesuper
constructor must include entries for the resource output properties (in my caseuserId
andpassword
), e.g.{userId: undefined, password: undefined, ...args}
:Incorrect:
constructor(resourceName: string, args: UserArgs, opts?: pulumi.CustomResourceOptions) { super(userProvider, `mycorp:mysystem:User:${resourceName}`, args, opts); }
Correct:
constructor(resourceName: string, args: UserArgs, opts?: pulumi.CustomResourceOptions) { super(userProvider, `mycorp:mysystem:User:${resourceName}`, {userId: undefined, password: undefined, ...args}, opts); }
-
I used
additionalSecretOutputs
entry in theCustomResourceOptions
opts passed to thesuper
constructor:{...opts, additionalSecretOutputs: ['password']}
Fixed version of the
User
resource class:export class User extends pulumi.dynamic.Resource { public readonly userId: pulumi.Output<string> public readonly password: pulumi.Output<string> constructor(resourceName: string, args: UserArgs, opts?: pulumi.CustomResourceOptions) { super(userProvider, `mycorp:mysystem:User:${resourceName}`, {userId: undefined, password: undefined, ...args}, {...opts, additionalSecretOutputs: ['password']}); } }
-
Please register or sign in to comment