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.No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by