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

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

    public var args: VpcscConfigArgs = VpcscConfigArgs()

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

/**
 * ## Example Usage
 * ### Artifact Registry Vpcsc Config
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const my_config = new gcp.artifactregistry.VpcscConfig("my-config", {
 *     location: "us-central1",
 *     vpcscPolicy: "ALLOW",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * my_config = gcp.artifactregistry.VpcscConfig("my-config",
 *     location="us-central1",
 *     vpcsc_policy="ALLOW")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var my_config = new Gcp.ArtifactRegistry.VpcscConfig("my-config", new()
 *     {
 *         Location = "us-central1",
 *         VpcscPolicy = "ALLOW",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/artifactregistry"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := artifactregistry.NewVpcscConfig(ctx, "my-config", &artifactregistry.VpcscConfigArgs{
 * 			Location:    pulumi.String("us-central1"),
 * 			VpcscPolicy: pulumi.String("ALLOW"),
 * 		})
 * 		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.artifactregistry.VpcscConfig;
 * import com.pulumi.gcp.artifactregistry.VpcscConfigArgs;
 * 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 my_config = new VpcscConfig("my-config", VpcscConfigArgs.builder()
 *             .location("us-central1")
 *             .vpcscPolicy("ALLOW")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   my-config:
 *     type: gcp:artifactregistry:VpcscConfig
 *     properties:
 *       location: us-central1
 *       vpcscPolicy: ALLOW
 * ```
 * 
 * ## Import
 * VPCSCConfig can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/vpcscConfig/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, VPCSCConfig can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:artifactregistry/vpcscConfig:VpcscConfig default projects/{{project}}/locations/{{location}}/vpcscConfig/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:artifactregistry/vpcscConfig:VpcscConfig default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:artifactregistry/vpcscConfig:VpcscConfig default {{location}}/{{name}}
 * ```
 */
public class VpcscConfig internal constructor(
    override val javaResource: com.pulumi.gcp.artifactregistry.VpcscConfig,
) : KotlinCustomResource(javaResource, VpcscConfigMapper) {
    /**
     * The name of the location this config is located in.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The name of the project's VPC SC Config.
     * Always of the form: projects/{project}/location/{location}/vpcscConfig
     */
    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 VPC SC policy for project and location.
     * Possible values are: `DENY`, `ALLOW`.
     */
    public val vpcscPolicy: Output?
        get() = javaResource.vpcscPolicy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object VpcscConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.artifactregistry.VpcscConfig::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy