All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.networkservices.kotlin.ServiceBindingArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.networkservices.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.networkservices.ServiceBindingArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * ### Network Services Service Binding Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.servicedirectory.Namespace("default", {
 *     namespaceId: "my-namespace",
 *     location: "us-central1",
 * });
 * const defaultService = new gcp.servicedirectory.Service("default", {
 *     serviceId: "my-service",
 *     namespace: _default.id,
 *     metadata: {
 *         stage: "prod",
 *         region: "us-central1",
 *     },
 * });
 * const defaultServiceBinding = new gcp.networkservices.ServiceBinding("default", {
 *     name: "my-service-binding",
 *     labels: {
 *         foo: "bar",
 *     },
 *     description: "my description",
 *     service: defaultService.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.servicedirectory.Namespace("default",
 *     namespace_id="my-namespace",
 *     location="us-central1")
 * default_service = gcp.servicedirectory.Service("default",
 *     service_id="my-service",
 *     namespace=default.id,
 *     metadata={
 *         "stage": "prod",
 *         "region": "us-central1",
 *     })
 * default_service_binding = gcp.networkservices.ServiceBinding("default",
 *     name="my-service-binding",
 *     labels={
 *         "foo": "bar",
 *     },
 *     description="my description",
 *     service=default_service.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.ServiceDirectory.Namespace("default", new()
 *     {
 *         NamespaceId = "my-namespace",
 *         Location = "us-central1",
 *     });
 *     var defaultService = new Gcp.ServiceDirectory.Service("default", new()
 *     {
 *         ServiceId = "my-service",
 *         Namespace = @default.Id,
 *         Metadata =
 *         {
 *             { "stage", "prod" },
 *             { "region", "us-central1" },
 *         },
 *     });
 *     var defaultServiceBinding = new Gcp.NetworkServices.ServiceBinding("default", new()
 *     {
 *         Name = "my-service-binding",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Description = "my description",
 *         Service = defaultService.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicedirectory"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := servicedirectory.NewNamespace(ctx, "default", &servicedirectory.NamespaceArgs{
 * 			NamespaceId: pulumi.String("my-namespace"),
 * 			Location:    pulumi.String("us-central1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultService, err := servicedirectory.NewService(ctx, "default", &servicedirectory.ServiceArgs{
 * 			ServiceId: pulumi.String("my-service"),
 * 			Namespace: _default.ID(),
 * 			Metadata: pulumi.StringMap{
 * 				"stage":  pulumi.String("prod"),
 * 				"region": pulumi.String("us-central1"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkservices.NewServiceBinding(ctx, "default", &networkservices.ServiceBindingArgs{
 * 			Name: pulumi.String("my-service-binding"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Description: pulumi.String("my description"),
 * 			Service:     defaultService.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.servicedirectory.Namespace;
 * import com.pulumi.gcp.servicedirectory.NamespaceArgs;
 * import com.pulumi.gcp.servicedirectory.Service;
 * import com.pulumi.gcp.servicedirectory.ServiceArgs;
 * import com.pulumi.gcp.networkservices.ServiceBinding;
 * import com.pulumi.gcp.networkservices.ServiceBindingArgs;
 * 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 default_ = new Namespace("default", NamespaceArgs.builder()
 *             .namespaceId("my-namespace")
 *             .location("us-central1")
 *             .build());
 *         var defaultService = new Service("defaultService", ServiceArgs.builder()
 *             .serviceId("my-service")
 *             .namespace(default_.id())
 *             .metadata(Map.ofEntries(
 *                 Map.entry("stage", "prod"),
 *                 Map.entry("region", "us-central1")
 *             ))
 *             .build());
 *         var defaultServiceBinding = new ServiceBinding("defaultServiceBinding", ServiceBindingArgs.builder()
 *             .name("my-service-binding")
 *             .labels(Map.of("foo", "bar"))
 *             .description("my description")
 *             .service(defaultService.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:servicedirectory:Namespace
 *     properties:
 *       namespaceId: my-namespace
 *       location: us-central1
 *   defaultService:
 *     type: gcp:servicedirectory:Service
 *     name: default
 *     properties:
 *       serviceId: my-service
 *       namespace: ${default.id}
 *       metadata:
 *         stage: prod
 *         region: us-central1
 *   defaultServiceBinding:
 *     type: gcp:networkservices:ServiceBinding
 *     name: default
 *     properties:
 *       name: my-service-binding
 *       labels:
 *         foo: bar
 *       description: my description
 *       service: ${defaultService.id}
 * ```
 * 
 * ## Import
 * ServiceBinding can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/serviceBindings/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, ServiceBinding can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networkservices/serviceBinding:ServiceBinding default projects/{{project}}/locations/global/serviceBindings/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/serviceBinding:ServiceBinding default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/serviceBinding:ServiceBinding default {{name}}
 * ```
 * @property description A free-text description of the resource. Max length 1024 characters.
 * @property labels Set of label tags associated with the ServiceBinding resource.
 * **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.
 * @property name Name of the ServiceBinding resource.
 * - - -
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property service The full Service Directory Service name of the format
 * projects/*/locations/*/namespaces/*/services/*
 * */*/*/*/
 */
public data class ServiceBindingArgs(
    public val description: Output? = null,
    public val labels: Output>? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val service: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkservices.ServiceBindingArgs =
        com.pulumi.gcp.networkservices.ServiceBindingArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .service(service?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ServiceBindingArgs].
 */
@PulumiTagMarker
public class ServiceBindingArgsBuilder internal constructor() {
    private var description: Output? = null

    private var labels: Output>? = null

    private var name: Output? = null

    private var project: Output? = null

    private var service: Output? = null

    /**
     * @param value A free-text description of the resource. Max length 1024 characters.
     */
    @JvmName("fkaxbatuxttxerrt")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Set of label tags associated with the ServiceBinding resource.
     * **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.
     */
    @JvmName("wuerokcmjrvlbwti")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value Name of the ServiceBinding resource.
     * - - -
     */
    @JvmName("wpmnsqrycdfjjgmo")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("apvxaovifoqgxwpg")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The full Service Directory Service name of the format
     * projects/*/locations/*/namespaces/*/services/*
     * */*/*/*/
     */
    @JvmName("voexpboieavqdvss")
    public suspend fun service(`value`: Output) {
        this.service = value
    }

    /**
     * @param value A free-text description of the resource. Max length 1024 characters.
     */
    @JvmName("arptwrmfigghdoms")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Set of label tags associated with the ServiceBinding resource.
     * **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.
     */
    @JvmName("wbbgyrcolpxiepyx")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Set of label tags associated with the ServiceBinding resource.
     * **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.
     */
    @JvmName("ifgirgrnpiwmyngu")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value Name of the ServiceBinding resource.
     * - - -
     */
    @JvmName("wojloeojnoasafxg")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("hxfsmdicdnckbhvn")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The full Service Directory Service name of the format
     * projects/*/locations/*/namespaces/*/services/*
     * */*/*/*/
     */
    @JvmName("xdummclajratmkct")
    public suspend fun service(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.service = mapped
    }

    internal fun build(): ServiceBindingArgs = ServiceBindingArgs(
        description = description,
        labels = labels,
        name = name,
        project = project,
        service = service,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy