Hi guys, I’m working with the digitalocean provid...
# golang
b
Hi guys, I’m working with the digitalocean provider. Following the example to create a firewall I’m trying to use the ID of the created droplet. The example: https://www.pulumi.com/registry/packages/digitalocean/api-docs/firewall/ My code to create the firewall:
Copy code
_, err = do.NewFirewall(ctx, "databaseFirewall", &do.FirewallArgs{
			DropletIds: pulumi.IntArray{
				dataBaseServer.ID(),
			},
			InboundRules: do.FirewallInboundRuleArray{},
			OutboundRules: do.FirewallOutboundRuleArray{},
		})
I get the following error:
Copy code
Cannot use 'dataBaseServer.ID()' (type IDOutput) as the type IntInputType does not implement 'IntInput' as some methods are missing:ToIntOutput() IntOutputToIntOutputWithContext(ctx context.Context) IntOutputToIntPtrOutput() IntPtrOutput…
What am I missing? 😄
n
AFAIR, an Pulumi ID is a string, so I think you could probably do something like
dataBaseServer.ID().ApplyT(strconv.Atoi).(pulumi.IntOutput)
b
Thank you 🙂 To convert the value was also my last idea. It is a pity that the documentation does not show the correct way.