HI all, excuse my stupidity here, but I am trying ...
# python
i
HI all, excuse my stupidity here, but I am trying to work off of an Azure example that is written in typescript (which I am not supoer competent in) wonder if anyone could help convert this pulumi block to python:
Copy code
const resourceId = (resource: string) =>
  pulumi
    .all([resourceGroup.name, currentSubscription])
    .apply(
      ([resourceGroupName, subscription]) =>
        `/subscriptions/${subscription.subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Network/applicationGateways/${applicationGatewayName}/${resource}/${defaultName}`
    );
Basically, I am trying to build a resource string, where part of the values are coming from other pulumi components, while some are plain python variables. I don't have a ton of experience with python lamdas either, so I am a bit stuck
h
Copy code
pulumi.Output.all(resource_group.name, current_subscription).apply(
        lambda args: # do whatever here with args[0] and args[1]
)
try this out?
i
thanks @handsome-state-59775 I ended up skipping the lambda and trying out pulumi's output.concat.
👍🏽 1
Copy code
def get_resource_id(resource_type):
    return Output.concat("/subscriptions/",subscription_id,"/resourceGroups/",resource_group.name,"/providers/Microsoft.Network/applicationGateways/",application_gateway_name,"/",resource_type,"/",default_name)
👍 1
s
I would pass all parameters to the
get_resource_id
instead of depending on variables outside of its scope though