sparse-intern-71089
01/24/2020, 3:48 AMgentle-diamond-70147
01/24/2020, 4:07 PMimport * as gcp from "@pulumi/gcp";
const privateNetwork = new gcp.compute.Network("private");
const privateIpAddress = new gcp.compute.GlobalAddress("private", {
network: privateNetwork.selfLink,
purpose: "VPC_PEERING",
addressType: "INTERNAL",
prefixLength: 16,
});
const privateVpcConnection = new gcp.servicenetworking.Connection("private", {
network: privateNetwork.selfLink,
service: "<http://servicenetworking.googleapis.com|servicenetworking.googleapis.com>",
reservedPeeringRanges: [privateIpAddress.name],
});
const instance = new gcp.sql.DatabaseInstance("private", {
region: "us-central1",
settings: {
tier: "db-f1-micro",
ipConfiguration: {
ipv4Enabled: false,
privateNetwork: privateNetwork.selfLink,
}
}
}, { dependsOn: privateVpcConnection })
some-xylophone-39695
01/24/2020, 5:20 PMhq
would i just use const privateNetwork = new gcp.computer.Network("hq")
?some-xylophone-39695
01/24/2020, 5:21 PMhq
VPC when I issue a pulumi destroy
gentle-diamond-70147
01/24/2020, 5:22 PM... new <resource>
in Pulumi, Pulumi will create that resource and then manage it going forward. So you can create any number of new resources with Pulumi and it will not interfere or touch your existing resources.some-xylophone-39695
01/24/2020, 5:23 PMgentle-diamond-70147
01/24/2020, 5:23 PMhq
you would remove the const privateNetwork = new gcp.computer.Network("hq")
part (as that will create a new network), and pass the self link value of your hq
network in its place.some-xylophone-39695
01/24/2020, 5:24 PMsome-xylophone-39695
01/24/2020, 5:34 PMprivate_network = Network.get('hq-vpc', id='hq')
gentle-diamond-70147
01/24/2020, 5:35 PM