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

colossal-room-15708

11/14/2023, 9:39 PM
X-Post from a thread in #azure (not Azure related): I am passing an `Output<string>`to a module in my TS stack. That module takes that as an argument. I then use that argument as input to a resource and things fail with "Calling [toString] on an [Output<T>] is not supported".
Copy code
...
export function scanApp(resourceGroupName: Output<string>,...): {

...
const appName = pulumi.interpolate`argos-${resourceGroupName}`;
const prefix = `${appName}-${stack}`;
new appservice.Plan(appServicePlanName, {
      resourceGroupName: resourceGroupName,
      name: prefix
...
}
I guess it fails on
prefix
? How do I do this?
d

dry-keyboard-94795

11/14/2023, 10:31 PM
prefix also needs to use
pulumi.interpolate
c

colossal-room-15708

11/14/2023, 10:32 PM
yeah, I found that, but I also realised that
appServicePlanName
a bit higher up also uses
appName
which is apparently not supported. The resource name can't use
pulumi.interpolate
d

dry-keyboard-94795

11/14/2023, 10:33 PM
yes, resource names must be known ahead of time so the stack can be built
c

colossal-room-15708

11/14/2023, 10:34 PM
hmm, so best to not make them depend on anything environment specific then
which makes sense, this should all be hidden behind stacks
2 Views