wooden-battery-52855
07/19/2021, 2:53 PMprehistoric-activity-61023
07/19/2021, 2:58 PMip_address_range = gcp.compute.GlobalAddress(
"global-address",
purpose="VPC_PEERING",
address_type="INTERNAL",
prefix_length=16,
network=network.name,
)
gcp.servicenetworking.Connection(
"private-connection",
network=network.id,
service="<http://servicenetworking.googleapis.com|servicenetworking.googleapis.com>",
reserved_peering_ranges=[ip_address_range.name],
)
where network
is an instance of gcp.compute.Network
<http://servicenetworking.googleapis.com|servicenetworking.googleapis.com>
service enabled. If you want to make it via pulumi as well:
service_networking_api = gcp.projects.Service(
"servicenetworking",
disable_dependent_services=True,
service="<http://servicenetworking.googleapis.com|servicenetworking.googleapis.com>",
)
depends_on
in gcp.servicenetworking.Connection
(or run pulumi up
twice 😛):
gcp.servicenetworking.Connection(
"private-connection",
network=network.id,
service="<http://servicenetworking.googleapis.com|servicenetworking.googleapis.com>",
reserved_peering_ranges=[ip_address_range.name],
=> pulumi.ResourceOptions(depends_on=[service_networking_api])
)
helpful-hair-30515
07/19/2021, 3:12 PMallocated_range
prehistoric-activity-61023
07/19/2021, 3:13 PM...
ip_configuration=gcp.sql.DatabaseInstanceSettingsIpConfigurationArgs(
private_network=network.id,
),
...
gcp.servicenetworking.Connection
and gcp.sql.DatabaseInstance
cannot be detected automatically, so you either have to make sure that private connection is created before you try to create database instance or use depends_on
again to explicitly mark this factwooden-battery-52855
07/19/2021, 3:19 PMprehistoric-activity-61023
07/19/2021, 3:27 PMhelpful-hair-30515
07/19/2021, 3:28 PM1.allocate IP range
2.Create Connection