https://pulumi.com logo
Title
b

brash-quill-35776

11/11/2021, 12:27 AM
Hi, I guess it's more of a Typescript thing but For type like
*readonly* identity: pulumi.Output<outputs.web.ManagedServiceIdentityResponse | undefined>;
How do I put them into another
Input
type? I would get
Type 'Output<string | undefined>' is not assignable to type 'Input<string>'.
  Type 'OutputInstance<string | undefined>' is not assignable to type 'Input<string>'.
    Type 'OutputInstance<string | undefined>' is not assignable to type 'OutputInstance<string>'.
      Type 'string | undefined' is not assignable to type 'string'.
        Type 'undefined' is not assignable to type 'string'.ts(2322)
b

brief-xylophone-82066

11/11/2021, 6:51 AM
You can normally pass Outputs as Inputs, the error you’re getting is with the inner type conversion since on the Output side it might be undefined. You might be able to do something like this if you’re okay with moving that condition out to the read-only property itself:
readonly identity?: pulumi.Output<outputs.web.ManagedServiceIdentityResponse>;
though you’ll probably want logic to deal with what happens if its not actually provided wherever this is being used.
b

brash-quill-35776

11/11/2021, 3:14 PM
thank you, that definitely makes sense to me. but this is the
azure-native
package, which I can't update. with that, what can I do to work it around?