getServiceAttachment function
Future<GetServiceAttachmentResult>
getServiceAttachment(
- GetServiceAttachmentArgs args, {
- InvokeOptions? options,
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")
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 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
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
data "gcp_compute_getserviceattachment" "default" {
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
args Arguments passed to this invoke. Arguments for getServiceAttachment.
options Invoke options controlling this call.
Implementation
Future<GetServiceAttachmentResult> getServiceAttachment(
GetServiceAttachmentArgs args, {
pulumi.InvokeOptions? options,
}) async {
final deployment = pulumi.Deployment.instance;
final result = await deployment.invoke<Map<String, dynamic>>(
'gcp:compute/getServiceAttachment:getServiceAttachment',
args.toMap(),
options: pulumi.toDeploymentInvokeOptions(options),
);
return GetServiceAttachmentResult.fromMap(result);
}