prehistoric-fish-76119
02/08/2024, 11:35 AMhcloud
NetworkSubnet correct way linked to Network, looks like docs examples outdated (https://www.pulumi.com/registry/packages/hcloud/api-docs/networksubnet/):
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const mynet = new hcloud.Network("mynet", {ipRange: "10.0.0.0/8"});
const foonet = new hcloud.NetworkSubnet("foonet", {
networkId: mynet.id,
type: "cloud",
networkZone: "eu-central",
ipRange: "10.0.1.0/24",
});
Because Network network.id
is Output<string> and NetworkSubnet networkId is Input<number>.
The same situation in Go version.little-cartoon-10569
02/08/2024, 6:38 PMnetwork.id.apply((idstring) => +idstring)
.prehistoric-fish-76119
02/08/2024, 7:03 PMnetwork.id.apply(Number.parseFloat)