1. Packages
  2. Packages
  3. Google Cloud (GCP) Classic
  4. API Docs
  5. compute
  6. getServiceAttachment
Viewing docs for Google Cloud v9.26.0
published on Tuesday, Jun 9, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v9.26.0
published on Tuesday, Jun 9, 2026 by Pulumi

    Get a specific service attachment within a region. For more information see the official documentation and API.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = gcp.compute.getServiceAttachment({
        project: "my-project",
        name: "my-service-attachment",
        region: "us-west2",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.compute.get_service_attachment(project="my-project",
        name="my-service-attachment",
        region="us-west2")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.LookupServiceAttachment(ctx, &compute.LookupServiceAttachmentArgs{
    			Project: pulumi.StringRef("my-project"),
    			Name:    "my-service-attachment",
    			Region:  pulumi.StringRef("us-west2"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = Gcp.Compute.GetServiceAttachment.Invoke(new()
        {
            Project = "my-project",
            Name = "my-service-attachment",
            Region = "us-west2",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.ComputeFunctions;
    import com.pulumi.gcp.compute.inputs.GetServiceAttachmentArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            final var default = ComputeFunctions.getServiceAttachment(GetServiceAttachmentArgs.builder()
                .project("my-project")
                .name("my-service-attachment")
                .region("us-west2")
                .build());
    
        }
    }
    
    variables:
      default:
        fn::invoke:
          function: gcp:compute:getServiceAttachment
          arguments:
            project: my-project
            name: my-service-attachment
            region: us-west2
    
    pulumi {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    data "gcp_compute_getserviceattachment" "default" {
      project = "my-project"
      name    = "my-service-attachment"
      region  = "us-west2"
    }
    

    Using getServiceAttachment

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getServiceAttachment(args: GetServiceAttachmentArgs, opts?: InvokeOptions): Promise<GetServiceAttachmentResult>
    function getServiceAttachmentOutput(args: GetServiceAttachmentOutputArgs, opts?: InvokeOptions): Output<GetServiceAttachmentResult>
    def get_service_attachment(name: Optional[str] = None,
                               project: Optional[str] = None,
                               region: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetServiceAttachmentResult
    def get_service_attachment_output(name: pulumi.Input[Optional[str]] = None,
                               project: pulumi.Input[Optional[str]] = None,
                               region: pulumi.Input[Optional[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetServiceAttachmentResult]
    func LookupServiceAttachment(ctx *Context, args *LookupServiceAttachmentArgs, opts ...InvokeOption) (*LookupServiceAttachmentResult, error)
    func LookupServiceAttachmentOutput(ctx *Context, args *LookupServiceAttachmentOutputArgs, opts ...InvokeOption) LookupServiceAttachmentResultOutput

    > Note: This function is named LookupServiceAttachment in the Go SDK.

    public static class GetServiceAttachment 
    {
        public static Task<GetServiceAttachmentResult> InvokeAsync(GetServiceAttachmentArgs args, InvokeOptions? opts = null)
        public static Output<GetServiceAttachmentResult> Invoke(GetServiceAttachmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServiceAttachmentResult> getServiceAttachment(GetServiceAttachmentArgs args, InvokeOptions options)
    public static Output<GetServiceAttachmentResult> getServiceAttachment(GetServiceAttachmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:compute/getServiceAttachment:getServiceAttachment
      arguments:
        # arguments dictionary
    data "gcp_compute_getserviceattachment" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    The name of the service attachment to retrieve.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    The region in which the service attachment resides. If it is not provided, the provider region is used.
    Name string
    The name of the service attachment to retrieve.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    The region in which the service attachment resides. If it is not provided, the provider region is used.
    name string
    The name of the service attachment to retrieve.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    The region in which the service attachment resides. If it is not provided, the provider region is used.
    name String
    The name of the service attachment to retrieve.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    The region in which the service attachment resides. If it is not provided, the provider region is used.
    name string
    The name of the service attachment to retrieve.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    The region in which the service attachment resides. If it is not provided, the provider region is used.
    name str
    The name of the service attachment to retrieve.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    The region in which the service attachment resides. If it is not provided, the provider region is used.
    name String
    The name of the service attachment to retrieve.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    The region in which the service attachment resides. If it is not provided, the provider region is used.

    getServiceAttachment Result

    The following output properties are available:

    Supporting Types

    GetServiceAttachmentConnectedEndpoint

    ConsumerNetwork string
    The url of the consumer network.
    Endpoint string
    The URL of the consumer forwarding rule.
    NatIps List<string>
    NOTE: This field is temporarily non-functional due to an underlying API issue. Any value provided here will be ignored until the API issue is resolved, expected around 2026-03. 'The nat IPs of the connected endpoint.'
    PropagatedConnectionCount int
    The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to.
    PscConnectionId string
    The PSC connection id of the connected endpoint.
    Status string
    The status of the connection from the consumer forwarding rule to this service attachment.
    ConsumerNetwork string
    The url of the consumer network.
    Endpoint string
    The URL of the consumer forwarding rule.
    NatIps []string
    NOTE: This field is temporarily non-functional due to an underlying API issue. Any value provided here will be ignored until the API issue is resolved, expected around 2026-03. 'The nat IPs of the connected endpoint.'
    PropagatedConnectionCount int
    The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to.
    PscConnectionId string
    The PSC connection id of the connected endpoint.
    Status string
    The status of the connection from the consumer forwarding rule to this service attachment.
    consumer_network string
    The url of the consumer network.
    endpoint string
    The URL of the consumer forwarding rule.
    nat_ips list(string)
    NOTE: This field is temporarily non-functional due to an underlying API issue. Any value provided here will be ignored until the API issue is resolved, expected around 2026-03. 'The nat IPs of the connected endpoint.'
    propagated_connection_count number
    The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to.
    psc_connection_id string
    The PSC connection id of the connected endpoint.
    status string
    The status of the connection from the consumer forwarding rule to this service attachment.
    consumerNetwork String
    The url of the consumer network.
    endpoint String
    The URL of the consumer forwarding rule.
    natIps List<String>
    NOTE: This field is temporarily non-functional due to an underlying API issue. Any value provided here will be ignored until the API issue is resolved, expected around 2026-03. 'The nat IPs of the connected endpoint.'
    propagatedConnectionCount Integer
    The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to.
    pscConnectionId String
    The PSC connection id of the connected endpoint.
    status String
    The status of the connection from the consumer forwarding rule to this service attachment.
    consumerNetwork string
    The url of the consumer network.
    endpoint string
    The URL of the consumer forwarding rule.
    natIps string[]
    NOTE: This field is temporarily non-functional due to an underlying API issue. Any value provided here will be ignored until the API issue is resolved, expected around 2026-03. 'The nat IPs of the connected endpoint.'
    propagatedConnectionCount number
    The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to.
    pscConnectionId string
    The PSC connection id of the connected endpoint.
    status string
    The status of the connection from the consumer forwarding rule to this service attachment.
    consumer_network str
    The url of the consumer network.
    endpoint str
    The URL of the consumer forwarding rule.
    nat_ips Sequence[str]
    NOTE: This field is temporarily non-functional due to an underlying API issue. Any value provided here will be ignored until the API issue is resolved, expected around 2026-03. 'The nat IPs of the connected endpoint.'
    propagated_connection_count int
    The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to.
    psc_connection_id str
    The PSC connection id of the connected endpoint.
    status str
    The status of the connection from the consumer forwarding rule to this service attachment.
    consumerNetwork String
    The url of the consumer network.
    endpoint String
    The URL of the consumer forwarding rule.
    natIps List<String>
    NOTE: This field is temporarily non-functional due to an underlying API issue. Any value provided here will be ignored until the API issue is resolved, expected around 2026-03. 'The nat IPs of the connected endpoint.'
    propagatedConnectionCount Number
    The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to.
    pscConnectionId String
    The PSC connection id of the connected endpoint.
    status String
    The status of the connection from the consumer forwarding rule to this service attachment.

    GetServiceAttachmentConsumerAcceptList

    ConnectionLimit int
    The number of consumer forwarding rules the consumer project can create.
    EndpointUrl string
    The endpoint that is allowed to connect to this service attachment. Only one of project_id_or_num, networkUrl and endpointUrl may be set.
    NetworkUrl string
    The network that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    ProjectIdOrNum string
    A project that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    ConnectionLimit int
    The number of consumer forwarding rules the consumer project can create.
    EndpointUrl string
    The endpoint that is allowed to connect to this service attachment. Only one of project_id_or_num, networkUrl and endpointUrl may be set.
    NetworkUrl string
    The network that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    ProjectIdOrNum string
    A project that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    connection_limit number
    The number of consumer forwarding rules the consumer project can create.
    endpoint_url string
    The endpoint that is allowed to connect to this service attachment. Only one of project_id_or_num, networkUrl and endpointUrl may be set.
    network_url string
    The network that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    project_id_or_num string
    A project that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    connectionLimit Integer
    The number of consumer forwarding rules the consumer project can create.
    endpointUrl String
    The endpoint that is allowed to connect to this service attachment. Only one of project_id_or_num, networkUrl and endpointUrl may be set.
    networkUrl String
    The network that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    projectIdOrNum String
    A project that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    connectionLimit number
    The number of consumer forwarding rules the consumer project can create.
    endpointUrl string
    The endpoint that is allowed to connect to this service attachment. Only one of project_id_or_num, networkUrl and endpointUrl may be set.
    networkUrl string
    The network that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    projectIdOrNum string
    A project that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    connection_limit int
    The number of consumer forwarding rules the consumer project can create.
    endpoint_url str
    The endpoint that is allowed to connect to this service attachment. Only one of project_id_or_num, networkUrl and endpointUrl may be set.
    network_url str
    The network that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    project_id_or_num str
    A project that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    connectionLimit Number
    The number of consumer forwarding rules the consumer project can create.
    endpointUrl String
    The endpoint that is allowed to connect to this service attachment. Only one of project_id_or_num, networkUrl and endpointUrl may be set.
    networkUrl String
    The network that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.
    projectIdOrNum String
    A project that is allowed to connect to this service attachment. Only one of projectIdOrNum and networkUrl may be set.

    GetServiceAttachmentPscServiceAttachmentId

    High string
    The high 64 bits of the PSC service attachment ID.
    Low string
    The low 64 bits of the PSC service attachment ID.
    High string
    The high 64 bits of the PSC service attachment ID.
    Low string
    The low 64 bits of the PSC service attachment ID.
    high string
    The high 64 bits of the PSC service attachment ID.
    low string
    The low 64 bits of the PSC service attachment ID.
    high String
    The high 64 bits of the PSC service attachment ID.
    low String
    The low 64 bits of the PSC service attachment ID.
    high string
    The high 64 bits of the PSC service attachment ID.
    low string
    The low 64 bits of the PSC service attachment ID.
    high str
    The high 64 bits of the PSC service attachment ID.
    low str
    The low 64 bits of the PSC service attachment ID.
    high String
    The high 64 bits of the PSC service attachment ID.
    low String
    The low 64 bits of the PSC service attachment ID.

    GetServiceAttachmentTunnelingConfig

    EncapsulationProfile string
    The encapsulation profile for tunneling traffic.
    RoutingMode string
    The routing mode for tunneling traffic.
    EncapsulationProfile string
    The encapsulation profile for tunneling traffic.
    RoutingMode string
    The routing mode for tunneling traffic.
    encapsulation_profile string
    The encapsulation profile for tunneling traffic.
    routing_mode string
    The routing mode for tunneling traffic.
    encapsulationProfile String
    The encapsulation profile for tunneling traffic.
    routingMode String
    The routing mode for tunneling traffic.
    encapsulationProfile string
    The encapsulation profile for tunneling traffic.
    routingMode string
    The routing mode for tunneling traffic.
    encapsulation_profile str
    The encapsulation profile for tunneling traffic.
    routing_mode str
    The routing mode for tunneling traffic.
    encapsulationProfile String
    The encapsulation profile for tunneling traffic.
    routingMode String
    The routing mode for tunneling traffic.

    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.
    gcp logo
    Viewing docs for Google Cloud v9.26.0
    published on Tuesday, Jun 9, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial