https://pulumi.com logo
#python
Title
# python
i

icy-dress-83371

03/30/2021, 3:06 PM
Hi all, Been working through some output related issues in python, hopefully someone can point out my stupid mistake. I am trying to use some output in a block for idintities in azure application gatways. Below is my code block (and the associated function), which are all attempts to do the same thing, but the ONLY one that works is a hardcoded string (the last line, ***'s are real values in my code):
Copy code
def get_appgw_id(gw_name):
    return Output.concat("/subscriptions/",subscription_id,"/resourceGroups/",resource_group.name,"/providers/Microsoft.ManagedIdentity/userAssignedIdentities/",gw_name)
...
...
identity=network.ManagedServiceIdentityArgs(
        type="UserAssigned",
        user_assigned_identities={
        str(Output.concat(gatewayId.id)): {},
        f"{gatewayId.id.apply(lambda id: id)}": {},
        f"{Output.concat('/subscriptions/',subscription_id,'/resourceGroups/',resource_group.name,'/providers/Microsoft.ManagedIdentity/userAssignedIdentities',gatewayId.name)}": {},
        f"/subscriptions/{subscription_id}/resourcegroups/{resource_group.name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{gatewayId.name}": {},
        f"{get_appgw_id(gatewayId.name)}": {},
        f"/subscriptions/*****/resourcegroups/*****/providers/Microsoft.ManagedIdentity/userAssignedIdentities/*****": {},

        },
    ),
Also to note, have exported these values, and they are exactly what I am using to paste in the hard coded values in that last attempt:
Copy code
export("GW_USER_ID", gatewayId.id)
export("GW_USER_ID_GEN", get_appgw_id(gatewayId.name))
export("GW_USER_ID_LAMBDA", gatewayId.id.apply(lambda id: id))