sparse-intern-71089
02/08/2023, 2:40 PMbillowy-army-68599
rapid-motherboard-85863
02/08/2023, 3:51 PMbillowy-army-68599
billowy-army-68599
billowy-army-68599
rapid-motherboard-85863
02/08/2023, 3:54 PMrapid-motherboard-85863
02/08/2023, 3:55 PMrapid-motherboard-85863
02/08/2023, 3:56 PMbillowy-army-68599
billowy-army-68599
rapid-motherboard-85863
02/08/2023, 4:01 PMbillowy-army-68599
rapid-motherboard-85863
02/08/2023, 4:04 PMrapid-motherboard-85863
02/08/2023, 4:06 PMvar asp = appServicePlanModule.CreateResource();
rapid-motherboard-85863
02/08/2023, 4:07 PMbillowy-army-68599
rapid-motherboard-85863
02/08/2023, 4:10 PMpublic Component CreateResource(CustomResource? parent = null, CustomResource? associatedResource = null, CustomResource? dependsOn = null, string index = "01")
{
var ai = new Component($"ai-{index}", new ComponentArgs
{
ApplicationType = ApplicationType.Web,
ResourceGroupName = _configOptions.ResourceGroupName,
Location = _configOptions.Location,
ResourceName = $"{_configOptions.ResourcePrefix}-ai-{_configOptions.EnvironmentIdentifier.ToLower()}-{_configOptions.ProjectIdentifier.ToLower()}-{index}",
Kind = "web"
});
return ai;
}
rapid-motherboard-85863
02/08/2023, 4:10 PMrapid-motherboard-85863
02/08/2023, 4:12 PMbillowy-army-68599
Component($"ai-{index}"
This is going to create the same resource name every time it’s invokved, you need to have something in there that invites randomness like a name
property you can passrapid-motherboard-85863
02/08/2023, 4:13 PMbillowy-army-68599
index = "01"
and then invoking like so appServicePlanModule.CreateResource()
isn’t that setting the index as 1 every time?rapid-motherboard-85863
02/08/2023, 4:27 PMrapid-motherboard-85863
02/08/2023, 4:28 PMrapid-motherboard-85863
02/08/2023, 4:28 PMbillowy-army-68599
rapid-motherboard-85863
02/08/2023, 4:31 PMrapid-motherboard-85863
02/08/2023, 4:31 PM