Connection

Manages a private VPC connection with a GCP service provider. For more information see the official documentation and API.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.GlobalAddress;
import com.pulumi.gcp.compute.GlobalAddressArgs;
import com.pulumi.gcp.servicenetworking.Connection;
import com.pulumi.gcp.servicenetworking.ConnectionArgs;
import com.pulumi.gcp.compute.NetworkPeeringRoutesConfig;
import com.pulumi.gcp.compute.NetworkPeeringRoutesConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var peeringNetwork = new Network("peeringNetwork");
var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()
.purpose("VPC_PEERING")
.addressType("INTERNAL")
.prefixLength(16)
.network(peeringNetwork.id())
.build());
var default_ = new Connection("default", ConnectionArgs.builder()
.network(peeringNetwork.id())
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(privateIpAlloc.name())
.build());
var peeringRoutes = new NetworkPeeringRoutesConfig("peeringRoutes", NetworkPeeringRoutesConfigArgs.builder()
.peering(default_.peering())
.network(peeringNetwork.name())
.importCustomRoutes(true)
.exportCustomRoutes(true)
.build());
}
}

Import

ServiceNetworkingConnection can be imported using any of these accepted formats

$ pulumi import gcp:servicenetworking/connection:Connection peering_connection {{peering-network}}:{{service}}
$ pulumi import gcp:servicenetworking/connection:Connection peering_connection /projects/{{project}}/global/networks/{{peering-network}}:{{service}}

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val network: Output<String>

Name of VPC network connected with service producers using VPC peering.

Link copied to clipboard
val peering: Output<String>

(Computed) The name of the VPC Network Peering connection that was created by the service producer.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Named IP address range(s) of PEERING type reserved for this service provider. Note that invoking this method with a different range when connection is already established will not reallocate already provisioned service producer subnetworks.

Link copied to clipboard
val service: Output<String>

Provider peering service that is managing peering connectivity for a service provider organization. For Google services that support this functionality it is 'servicenetworking.googleapis.com'.

Link copied to clipboard
val urn: Output<String>