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

com.pulumi.gcp.servicenetworking.kotlin.PeeredDnsDomain.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.servicenetworking.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [PeeredDnsDomain].
 */
@PulumiTagMarker
public class PeeredDnsDomainResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: PeeredDnsDomainArgs = PeeredDnsDomainArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend PeeredDnsDomainArgsBuilder.() -> Unit) {
        val builder = PeeredDnsDomainArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): PeeredDnsDomain {
        val builtJavaResource =
            com.pulumi.gcp.servicenetworking.PeeredDnsDomain(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return PeeredDnsDomain(builtJavaResource)
    }
}

/**
 * Allows management of a single peered DNS domain for an existing Google Cloud Platform project.
 * When using Google Cloud DNS to manage internal DNS, create peered DNS domains to make your DNS available to services like Google Cloud Build.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const name = new gcp.servicenetworking.PeeredDnsDomain("name", {
 *     project: "10000000",
 *     name: "example-com",
 *     network: "default",
 *     dnsSuffix: "example.com.",
 *     service: "peering-service",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * name = gcp.servicenetworking.PeeredDnsDomain("name",
 *     project="10000000",
 *     name="example-com",
 *     network="default",
 *     dns_suffix="example.com.",
 *     service="peering-service")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var name = new Gcp.ServiceNetworking.PeeredDnsDomain("name", new()
 *     {
 *         Project = "10000000",
 *         Name = "example-com",
 *         Network = "default",
 *         DnsSuffix = "example.com.",
 *         Service = "peering-service",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicenetworking"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := servicenetworking.NewPeeredDnsDomain(ctx, "name", &servicenetworking.PeeredDnsDomainArgs{
 * 			Project:   pulumi.String("10000000"),
 * 			Name:      pulumi.String("example-com"),
 * 			Network:   pulumi.String("default"),
 * 			DnsSuffix: pulumi.String("example.com."),
 * 			Service:   pulumi.String("peering-service"),
 * 		})
 * 		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.servicenetworking.PeeredDnsDomain;
 * import com.pulumi.gcp.servicenetworking.PeeredDnsDomainArgs;
 * 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 name = new PeeredDnsDomain("name", PeeredDnsDomainArgs.builder()
 *             .project(10000000)
 *             .name("example-com")
 *             .network("default")
 *             .dnsSuffix("example.com.")
 *             .service("peering-service")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   name:
 *     type: gcp:servicenetworking:PeeredDnsDomain
 *     properties:
 *       project: 1e+07
 *       name: example-com
 *       network: default
 *       dnsSuffix: example.com.
 *       service: peering-service
 * ```
 * 
 * ## Import
 * Project peered DNS domains can be imported using the `service`, `project`, `network` and `name`, where:
 * - `service` is the service connection, defaults to `servicenetworking.googleapis.com`.
 * - `project` is the producer project name.
 * - `network` is the consumer network name.
 * - `name` is the name of your peered DNS domain.
 * * `services/{service}/projects/{project}/global/networks/{network}/peeredDnsDomains/{name}`
 * When using the `pulumi import` command, project peered DNS domains can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:servicenetworking/peeredDnsDomain:PeeredDnsDomain default services/{service}/projects/{project}/global/networks/{network}/peeredDnsDomains/{name}
 * ```
 */
public class PeeredDnsDomain internal constructor(
    override val javaResource: com.pulumi.gcp.servicenetworking.PeeredDnsDomain,
) : KotlinCustomResource(javaResource, PeeredDnsDomainMapper) {
    /**
     * The DNS domain suffix of the peered DNS domain. Make sure to suffix with a `.` (dot).
     */
    public val dnsSuffix: Output
        get() = javaResource.dnsSuffix().applyValue({ args0 -> args0 })

    /**
     * Internal name used for the peered DNS domain.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The network in the consumer project.
     */
    public val network: Output
        get() = javaResource.network().applyValue({ args0 -> args0 })

    /**
     * an identifier for the resource with format `services/{{service}}/projects/{{project}}/global/networks/{{network}}`
     */
    public val parent: Output
        get() = javaResource.parent().applyValue({ args0 -> args0 })

    /**
     * The producer project number. If not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Private service connection between service and consumer network, defaults to `servicenetworking.googleapis.com`
     */
    public val service: Output?
        get() = javaResource.service().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

public object PeeredDnsDomainMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.servicenetworking.PeeredDnsDomain::class == javaResource::class

    override fun map(javaResource: Resource): PeeredDnsDomain = PeeredDnsDomain(
        javaResource as
            com.pulumi.gcp.servicenetworking.PeeredDnsDomain,
    )
}

/**
 * @see [PeeredDnsDomain].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [PeeredDnsDomain].
 */
public suspend fun peeredDnsDomain(
    name: String,
    block: suspend PeeredDnsDomainResourceBuilder.() -> Unit,
): PeeredDnsDomain {
    val builder = PeeredDnsDomainResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [PeeredDnsDomain].
 * @param name The _unique_ name of the resulting resource.
 */
public fun peeredDnsDomain(name: String): PeeredDnsDomain {
    val builder = PeeredDnsDomainResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy