sparse-intern-71089
10/11/2021, 7:22 PMsteep-toddler-94095
10/11/2021, 7:50 PMreduce
(or whatever the equivalent is in .Net - Aggregate
?)worried-knife-31967
10/11/2021, 8:16 PMsteep-toddler-94095
10/11/2021, 8:33 PMmap
would work (this is pseudocode since I don't know .Net languages)
const cosmosStuff = apps.map((app, index) => {
return {
componentResourceOptions: index == 0 ? null! : new ComponentResourceOptions { DependsOn = { apps[index-1].Value }};
cosmosDbRoles: new CosmosDbRoles($"{StackConstants.ApplicationName.ToLower()}-{app.Key}-cosmosdbroles",
new CosmosDbRoleArgs() {
ResourceGroupName = globalResourceGroup.Name,
FunctionIdentity = app.Value.AppIdentity,
CosmosDatabaseAccountName = cosmos.CosmosDatabaseAccountName,
CosmosDatabaseAccountId = cosmos.CosmosDatabaseAccountId
},
options
);
}
})
worried-knife-31967
10/11/2021, 8:55 PMsteep-toddler-94095
10/11/2021, 9:05 PMnew
resources in the returned array. there might be a better way if given more specifics about the problem you're trying to solve, but without that this will be the simplest it getsbored-oyster-3147
10/12/2021, 1:35 AMworried-knife-31967
10/12/2021, 8:00 PM