1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. networkconnectivity
  5. ServiceConnectionPolicy
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.networkconnectivity.ServiceConnectionPolicy

Explore with Pulumi AI

Manage Service Connection Policies.

To get more information about ServiceConnectionPolicy, see:

Example Usage

Network Connectivity Policy Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const producerNet = new gcp.compute.Network("producer_net", {
    name: "producer-net",
    autoCreateSubnetworks: false,
});
const producerSubnet = new gcp.compute.Subnetwork("producer_subnet", {
    name: "producer-subnet",
    ipCidrRange: "10.0.0.0/16",
    region: "us-central1",
    network: producerNet.id,
});
const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", {
    name: "my-network-connectivity-policy",
    location: "us-central1",
    serviceClass: "my-basic-service-class",
    description: "my basic service connection policy",
    network: producerNet.id,
    pscConfig: {
        subnetworks: [producerSubnet.id],
        limit: "2",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

producer_net = gcp.compute.Network("producer_net",
    name="producer-net",
    auto_create_subnetworks=False)
producer_subnet = gcp.compute.Subnetwork("producer_subnet",
    name="producer-subnet",
    ip_cidr_range="10.0.0.0/16",
    region="us-central1",
    network=producer_net.id)
default = gcp.networkconnectivity.ServiceConnectionPolicy("default",
    name="my-network-connectivity-policy",
    location="us-central1",
    service_class="my-basic-service-class",
    description="my basic service connection policy",
    network=producer_net.id,
    psc_config={
        "subnetworks": [producer_subnet.id],
        "limit": "2",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		producerNet, err := compute.NewNetwork(ctx, "producer_net", &compute.NetworkArgs{
			Name:                  pulumi.String("producer-net"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		producerSubnet, err := compute.NewSubnetwork(ctx, "producer_subnet", &compute.SubnetworkArgs{
			Name:        pulumi.String("producer-subnet"),
			IpCidrRange: pulumi.String("10.0.0.0/16"),
			Region:      pulumi.String("us-central1"),
			Network:     producerNet.ID(),
		})
		if err != nil {
			return err
		}
		_, err = networkconnectivity.NewServiceConnectionPolicy(ctx, "default", &networkconnectivity.ServiceConnectionPolicyArgs{
			Name:         pulumi.String("my-network-connectivity-policy"),
			Location:     pulumi.String("us-central1"),
			ServiceClass: pulumi.String("my-basic-service-class"),
			Description:  pulumi.String("my basic service connection policy"),
			Network:      producerNet.ID(),
			PscConfig: &networkconnectivity.ServiceConnectionPolicyPscConfigArgs{
				Subnetworks: pulumi.StringArray{
					producerSubnet.ID(),
				},
				Limit: pulumi.String("2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var producerNet = new Gcp.Compute.Network("producer_net", new()
    {
        Name = "producer-net",
        AutoCreateSubnetworks = false,
    });

    var producerSubnet = new Gcp.Compute.Subnetwork("producer_subnet", new()
    {
        Name = "producer-subnet",
        IpCidrRange = "10.0.0.0/16",
        Region = "us-central1",
        Network = producerNet.Id,
    });

    var @default = new Gcp.NetworkConnectivity.ServiceConnectionPolicy("default", new()
    {
        Name = "my-network-connectivity-policy",
        Location = "us-central1",
        ServiceClass = "my-basic-service-class",
        Description = "my basic service connection policy",
        Network = producerNet.Id,
        PscConfig = new Gcp.NetworkConnectivity.Inputs.ServiceConnectionPolicyPscConfigArgs
        {
            Subnetworks = new[]
            {
                producerSubnet.Id,
            },
            Limit = "2",
        },
    });

});
Copy
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.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicy;
import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicyArgs;
import com.pulumi.gcp.networkconnectivity.inputs.ServiceConnectionPolicyPscConfigArgs;
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 producerNet = new Network("producerNet", NetworkArgs.builder()
            .name("producer-net")
            .autoCreateSubnetworks(false)
            .build());

        var producerSubnet = new Subnetwork("producerSubnet", SubnetworkArgs.builder()
            .name("producer-subnet")
            .ipCidrRange("10.0.0.0/16")
            .region("us-central1")
            .network(producerNet.id())
            .build());

        var default_ = new ServiceConnectionPolicy("default", ServiceConnectionPolicyArgs.builder()
            .name("my-network-connectivity-policy")
            .location("us-central1")
            .serviceClass("my-basic-service-class")
            .description("my basic service connection policy")
            .network(producerNet.id())
            .pscConfig(ServiceConnectionPolicyPscConfigArgs.builder()
                .subnetworks(producerSubnet.id())
                .limit("2")
                .build())
            .build());

    }
}
Copy
resources:
  producerNet:
    type: gcp:compute:Network
    name: producer_net
    properties:
      name: producer-net
      autoCreateSubnetworks: false
  producerSubnet:
    type: gcp:compute:Subnetwork
    name: producer_subnet
    properties:
      name: producer-subnet
      ipCidrRange: 10.0.0.0/16
      region: us-central1
      network: ${producerNet.id}
  default:
    type: gcp:networkconnectivity:ServiceConnectionPolicy
    properties:
      name: my-network-connectivity-policy
      location: us-central1
      serviceClass: my-basic-service-class
      description: my basic service connection policy
      network: ${producerNet.id}
      pscConfig:
        subnetworks:
          - ${producerSubnet.id}
        limit: 2
Copy

Create ServiceConnectionPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ServiceConnectionPolicy(name: string, args: ServiceConnectionPolicyArgs, opts?: CustomResourceOptions);
@overload
def ServiceConnectionPolicy(resource_name: str,
                            args: ServiceConnectionPolicyArgs,
                            opts: Optional[ResourceOptions] = None)

@overload
def ServiceConnectionPolicy(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            location: Optional[str] = None,
                            network: Optional[str] = None,
                            service_class: Optional[str] = None,
                            description: Optional[str] = None,
                            labels: Optional[Mapping[str, str]] = None,
                            name: Optional[str] = None,
                            project: Optional[str] = None,
                            psc_config: Optional[ServiceConnectionPolicyPscConfigArgs] = None)
func NewServiceConnectionPolicy(ctx *Context, name string, args ServiceConnectionPolicyArgs, opts ...ResourceOption) (*ServiceConnectionPolicy, error)
public ServiceConnectionPolicy(string name, ServiceConnectionPolicyArgs args, CustomResourceOptions? opts = null)
public ServiceConnectionPolicy(String name, ServiceConnectionPolicyArgs args)
public ServiceConnectionPolicy(String name, ServiceConnectionPolicyArgs args, CustomResourceOptions options)
type: gcp:networkconnectivity:ServiceConnectionPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ServiceConnectionPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ServiceConnectionPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceConnectionPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceConnectionPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ServiceConnectionPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var serviceConnectionPolicyResource = new Gcp.NetworkConnectivity.ServiceConnectionPolicy("serviceConnectionPolicyResource", new()
{
    Location = "string",
    Network = "string",
    ServiceClass = "string",
    Description = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    Project = "string",
    PscConfig = new Gcp.NetworkConnectivity.Inputs.ServiceConnectionPolicyPscConfigArgs
    {
        Subnetworks = new[]
        {
            "string",
        },
        Limit = "string",
    },
});
Copy
example, err := networkconnectivity.NewServiceConnectionPolicy(ctx, "serviceConnectionPolicyResource", &networkconnectivity.ServiceConnectionPolicyArgs{
	Location:     pulumi.String("string"),
	Network:      pulumi.String("string"),
	ServiceClass: pulumi.String("string"),
	Description:  pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name:    pulumi.String("string"),
	Project: pulumi.String("string"),
	PscConfig: &networkconnectivity.ServiceConnectionPolicyPscConfigArgs{
		Subnetworks: pulumi.StringArray{
			pulumi.String("string"),
		},
		Limit: pulumi.String("string"),
	},
})
Copy
var serviceConnectionPolicyResource = new ServiceConnectionPolicy("serviceConnectionPolicyResource", ServiceConnectionPolicyArgs.builder()
    .location("string")
    .network("string")
    .serviceClass("string")
    .description("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .project("string")
    .pscConfig(ServiceConnectionPolicyPscConfigArgs.builder()
        .subnetworks("string")
        .limit("string")
        .build())
    .build());
Copy
service_connection_policy_resource = gcp.networkconnectivity.ServiceConnectionPolicy("serviceConnectionPolicyResource",
    location="string",
    network="string",
    service_class="string",
    description="string",
    labels={
        "string": "string",
    },
    name="string",
    project="string",
    psc_config={
        "subnetworks": ["string"],
        "limit": "string",
    })
Copy
const serviceConnectionPolicyResource = new gcp.networkconnectivity.ServiceConnectionPolicy("serviceConnectionPolicyResource", {
    location: "string",
    network: "string",
    serviceClass: "string",
    description: "string",
    labels: {
        string: "string",
    },
    name: "string",
    project: "string",
    pscConfig: {
        subnetworks: ["string"],
        limit: "string",
    },
});
Copy
type: gcp:networkconnectivity:ServiceConnectionPolicy
properties:
    description: string
    labels:
        string: string
    location: string
    name: string
    network: string
    project: string
    pscConfig:
        limit: string
        subnetworks:
            - string
    serviceClass: string
Copy

ServiceConnectionPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ServiceConnectionPolicy resource accepts the following input properties:

Location
This property is required.
Changes to this property will trigger replacement.
string
The location of the ServiceConnectionPolicy.


Network
This property is required.
Changes to this property will trigger replacement.
string
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
ServiceClass
This property is required.
Changes to this property will trigger replacement.
string
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
Description string
Free-text description of the resource.
Labels Dictionary<string, string>

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Name Changes to this property will trigger replacement. string
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PscConfig ServiceConnectionPolicyPscConfig
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
Location
This property is required.
Changes to this property will trigger replacement.
string
The location of the ServiceConnectionPolicy.


Network
This property is required.
Changes to this property will trigger replacement.
string
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
ServiceClass
This property is required.
Changes to this property will trigger replacement.
string
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
Description string
Free-text description of the resource.
Labels map[string]string

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Name Changes to this property will trigger replacement. string
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PscConfig ServiceConnectionPolicyPscConfigArgs
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
location
This property is required.
Changes to this property will trigger replacement.
String
The location of the ServiceConnectionPolicy.


network
This property is required.
Changes to this property will trigger replacement.
String
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
serviceClass
This property is required.
Changes to this property will trigger replacement.
String
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
description String
Free-text description of the resource.
labels Map<String,String>

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name Changes to this property will trigger replacement. String
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pscConfig ServiceConnectionPolicyPscConfig
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
location
This property is required.
Changes to this property will trigger replacement.
string
The location of the ServiceConnectionPolicy.


network
This property is required.
Changes to this property will trigger replacement.
string
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
serviceClass
This property is required.
Changes to this property will trigger replacement.
string
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
description string
Free-text description of the resource.
labels {[key: string]: string}

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name Changes to this property will trigger replacement. string
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pscConfig ServiceConnectionPolicyPscConfig
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
location
This property is required.
Changes to this property will trigger replacement.
str
The location of the ServiceConnectionPolicy.


network
This property is required.
Changes to this property will trigger replacement.
str
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
service_class
This property is required.
Changes to this property will trigger replacement.
str
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
description str
Free-text description of the resource.
labels Mapping[str, str]

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name Changes to this property will trigger replacement. str
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
psc_config ServiceConnectionPolicyPscConfigArgs
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
location
This property is required.
Changes to this property will trigger replacement.
String
The location of the ServiceConnectionPolicy.


network
This property is required.
Changes to this property will trigger replacement.
String
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
serviceClass
This property is required.
Changes to this property will trigger replacement.
String
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
description String
Free-text description of the resource.
labels Map<String>

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

name Changes to this property will trigger replacement. String
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pscConfig Property Map
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.

Outputs

All input properties are implicitly available as output properties. Additionally, the ServiceConnectionPolicy resource produces the following output properties:

CreateTime string
The timestamp when the resource was created.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Etag string
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
Id string
The provider-assigned unique ID for this managed resource.
Infrastructure string
The type of underlying resources used to create the connection.
PscConnections List<ServiceConnectionPolicyPscConnection>
Information about each Private Service Connect connection. Structure is documented below.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
UpdateTime string
The timestamp when the resource was updated.
CreateTime string
The timestamp when the resource was created.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Etag string
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
Id string
The provider-assigned unique ID for this managed resource.
Infrastructure string
The type of underlying resources used to create the connection.
PscConnections []ServiceConnectionPolicyPscConnection
Information about each Private Service Connect connection. Structure is documented below.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
UpdateTime string
The timestamp when the resource was updated.
createTime String
The timestamp when the resource was created.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
etag String
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
id String
The provider-assigned unique ID for this managed resource.
infrastructure String
The type of underlying resources used to create the connection.
pscConnections List<ServiceConnectionPolicyPscConnection>
Information about each Private Service Connect connection. Structure is documented below.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
updateTime String
The timestamp when the resource was updated.
createTime string
The timestamp when the resource was created.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
etag string
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
id string
The provider-assigned unique ID for this managed resource.
infrastructure string
The type of underlying resources used to create the connection.
pscConnections ServiceConnectionPolicyPscConnection[]
Information about each Private Service Connect connection. Structure is documented below.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
updateTime string
The timestamp when the resource was updated.
create_time str
The timestamp when the resource was created.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
etag str
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
id str
The provider-assigned unique ID for this managed resource.
infrastructure str
The type of underlying resources used to create the connection.
psc_connections Sequence[ServiceConnectionPolicyPscConnection]
Information about each Private Service Connect connection. Structure is documented below.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
update_time str
The timestamp when the resource was updated.
createTime String
The timestamp when the resource was created.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
etag String
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
id String
The provider-assigned unique ID for this managed resource.
infrastructure String
The type of underlying resources used to create the connection.
pscConnections List<Property Map>
Information about each Private Service Connect connection. Structure is documented below.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
updateTime String
The timestamp when the resource was updated.

Look up Existing ServiceConnectionPolicy Resource

Get an existing ServiceConnectionPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ServiceConnectionPolicyState, opts?: CustomResourceOptions): ServiceConnectionPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_time: Optional[str] = None,
        description: Optional[str] = None,
        effective_labels: Optional[Mapping[str, str]] = None,
        etag: Optional[str] = None,
        infrastructure: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        network: Optional[str] = None,
        project: Optional[str] = None,
        psc_config: Optional[ServiceConnectionPolicyPscConfigArgs] = None,
        psc_connections: Optional[Sequence[ServiceConnectionPolicyPscConnectionArgs]] = None,
        pulumi_labels: Optional[Mapping[str, str]] = None,
        service_class: Optional[str] = None,
        update_time: Optional[str] = None) -> ServiceConnectionPolicy
func GetServiceConnectionPolicy(ctx *Context, name string, id IDInput, state *ServiceConnectionPolicyState, opts ...ResourceOption) (*ServiceConnectionPolicy, error)
public static ServiceConnectionPolicy Get(string name, Input<string> id, ServiceConnectionPolicyState? state, CustomResourceOptions? opts = null)
public static ServiceConnectionPolicy get(String name, Output<String> id, ServiceConnectionPolicyState state, CustomResourceOptions options)
resources:  _:    type: gcp:networkconnectivity:ServiceConnectionPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CreateTime string
The timestamp when the resource was created.
Description string
Free-text description of the resource.
EffectiveLabels Dictionary<string, string>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Etag string
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
Infrastructure string
The type of underlying resources used to create the connection.
Labels Dictionary<string, string>

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Location Changes to this property will trigger replacement. string
The location of the ServiceConnectionPolicy.


Name Changes to this property will trigger replacement. string
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
Network Changes to this property will trigger replacement. string
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PscConfig ServiceConnectionPolicyPscConfig
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
PscConnections List<ServiceConnectionPolicyPscConnection>
Information about each Private Service Connect connection. Structure is documented below.
PulumiLabels Dictionary<string, string>
The combination of labels configured directly on the resource and default labels configured on the provider.
ServiceClass Changes to this property will trigger replacement. string
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
UpdateTime string
The timestamp when the resource was updated.
CreateTime string
The timestamp when the resource was created.
Description string
Free-text description of the resource.
EffectiveLabels map[string]string
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
Etag string
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
Infrastructure string
The type of underlying resources used to create the connection.
Labels map[string]string

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

Location Changes to this property will trigger replacement. string
The location of the ServiceConnectionPolicy.


Name Changes to this property will trigger replacement. string
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
Network Changes to this property will trigger replacement. string
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
PscConfig ServiceConnectionPolicyPscConfigArgs
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
PscConnections []ServiceConnectionPolicyPscConnectionArgs
Information about each Private Service Connect connection. Structure is documented below.
PulumiLabels map[string]string
The combination of labels configured directly on the resource and default labels configured on the provider.
ServiceClass Changes to this property will trigger replacement. string
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
UpdateTime string
The timestamp when the resource was updated.
createTime String
The timestamp when the resource was created.
description String
Free-text description of the resource.
effectiveLabels Map<String,String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
etag String
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
infrastructure String
The type of underlying resources used to create the connection.
labels Map<String,String>

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

location Changes to this property will trigger replacement. String
The location of the ServiceConnectionPolicy.


name Changes to this property will trigger replacement. String
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
network Changes to this property will trigger replacement. String
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pscConfig ServiceConnectionPolicyPscConfig
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
pscConnections List<ServiceConnectionPolicyPscConnection>
Information about each Private Service Connect connection. Structure is documented below.
pulumiLabels Map<String,String>
The combination of labels configured directly on the resource and default labels configured on the provider.
serviceClass Changes to this property will trigger replacement. String
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
updateTime String
The timestamp when the resource was updated.
createTime string
The timestamp when the resource was created.
description string
Free-text description of the resource.
effectiveLabels {[key: string]: string}
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
etag string
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
infrastructure string
The type of underlying resources used to create the connection.
labels {[key: string]: string}

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

location Changes to this property will trigger replacement. string
The location of the ServiceConnectionPolicy.


name Changes to this property will trigger replacement. string
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
network Changes to this property will trigger replacement. string
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pscConfig ServiceConnectionPolicyPscConfig
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
pscConnections ServiceConnectionPolicyPscConnection[]
Information about each Private Service Connect connection. Structure is documented below.
pulumiLabels {[key: string]: string}
The combination of labels configured directly on the resource and default labels configured on the provider.
serviceClass Changes to this property will trigger replacement. string
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
updateTime string
The timestamp when the resource was updated.
create_time str
The timestamp when the resource was created.
description str
Free-text description of the resource.
effective_labels Mapping[str, str]
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
etag str
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
infrastructure str
The type of underlying resources used to create the connection.
labels Mapping[str, str]

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

location Changes to this property will trigger replacement. str
The location of the ServiceConnectionPolicy.


name Changes to this property will trigger replacement. str
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
network Changes to this property will trigger replacement. str
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
psc_config ServiceConnectionPolicyPscConfigArgs
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
psc_connections Sequence[ServiceConnectionPolicyPscConnectionArgs]
Information about each Private Service Connect connection. Structure is documented below.
pulumi_labels Mapping[str, str]
The combination of labels configured directly on the resource and default labels configured on the provider.
service_class Changes to this property will trigger replacement. str
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
update_time str
The timestamp when the resource was updated.
createTime String
The timestamp when the resource was created.
description String
Free-text description of the resource.
effectiveLabels Map<String>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
etag String
The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
infrastructure String
The type of underlying resources used to create the connection.
labels Map<String>

User-defined labels.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

location Changes to this property will trigger replacement. String
The location of the ServiceConnectionPolicy.


name Changes to this property will trigger replacement. String
The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
network Changes to this property will trigger replacement. String
The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
pscConfig Property Map
Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. Structure is documented below.
pscConnections List<Property Map>
Information about each Private Service Connect connection. Structure is documented below.
pulumiLabels Map<String>
The combination of labels configured directly on the resource and default labels configured on the provider.
serviceClass Changes to this property will trigger replacement. String
The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
updateTime String
The timestamp when the resource was updated.

Supporting Types

ServiceConnectionPolicyPscConfig
, ServiceConnectionPolicyPscConfigArgs

Subnetworks This property is required. List<string>
IDs of the subnetworks or fully qualified identifiers for the subnetworks
Limit string
Max number of PSC connections for this policy.
Subnetworks This property is required. []string
IDs of the subnetworks or fully qualified identifiers for the subnetworks
Limit string
Max number of PSC connections for this policy.
subnetworks This property is required. List<String>
IDs of the subnetworks or fully qualified identifiers for the subnetworks
limit String
Max number of PSC connections for this policy.
subnetworks This property is required. string[]
IDs of the subnetworks or fully qualified identifiers for the subnetworks
limit string
Max number of PSC connections for this policy.
subnetworks This property is required. Sequence[str]
IDs of the subnetworks or fully qualified identifiers for the subnetworks
limit str
Max number of PSC connections for this policy.
subnetworks This property is required. List<String>
IDs of the subnetworks or fully qualified identifiers for the subnetworks
limit String
Max number of PSC connections for this policy.

ServiceConnectionPolicyPscConnection
, ServiceConnectionPolicyPscConnectionArgs

ConsumerAddress string
The resource reference of the consumer address.
ConsumerForwardingRule string
The resource reference of the PSC Forwarding Rule within the consumer VPC.
ConsumerTargetProject string
The project where the PSC connection is created.
Error ServiceConnectionPolicyPscConnectionError
The most recent error during operating this connection. Structure is documented below.
ErrorInfo ServiceConnectionPolicyPscConnectionErrorInfo
The error info for the latest error during operating this connection. Structure is documented below.
ErrorType string
The error type indicates whether the error is consumer facing, producer facing or system internal. Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE.
GceOperation string
The last Compute Engine operation to setup PSC connection.
PscConnectionId string
The PSC connection id of the PSC forwarding rule.
State string
The state of the PSC connection. Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED.
ConsumerAddress string
The resource reference of the consumer address.
ConsumerForwardingRule string
The resource reference of the PSC Forwarding Rule within the consumer VPC.
ConsumerTargetProject string
The project where the PSC connection is created.
Error ServiceConnectionPolicyPscConnectionError
The most recent error during operating this connection. Structure is documented below.
ErrorInfo ServiceConnectionPolicyPscConnectionErrorInfo
The error info for the latest error during operating this connection. Structure is documented below.
ErrorType string
The error type indicates whether the error is consumer facing, producer facing or system internal. Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE.
GceOperation string
The last Compute Engine operation to setup PSC connection.
PscConnectionId string
The PSC connection id of the PSC forwarding rule.
State string
The state of the PSC connection. Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED.
consumerAddress String
The resource reference of the consumer address.
consumerForwardingRule String
The resource reference of the PSC Forwarding Rule within the consumer VPC.
consumerTargetProject String
The project where the PSC connection is created.
error ServiceConnectionPolicyPscConnectionError
The most recent error during operating this connection. Structure is documented below.
errorInfo ServiceConnectionPolicyPscConnectionErrorInfo
The error info for the latest error during operating this connection. Structure is documented below.
errorType String
The error type indicates whether the error is consumer facing, producer facing or system internal. Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE.
gceOperation String
The last Compute Engine operation to setup PSC connection.
pscConnectionId String
The PSC connection id of the PSC forwarding rule.
state String
The state of the PSC connection. Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED.
consumerAddress string
The resource reference of the consumer address.
consumerForwardingRule string
The resource reference of the PSC Forwarding Rule within the consumer VPC.
consumerTargetProject string
The project where the PSC connection is created.
error ServiceConnectionPolicyPscConnectionError
The most recent error during operating this connection. Structure is documented below.
errorInfo ServiceConnectionPolicyPscConnectionErrorInfo
The error info for the latest error during operating this connection. Structure is documented below.
errorType string
The error type indicates whether the error is consumer facing, producer facing or system internal. Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE.
gceOperation string
The last Compute Engine operation to setup PSC connection.
pscConnectionId string
The PSC connection id of the PSC forwarding rule.
state string
The state of the PSC connection. Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED.
consumer_address str
The resource reference of the consumer address.
consumer_forwarding_rule str
The resource reference of the PSC Forwarding Rule within the consumer VPC.
consumer_target_project str
The project where the PSC connection is created.
error ServiceConnectionPolicyPscConnectionError
The most recent error during operating this connection. Structure is documented below.
error_info ServiceConnectionPolicyPscConnectionErrorInfo
The error info for the latest error during operating this connection. Structure is documented below.
error_type str
The error type indicates whether the error is consumer facing, producer facing or system internal. Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE.
gce_operation str
The last Compute Engine operation to setup PSC connection.
psc_connection_id str
The PSC connection id of the PSC forwarding rule.
state str
The state of the PSC connection. Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED.
consumerAddress String
The resource reference of the consumer address.
consumerForwardingRule String
The resource reference of the PSC Forwarding Rule within the consumer VPC.
consumerTargetProject String
The project where the PSC connection is created.
error Property Map
The most recent error during operating this connection. Structure is documented below.
errorInfo Property Map
The error info for the latest error during operating this connection. Structure is documented below.
errorType String
The error type indicates whether the error is consumer facing, producer facing or system internal. Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE.
gceOperation String
The last Compute Engine operation to setup PSC connection.
pscConnectionId String
The PSC connection id of the PSC forwarding rule.
state String
The state of the PSC connection. Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED.

ServiceConnectionPolicyPscConnectionError
, ServiceConnectionPolicyPscConnectionErrorArgs

Code int
The status code, which should be an enum value of [google.rpc.Code][].
Details List<ImmutableDictionary<string, string>>
(Output) A list of messages that carry the error details.
Message string
A developer-facing error message.
Code int
The status code, which should be an enum value of [google.rpc.Code][].
Details []map[string]string
(Output) A list of messages that carry the error details.
Message string
A developer-facing error message.
code Integer
The status code, which should be an enum value of [google.rpc.Code][].
details List<Map<String,String>>
(Output) A list of messages that carry the error details.
message String
A developer-facing error message.
code number
The status code, which should be an enum value of [google.rpc.Code][].
details {[key: string]: string}[]
(Output) A list of messages that carry the error details.
message string
A developer-facing error message.
code int
The status code, which should be an enum value of [google.rpc.Code][].
details Sequence[Mapping[str, str]]
(Output) A list of messages that carry the error details.
message str
A developer-facing error message.
code Number
The status code, which should be an enum value of [google.rpc.Code][].
details List<Map<String>>
(Output) A list of messages that carry the error details.
message String
A developer-facing error message.

ServiceConnectionPolicyPscConnectionErrorInfo
, ServiceConnectionPolicyPscConnectionErrorInfoArgs

Domain string
The logical grouping to which the "reason" belongs.
Metadata Dictionary<string, string>
Additional structured details about this error.
Reason string
The reason of the error.
Domain string
The logical grouping to which the "reason" belongs.
Metadata map[string]string
Additional structured details about this error.
Reason string
The reason of the error.
domain String
The logical grouping to which the "reason" belongs.
metadata Map<String,String>
Additional structured details about this error.
reason String
The reason of the error.
domain string
The logical grouping to which the "reason" belongs.
metadata {[key: string]: string}
Additional structured details about this error.
reason string
The reason of the error.
domain str
The logical grouping to which the "reason" belongs.
metadata Mapping[str, str]
Additional structured details about this error.
reason str
The reason of the error.
domain String
The logical grouping to which the "reason" belongs.
metadata Map<String>
Additional structured details about this error.
reason String
The reason of the error.

Import

ServiceConnectionPolicy can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}}

  • {{project}}/{{location}}/{{name}}

  • {{location}}/{{name}}

When using the pulumi import command, ServiceConnectionPolicy can be imported using one of the formats above. For example:

$ pulumi import gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy default projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}}
Copy
$ pulumi import gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy default {{project}}/{{location}}/{{name}}
Copy
$ pulumi import gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy default {{location}}/{{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.