orange-dog-73995
10/06/2020, 1:21 PMvar publicIp = new PublicIPAddress("public-ip", new Pulumi.AzureNextGen.Network.Latest.PublicIPAddressArgs
{
PublicIpAddressName = "public-ip",
Location = _resourceGroup.Location,
ResourceGroupName = _resourceGroup.Name,
PublicIPAllocationMethod = "Static"
});
var frontendIPConfiguration = new FrontendIPConfigurationArgs
{
Name = "PublicIPAddress",
PublicIPAddress = new Pulumi.AzureNextGen.Network.Latest.Inputs.PublicIPAddressArgs
{
Id = publicIp.Id,
}
};
var NatRuleArgs_dc = new Pulumi.AzureNextGen.Network.Latest.Inputs.InboundNatRuleArgs
{
Name = "dc_rdp",
Protocol = "Tcp",
FrontendPort = 33390,
BackendPort = 3389,
EnableTcpReset = false,
FrontendIPConfiguration = new Pulumi.AzureNextGen.Network.Latest.Inputs.SubResourceArgs { Id = frontendIPConfiguration.Id },
};
...//2 more rules
var NatRulesArgs = new List<Pulumi.AzureNextGen.Network.Latest.Inputs.InboundNatRuleArgs> { NatRuleArgs_dc, NatRuleArgs_aap, NatRuleArgs_vui };
var loadBalancer = new LoadBalancer("LoadBalancer", new LoadBalancerArgs
{
LoadBalancerName = "LoadBalancer",
ResourceGroupName = _resourceGroup.Name,
Location = _resourceGroup.Location,
FrontendIPConfigurations = frontendIPConfiguration,
InboundNatRules = NatRulesArgs,
});
On pulumi up
it fails with following:
error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details=[{"code":"MissingJsonReferenceId","message":"Value for reference id is missing. Path properties.inboundNatRules[0].properties.frontendIPConfiguration."}
Apparently it fails to link frontendIPConfig to rule, but how to do that right, please?tall-librarian-49374
10/07/2020, 6:23 AMfrontendIPConfiguration.Id
is never assigned in your programorange-dog-73995
10/07/2020, 6:28 AMvar frontendIPConfiguration = new Pulumi.AzureNextGen.Network.Latest.Inputs.FrontendIPConfigurationArgs
{
Id = "PublicIPAddress",
Name = "PublicIPAddress",
PublicIPAddress = new Pulumi.AzureNextGen.Network.Latest.Inputs.PublicIPAddressArgs
{
Id = publicIp.Id,
}
};
then error is:
error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details=[{"code":"InvalidJsonReferenceFormat","message":"Reference Id PublicIPAddress is not formatted correctly. The Id is expected to reference resources of type loadBalancers/frontendIPConfigurations. Path properties.inboundNatRules[0].properties.frontendIPConfiguration."tall-librarian-49374
10/07/2020, 6:55 AMthought .Id is assigned upon resource creation by pulumi?It’s not assigned in the args, it’s assigned in the resource ouputs
Reference Id PublicIPAddress is not formatted correctlyYou need to provide a real ID, not a fake ID. I’m not familiar enough with this resource to give a more specific advice.
orange-dog-73995
10/07/2020, 8:39 AMtall-librarian-49374
10/07/2020, 9:26 AMorange-dog-73995
10/07/2020, 9:35 AMtall-librarian-49374
10/07/2020, 9:47 AM"id": "[concat(resourceId('Microsoft.Network/loadBalancers', parameters('loadBalancers_access_gateway_name')), '/frontendIPConfigurations/LoadBalancerFrontEnd')]"
partorange-dog-73995
10/07/2020, 9:58 AMtall-librarian-49374
10/07/2020, 10:09 AMorange-dog-73995
10/07/2020, 10:57 AMtall-librarian-49374
10/07/2020, 10:58 AMOutput.Format($"{_resourceGroup.Id}/allyour/other/segments/here")
orange-dog-73995
10/07/2020, 11:14 AMId = Output.Format($"{_resourceGroup.Id}/providers/Microsoft.Network/loadBalancers/Loadbalancer/frontendIPConfigurations/LoadBalancerFrontEnd")
Still no go...
error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details=[{"code":"MissingJsonReferenceId","message":"Value for reference id is missing. Path properties.frontendIPConfigurations[0].properties.publicIPAddress."}]tall-librarian-49374
10/07/2020, 11:55 AMvar frontendIPConfiguration = new FrontendIPConfigurationArgs
{
Id = Output.Format($"{resourceGroup.Id}/providers/Microsoft.Network/loadBalancers/LoadBalancer/frontendIPConfigurations/LoadBalancerFrontEnd"),
Name = "LoadBalancerFrontEnd",
PublicIPAddress = new Pulumi.AzureNextGen.Network.Latest.Inputs.PublicIPAddressArgs
{
Id = publicIp.Id,
}
};
latest:LoadBalancer LoadBalancer created
orange-dog-73995
10/07/2020, 12:41 PMtall-librarian-49374
10/07/2020, 12:42 PMorange-dog-73995
10/07/2020, 12:58 PMprivate List<Pulumi.AzureNextGen.Network.Latest.Inputs.InboundNatRuleArgs> BuildLoadBalancer()
{
var publicIp = new Pulumi.AzureNextGen.Network.Latest.PublicIPAddressArgs
{
PublicIpAddressName = "public-ip",
Location = _resourceGroup.Location,
ResourceGroupName = _resourceGroup.Name,
PublicIPAllocationMethod = "Static"
};
var frontendIPConfiguration = new FrontendIPConfigurationArgs
{
Id = Output.Format($"{_resourceGroup.Id}/providers/Microsoft.Network/loadBalancers/test-lb/frontendIPConfigurations/LoadBalancerFrontEnd"),
Name = "LoadBalancerFrontEnd",
PublicIPAddress = new Pulumi.AzureNextGen.Network.Latest.Inputs.PublicIPAddressArgs
{
Id = publicIp.Id,
}
};
var NatRuleArgs_dc = new Pulumi.AzureNextGen.Network.Latest.Inputs.InboundNatRuleArgs
{
Name = "dc_rdp",
Protocol = "Tcp",
FrontendPort = 33390,
BackendPort = 3389,
EnableTcpReset = false,
FrontendIPConfiguration = new Pulumi.AzureNextGen.Network.Latest.Inputs.SubResourceArgs
{
Id = frontendIPConfiguration.Id,
},
};
var NatRuleArgs_aap = new Pulumi.AzureNextGen.Network.Latest.Inputs.InboundNatRuleArgs
{
Name = "aap_rdp",
Protocol = "Tcp",
FrontendPort = 33391,
BackendPort = 3389,
EnableTcpReset = false,
FrontendIPConfiguration = new Pulumi.AzureNextGen.Network.Latest.Inputs.SubResourceArgs
{
Id = frontendIPConfiguration.Id,
},
};
var NatRuleArgs_vui = new Pulumi.AzureNextGen.Network.Latest.Inputs.InboundNatRuleArgs
{
Name = "vui_rdp",
Protocol = "Tcp",
FrontendPort = 33392,
BackendPort = 3389,
EnableTcpReset = false,
FrontendIPConfiguration = new Pulumi.AzureNextGen.Network.Latest.Inputs.SubResourceArgs
{
Id = frontendIPConfiguration.Id,
},
};
var NatRulesArgs = new List<Pulumi.AzureNextGen.Network.Latest.Inputs.InboundNatRuleArgs> { NatRuleArgs_dc, NatRuleArgs_aap, NatRuleArgs_vui };
var loadBalancer = new LoadBalancer("test-lb", new LoadBalancerArgs
{
LoadBalancerName = "test-lb",
ResourceGroupName = _resourceGroup.Name,
Location = _resourceGroup.Location,
FrontendIPConfigurations = frontendIPConfiguration,
InboundNatRules = NatRulesArgs,
});
return NatRulesArgs;
}
tall-librarian-49374
10/07/2020, 1:02 PMorange-dog-73995
10/07/2020, 1:05 PMtall-librarian-49374
10/07/2020, 1:05 PMvar publicIp = new PublicIPAddress("public-ip", new Pulumi.AzureNextGen.Network.Latest.PublicIPAddressArgs
{
PublicIpAddressName = "public-ip",
Location = resourceGroup.Location,
ResourceGroupName = resourceGroup.Name,
PublicIPAllocationMethod = "Static"
});
For the rest your code works.orange-dog-73995
10/07/2020, 1:11 PMtall-librarian-49374
10/07/2020, 1:17 PM