little-library-54601
08/03/2023, 3:40 PMpulumi import
generates for an existing Azure SignalR resource. The specific property in question is the NetworkACLs.PublicNetwork.Allow
property. To keep it short, the docs contain this code for that property:
NetworkACLs = new AzureNative.SignalRService.Inputs.SignalRNetworkACLsArgs
{
DefaultAction = "Deny",
PrivateEndpoints = new[]
{
new AzureNative.SignalRService.Inputs.PrivateEndpointACLArgs
{
Allow = new[]
{
"ServerConnection",
},
Name = "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e",
},
},
PublicNetwork = new AzureNative.SignalRService.Inputs.NetworkACLArgs
{
Allow = new[]
{
"ClientConnection",
},
},
},
and the pulumi import
generates this:
NetworkACLs = new AzureNative.SignalRService.Inputs.SignalRNetworkACLsArgs
{
DefaultAction = "Deny",
PublicNetwork = new AzureNative.SignalRService.Inputs.NetworkACLArgs
{
Allow = new[]
{
"ServerConnection",
"ClientConnection",
"RESTAPI",
"Trace",
},
},
},
In both cases, the Allow
property is set based on an array of strings. That results in a syntax error:
Cannot implicitly convert type 'string[]' to 'Pulumi.InputList<Pulumi.Union<string, Pulumi.AzureNative.SignalRService.SignalRRequestType>>'
The correct syntax seems like it should be:
NetworkACLs = new SignalRNetworkACLsArgs
{
DefaultAction = "Deny",
PublicNetwork = new NetworkACLArgs
{
Allow = new InputList<Union<string, SignalRRequestType>>() { "ServerConnection", "ClientConnection", "RESTAPI", "Trace" },
},
},
I'm hoping that: a) Someone can confirm that the syntax that successfully compiles is a valid if not intended syntax for setting the Allow
property; b) Someone can explain why the docs and the pulumi import
code both contain code that has errors.
Thanks.