powerful-football-81694
01/15/2020, 6:26 PMOutput<T>
, where T is a string containing a comma-separated list of IP addresses, into multiple resources where each resource takes one of those IP addresses as an input?
Case in point: AppService
exposes PossibleOutboundIpAddresses
as such an output property, and I need to transform that and create one Sql.FirewallRule
for each IP address in that string. Of course I want to keep the chain of inputs-to-outputs intact to not break the dependency tracking etc.
Anyone know how to do this?fast-dinner-32080
01/15/2020, 7:20 PMpowerful-football-81694
01/15/2020, 7:22 PMfast-dinner-32080
01/15/2020, 7:23 PMpowerful-football-81694
01/15/2020, 7:23 PMappService.PossibleOutboundIpAddresses.Apply(x =>
{
var ipAddresses = x.Split(',').ToList();
foreach (var ipAddress in ipAddresses)
{
var index = ipAddresses.IndexOf(ipAddress);
var sqlFirewallRule = new FirewallRule(
$"idl-licensing-{stackName}-sqlFirewallRule{index:D2}",
new FirewallRuleArgs()
{
Name = Output.Format($"{appService.Name}-{index:D2}"),
ResourceGroupName = resourceGroup.Name,
ServerName = sqlServer.Name,
StartIpAddress = ipAddress,
EndIpAddress = ipAddress
});
}
return Output.Create(false); // Not used for anything...
});
tall-librarian-49374
01/15/2020, 7:31 PMpowerful-football-81694
01/15/2020, 7:33 PMtall-librarian-49374
01/15/2020, 7:35 PMpowerful-football-81694
01/15/2020, 7:39 PM