adorable-activity-71456
04/10/2024, 3:51 PMconst foo = new newrelic.cloud.GcpLinkAccount("foo", {projectId: "<Your GCP project ID>"});
const foo1 = new newrelic.cloud.GcpIntegrations("foo1", {
linkedAccountId: foo.id,
linkedAccountId
is expecting a number and foo.id
from the linked account is a string. Either the documentation is wrong (or I am miss reading it), or the type implementation is wrong? Any help? Thanks. I will also issue a support ticket on this and will add its reference in a thread.
Thanks!adorable-activity-71456
04/10/2024, 3:57 PMwitty-candle-66007
04/10/2024, 4:03 PMadorable-activity-71456
04/10/2024, 4:06 PMType 'Output<string>' is not assignable to type 'Input<number>'.
Type 'Output<string>' is not assignable to type 'OutputInstance<number>'.
That’s the first two lines.adorable-activity-71456
04/10/2024, 4:07 PMfoo.id
and Input<number> being linkedAccountId
adorable-activity-71456
04/10/2024, 4:09 PMsrc/new-relic.ts:43:5 - error TS2322: Type 'Output<string>' is not assignable to type 'Input<number>'.
Type 'Output<string>' is not assignable to type 'OutputInstance<number>'.
Types of property 'apply' are incompatible.
Type '{ <U>(func: (t: string) => Promise<U>): Output<U>; <U>(func: (t: string) => OutputInstance<U>): Output<U>; <U>(func: (t: string) => U): Output<...>; }' is not assignable to type '{ <U>(func: (t: number) => Promise<U>): Output<U>; <U>(func: (t: number) => OutputInstance<U>): Output<U>; <U>(func: (t: number) => U): Output<...>; }'.
Types of parameters 'func' and 'func' are incompatible.
Types of parameters 't' and 't' are incompatible.
Type 'string' is not assignable to type 'number'.
43 linkedAccountId: foo.id,
~~~~~~~~~~~~~~~
../../node_modules/@pulumi/newrelic/cloud/gcpIntegrations.d.ts:443:5
443 linkedAccountId: pulumi.Input<number>;
~~~~~~~~~~~~~~~
The expected type comes from property 'linkedAccountId' which is declared here on type 'GcpIntegrationsArgs'
Found 1 error in src/new-relic.ts:43
witty-candle-66007
04/10/2024, 4:12 PMfoo.id
is a stringified number? Or is it alphanumeric?
If it is a number, a quick fix that should work would be:
linkedAccountid: foo.id.apply(id => parseInt(id))
adorable-activity-71456
04/10/2024, 4:19 PMwitty-candle-66007
04/10/2024, 4:20 PMadorable-activity-71456
04/10/2024, 4:21 PMwitty-candle-66007
04/10/2024, 4:21 PMadorable-activity-71456
04/10/2024, 4:21 PMadorable-activity-71456
04/10/2024, 4:21 PMwitty-candle-66007
04/10/2024, 4:39 PM