https://pulumi.com logo
Title
m

mysterious-australia-14256

07/05/2021, 9:34 PM
When I create a Logic App Connection I am able to specify ParameterValues as a Dictionary<string,string> as per the Pulumi docs
"parameterValues": {
          "authType": "[parameters('authType')]",
          "gateway": {
            "id": "[parameters('gateway_id')]"
          }
        }
I am currently trying to create a connection that depends on an on-prem data gateway. If I create this connection using the Logic App Designer in Visual Studio I can see the associated parameterValues as
"parameterValues": {
          "authType": "[parameters('authType')]",
          "gateway": {
            "id": "[parameters('gateway_id')]"
          }
        }
Does this mean that the parameterValues dictionary presented by Pulumi should be Dictionary<string,object> rather than Dictionary<string,string>? If not, how can I specify the gateway reference with the associated ID as depicted above? Thanks Alan
I guess you should report this upstream as well. Let me know if you need help with it.
m

mysterious-australia-14256

07/06/2021, 8:15 AM
OK, if the connection module isn't currently able to handle all scenarios, can I use Pulumi to construct an arm template and deploy that? I am not sure how I would go about replacing values in the template with values from a previously created object e.g. the 'gateway_id' parameter in the example above needs to come from a gateway object created earlier in the stack. How can I add their return values to a Template being built as a string and handle their async nature?
t

tall-librarian-49374

07/06/2021, 8:37 AM
You would build them with `apply`’s on outputs. The Template accepts inputs, so you can pass the result of `apply`’s to it. I can’t think of an example of that in our repos, unfortunately.
m

mysterious-australia-14256

07/06/2021, 9:00 AM
OK thanks I'll give it a shot. I see there is also a parameters property. Is that Dictionary<string,string>?
seems to be Dictionary<string, Dictionary<string,string>>
Hi @tall-librarian-49374, can you give me an example of how I use the Apply approach? For example I have
var api = new PulumiWeb.Inputs.ApiReferenceArgs
{
    Id = "someprefix/<connectorName>"
}
I have a connector object and I need to extract its Name property and use that to replace <connectorName> in the above. Whatever I try I keep getting Pulumi.Output`1[System.String] appended :)
t

tall-librarian-49374

07/06/2021, 1:39 PM
You can do
Output.Format($"someprefix/{connector.Name}")
in this example
Alternatively,
connector.Name.Apply(name => $"someprefix/{name}")
👍 1