Google Cloud v8.39.0 published on Tuesday, Jul 22, 2025 by Pulumi
gcp.compute.getNetworkAttachment
Explore with Pulumi AI
Get a specific network 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.getNetworkAttachment({
project: "my-project",
name: "my-network-attachment",
region: "europe-west1",
});
import pulumi
import pulumi_gcp as gcp
default = gcp.compute.get_network_attachment(project="my-project",
name="my-network-attachment",
region="europe-west1")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.LookupNetworkAttachment(ctx, &compute.LookupNetworkAttachmentArgs{
Project: pulumi.StringRef("my-project"),
Name: "my-network-attachment",
Region: "europe-west1",
}, 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.GetNetworkAttachment.Invoke(new()
{
Project = "my-project",
Name = "my-network-attachment",
Region = "europe-west1",
});
});
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.GetNetworkAttachmentArgs;
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) {
final var default = ComputeFunctions.getNetworkAttachment(GetNetworkAttachmentArgs.builder()
.project("my-project")
.name("my-network-attachment")
.region("europe-west1")
.build());
}
}
variables:
default:
fn::invoke:
function: gcp:compute:getNetworkAttachment
arguments:
project: my-project
name: my-network-attachment
region: europe-west1
Using getNetworkAttachment
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 getNetworkAttachment(args: GetNetworkAttachmentArgs, opts?: InvokeOptions): Promise<GetNetworkAttachmentResult>
function getNetworkAttachmentOutput(args: GetNetworkAttachmentOutputArgs, opts?: InvokeOptions): Output<GetNetworkAttachmentResult>
def get_network_attachment(name: Optional[str] = None,
project: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNetworkAttachmentResult
def get_network_attachment_output(name: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNetworkAttachmentResult]
func LookupNetworkAttachment(ctx *Context, args *LookupNetworkAttachmentArgs, opts ...InvokeOption) (*LookupNetworkAttachmentResult, error)
func LookupNetworkAttachmentOutput(ctx *Context, args *LookupNetworkAttachmentOutputArgs, opts ...InvokeOption) LookupNetworkAttachmentResultOutput
> Note: This function is named LookupNetworkAttachment
in the Go SDK.
public static class GetNetworkAttachment
{
public static Task<GetNetworkAttachmentResult> InvokeAsync(GetNetworkAttachmentArgs args, InvokeOptions? opts = null)
public static Output<GetNetworkAttachmentResult> Invoke(GetNetworkAttachmentInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNetworkAttachmentResult> getNetworkAttachment(GetNetworkAttachmentArgs args, InvokeOptions options)
public static Output<GetNetworkAttachmentResult> getNetworkAttachment(GetNetworkAttachmentArgs args, InvokeOptions options)
fn::invoke:
function: gcp:compute/getNetworkAttachment:getNetworkAttachment
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- The name of the network attachment to retrieve. The name must be unique within the region.
- Region string
- The region in which the network attachment resides.
For example,
europe-west1
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Name string
- The name of the network attachment to retrieve. The name must be unique within the region.
- Region string
- The region in which the network attachment resides.
For example,
europe-west1
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- name String
- The name of the network attachment to retrieve. The name must be unique within the region.
- region String
- The region in which the network attachment resides.
For example,
europe-west1
. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- name string
- The name of the network attachment to retrieve. The name must be unique within the region.
- region string
- The region in which the network attachment resides.
For example,
europe-west1
. - project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- name str
- The name of the network attachment to retrieve. The name must be unique within the region.
- region str
- The region in which the network attachment resides.
For example,
europe-west1
. - project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- name String
- The name of the network attachment to retrieve. The name must be unique within the region.
- region String
- The region in which the network attachment resides.
For example,
europe-west1
. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
getNetworkAttachment Result
The following output properties are available:
- Connection
Endpoints List<GetNetwork Attachment Connection Endpoint> - Connection
Preference string - Creation
Timestamp string - Description string
- Fingerprint string
- Id string
- Kind string
- Name string
- Network string
- Producer
Accept List<string>Lists - Producer
Reject List<string>Lists - Region string
- Self
Link string - Self
Link stringWith Id - Subnetworks List<string>
- Project string
- Connection
Endpoints []GetNetwork Attachment Connection Endpoint - Connection
Preference string - Creation
Timestamp string - Description string
- Fingerprint string
- Id string
- Kind string
- Name string
- Network string
- Producer
Accept []stringLists - Producer
Reject []stringLists - Region string
- Self
Link string - Self
Link stringWith Id - Subnetworks []string
- Project string
- connection
Endpoints List<GetNetwork Attachment Connection Endpoint> - connection
Preference String - creation
Timestamp String - description String
- fingerprint String
- id String
- kind String
- name String
- network String
- producer
Accept List<String>Lists - producer
Reject List<String>Lists - region String
- self
Link String - self
Link StringWith Id - subnetworks List<String>
- project String
- connection
Endpoints GetNetwork Attachment Connection Endpoint[] - connection
Preference string - creation
Timestamp string - description string
- fingerprint string
- id string
- kind string
- name string
- network string
- producer
Accept string[]Lists - producer
Reject string[]Lists - region string
- self
Link string - self
Link stringWith Id - subnetworks string[]
- project string
- connection_
endpoints Sequence[GetNetwork Attachment Connection Endpoint] - connection_
preference str - creation_
timestamp str - description str
- fingerprint str
- id str
- kind str
- name str
- network str
- producer_
accept_ Sequence[str]lists - producer_
reject_ Sequence[str]lists - region str
- self_
link str - self_
link_ strwith_ id - subnetworks Sequence[str]
- project str
- connection
Endpoints List<Property Map> - connection
Preference String - creation
Timestamp String - description String
- fingerprint String
- id String
- kind String
- name String
- network String
- producer
Accept List<String>Lists - producer
Reject List<String>Lists - region String
- self
Link String - self
Link StringWith Id - subnetworks List<String>
- project String
Supporting Types
GetNetworkAttachmentConnectionEndpoint
- Ip
Address string - The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
- Project
Id stringOr Num - The project id or number of the interface to which the IP was assigned.
- Secondary
Ip stringCidr Ranges - Alias IP ranges from the same subnetwork.
- Status string
- The status of a connected endpoint to this network attachment.
- Subnetwork string
- The subnetwork used to assign the IP to the producer instance network interface.
- Ip
Address string - The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
- Project
Id stringOr Num - The project id or number of the interface to which the IP was assigned.
- Secondary
Ip stringCidr Ranges - Alias IP ranges from the same subnetwork.
- Status string
- The status of a connected endpoint to this network attachment.
- Subnetwork string
- The subnetwork used to assign the IP to the producer instance network interface.
- ip
Address String - The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
- project
Id StringOr Num - The project id or number of the interface to which the IP was assigned.
- secondary
Ip StringCidr Ranges - Alias IP ranges from the same subnetwork.
- status String
- The status of a connected endpoint to this network attachment.
- subnetwork String
- The subnetwork used to assign the IP to the producer instance network interface.
- ip
Address string - The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
- project
Id stringOr Num - The project id or number of the interface to which the IP was assigned.
- secondary
Ip stringCidr Ranges - Alias IP ranges from the same subnetwork.
- status string
- The status of a connected endpoint to this network attachment.
- subnetwork string
- The subnetwork used to assign the IP to the producer instance network interface.
- ip_
address str - The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
- project_
id_ stror_ num - The project id or number of the interface to which the IP was assigned.
- secondary_
ip_ strcidr_ ranges - Alias IP ranges from the same subnetwork.
- status str
- The status of a connected endpoint to this network attachment.
- subnetwork str
- The subnetwork used to assign the IP to the producer instance network interface.
- ip
Address String - The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless.
- project
Id StringOr Num - The project id or number of the interface to which the IP was assigned.
- secondary
Ip StringCidr Ranges - Alias IP ranges from the same subnetwork.
- status String
- The status of a connected endpoint to this network attachment.
- subnetwork String
- The subnetwork used to assign the IP to the producer instance network interface.
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.