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

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

    public var args: ProjectDefaultNetworkTierArgs = ProjectDefaultNetworkTierArgs()

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

/**
 * Configures the Google Compute Engine
 * [Default Network Tier](https://cloud.google.com/network-tiers/docs/using-network-service-tiers#setting_the_tier_for_all_resources_in_a_project)
 * for a project.
 * For more information, see,
 * [the Project API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/projects/setDefaultNetworkTier).
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.compute.ProjectDefaultNetworkTier("default", {networkTier: "PREMIUM"});
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.compute.ProjectDefaultNetworkTier("default", network_tier="PREMIUM")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Compute.ProjectDefaultNetworkTier("default", new()
 *     {
 *         NetworkTier = "PREMIUM",
 *     });
 * });
 * ```
 * ```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.NewProjectDefaultNetworkTier(ctx, "default", &compute.ProjectDefaultNetworkTierArgs{
 * 			NetworkTier: pulumi.String("PREMIUM"),
 * 		})
 * 		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.ProjectDefaultNetworkTier;
 * import com.pulumi.gcp.compute.ProjectDefaultNetworkTierArgs;
 * 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 ProjectDefaultNetworkTier("default", ProjectDefaultNetworkTierArgs.builder()
 *             .networkTier("PREMIUM")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:ProjectDefaultNetworkTier
 *     properties:
 *       networkTier: PREMIUM
 * ```
 * 
 * ## Import
 * Compute Engine Default Network Tier can be imported using any of these accepted formats:
 * * `{{project_id}}`
 * When using the `pulumi import` command, Compute Engine Default Network Tier can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/projectDefaultNetworkTier:ProjectDefaultNetworkTier default {{project_id}}
 * ```
 */
public class ProjectDefaultNetworkTier internal constructor(
    override val javaResource: com.pulumi.gcp.compute.ProjectDefaultNetworkTier,
) : KotlinCustomResource(javaResource, ProjectDefaultNetworkTierMapper) {
    /**
     * The default network tier to be configured for the project.
     * This field can take the following values: `PREMIUM` or `STANDARD`.
     * - - -
     */
    public val networkTier: Output
        get() = javaResource.networkTier().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 })
}

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy