creamy-fall-88031
05/24/2022, 2:39 PMidentity: {
type: azure_native.network.ResourceIdentityType.UserAssigned,
userAssignedIdentities: {
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {},
},
},
Now, I'm trying to change resource path in the example above with something more dynamic, so did the following:
let userIdentity = pulumi.all([subscriptionId, resourceGroup.name, userAssignedIdentity.id])
.apply(([subscriptionId, resourceGroup, usrAssignedIdentity]) => `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/${usrAssignedIdentity}`)
And then used it as follows:
identity: {
type: azure_native.network.ResourceIdentityType.UserAssigned,
userAssignedIdentities: {
${userIdentity} : {},
},
},
But this doesn't seem to be working when the variable {$userIdentity}
is on the left of the colon sign. I'm getting the following error:
error: Code="LinkedInvalidPropertyId" Message="Property id 'userIdentity' at path '' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'."
Can someone please help me with the proper way to do this ?orange-policeman-59119
05/24/2022, 4:13 PMuserAssignedIdentities: userIdentity.apply(x => ({
[x]: {}
})
creamy-fall-88031
05/24/2022, 4:25 PMorange-policeman-59119
05/24/2022, 4:26 PMcreamy-fall-88031
05/24/2022, 4:28 PM