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

com.pulumi.gcp.compute.kotlin.PublicAdvertisedPrefix.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.compute.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 [PublicAdvertisedPrefix].
 */
@PulumiTagMarker
public class PublicAdvertisedPrefixResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: PublicAdvertisedPrefixArgs = PublicAdvertisedPrefixArgs()

    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 PublicAdvertisedPrefixArgsBuilder.() -> Unit) {
        val builder = PublicAdvertisedPrefixArgsBuilder()
        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(): PublicAdvertisedPrefix {
        val builtJavaResource = com.pulumi.gcp.compute.PublicAdvertisedPrefix(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return PublicAdvertisedPrefix(builtJavaResource)
    }
}

/**
 * Represents a PublicAdvertisedPrefix for use with bring your own IP addresses (BYOIP).
 * To get more information about PublicAdvertisedPrefix, see:
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/publicAdvertisedPrefixes)
 * * How-to Guides
 *     * [Using bring your own IP](https://cloud.google.com/vpc/docs/using-bring-your-own-ip)
 * ## Example Usage
 * ### Public Advertised Prefixes Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const prefixes = new gcp.compute.PublicAdvertisedPrefix("prefixes", {
 *     name: "my-prefix",
 *     description: "description",
 *     dnsVerificationIp: "127.127.0.0",
 *     ipCidrRange: "127.127.0.0/16",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * prefixes = gcp.compute.PublicAdvertisedPrefix("prefixes",
 *     name="my-prefix",
 *     description="description",
 *     dns_verification_ip="127.127.0.0",
 *     ip_cidr_range="127.127.0.0/16")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var prefixes = new Gcp.Compute.PublicAdvertisedPrefix("prefixes", new()
 *     {
 *         Name = "my-prefix",
 *         Description = "description",
 *         DnsVerificationIp = "127.127.0.0",
 *         IpCidrRange = "127.127.0.0/16",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := compute.NewPublicAdvertisedPrefix(ctx, "prefixes", &compute.PublicAdvertisedPrefixArgs{
 * 			Name:              pulumi.String("my-prefix"),
 * 			Description:       pulumi.String("description"),
 * 			DnsVerificationIp: pulumi.String("127.127.0.0"),
 * 			IpCidrRange:       pulumi.String("127.127.0.0/16"),
 * 		})
 * 		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.compute.PublicAdvertisedPrefix;
 * import com.pulumi.gcp.compute.PublicAdvertisedPrefixArgs;
 * 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 prefixes = new PublicAdvertisedPrefix("prefixes", PublicAdvertisedPrefixArgs.builder()
 *             .name("my-prefix")
 *             .description("description")
 *             .dnsVerificationIp("127.127.0.0")
 *             .ipCidrRange("127.127.0.0/16")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   prefixes:
 *     type: gcp:compute:PublicAdvertisedPrefix
 *     properties:
 *       name: my-prefix
 *       description: description
 *       dnsVerificationIp: 127.127.0.0
 *       ipCidrRange: 127.127.0.0/16
 * ```
 * 
 * ## Import
 * PublicAdvertisedPrefix can be imported using any of these accepted formats:
 * * `projects/{{project}}/global/publicAdvertisedPrefixes/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, PublicAdvertisedPrefix can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/publicAdvertisedPrefix:PublicAdvertisedPrefix default projects/{{project}}/global/publicAdvertisedPrefixes/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/publicAdvertisedPrefix:PublicAdvertisedPrefix default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/publicAdvertisedPrefix:PublicAdvertisedPrefix default {{name}}
 * ```
 */
public class PublicAdvertisedPrefix internal constructor(
    override val javaResource: com.pulumi.gcp.compute.PublicAdvertisedPrefix,
) : KotlinCustomResource(javaResource, PublicAdvertisedPrefixMapper) {
    /**
     * An optional description of this resource.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The IPv4 address to be used for reverse DNS verification.
     */
    public val dnsVerificationIp: Output
        get() = javaResource.dnsVerificationIp().applyValue({ args0 -> args0 })

    /**
     * The IPv4 address range, in CIDR format, represented by this public advertised prefix.
     * - - -
     */
    public val ipCidrRange: Output
        get() = javaResource.ipCidrRange().applyValue({ args0 -> args0 })

    /**
     * Name of the resource. The name must be 1-63 characters long, and
     * comply with RFC1035. Specifically, the name must be 1-63 characters
     * long and match the regular expression `a-z?`
     * which means the first character must be a lowercase letter, and all
     * following characters must be a dash, lowercase letter, or digit,
     * except the last character, which cannot be a dash.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The URI of the created resource.
     */
    public val selfLink: Output
        get() = javaResource.selfLink().applyValue({ args0 -> args0 })
}

public object PublicAdvertisedPrefixMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.compute.PublicAdvertisedPrefix::class == javaResource::class

    override fun map(javaResource: Resource): PublicAdvertisedPrefix =
        PublicAdvertisedPrefix(javaResource as com.pulumi.gcp.compute.PublicAdvertisedPrefix)
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy