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

com.pulumi.gcp.container.kotlin.RegistryArgs.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.container.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.container.RegistryArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Ensures that the Google Cloud Storage bucket that backs Google Container Registry exists. Creating this resource will create the backing bucket if it does not exist, or do nothing if the bucket already exists. Destroying this resource does *NOT* destroy the backing bucket. For more information see [the official documentation](https://cloud.google.com/container-registry/docs/overview)
 * This resource can be used to ensure that the GCS bucket exists prior to assigning permissions. For more information see the [access control page](https://cloud.google.com/container-registry/docs/access-control) for GCR.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const registry = new gcp.container.Registry("registry", {
 *     project: "my-project",
 *     location: "EU",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * registry = gcp.container.Registry("registry",
 *     project="my-project",
 *     location="EU")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var registry = new Gcp.Container.Registry("registry", new()
 *     {
 *         Project = "my-project",
 *         Location = "EU",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := container.NewRegistry(ctx, "registry", &container.RegistryArgs{
 * 			Project:  pulumi.String("my-project"),
 * 			Location: pulumi.String("EU"),
 * 		})
 * 		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.container.Registry;
 * import com.pulumi.gcp.container.RegistryArgs;
 * 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 registry = new Registry("registry", RegistryArgs.builder()
 *             .project("my-project")
 *             .location("EU")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   registry:
 *     type: gcp:container:Registry
 *     properties:
 *       project: my-project
 *       location: EU
 * ```
 * 
 * The `id` field of the `gcp.container.Registry` is the identifier of the storage bucket that backs GCR and can be used to assign permissions to the bucket.
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const registry = new gcp.container.Registry("registry", {
 *     project: "my-project",
 *     location: "EU",
 * });
 * const viewer = new gcp.storage.BucketIAMMember("viewer", {
 *     bucket: registry.id,
 *     role: "roles/storage.objectViewer",
 *     member: "user:[email protected]",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * registry = gcp.container.Registry("registry",
 *     project="my-project",
 *     location="EU")
 * viewer = gcp.storage.BucketIAMMember("viewer",
 *     bucket=registry.id,
 *     role="roles/storage.objectViewer",
 *     member="user:[email protected]")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var registry = new Gcp.Container.Registry("registry", new()
 *     {
 *         Project = "my-project",
 *         Location = "EU",
 *     });
 *     var viewer = new Gcp.Storage.BucketIAMMember("viewer", new()
 *     {
 *         Bucket = registry.Id,
 *         Role = "roles/storage.objectViewer",
 *         Member = "user:[email protected]",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		registry, err := container.NewRegistry(ctx, "registry", &container.RegistryArgs{
 * 			Project:  pulumi.String("my-project"),
 * 			Location: pulumi.String("EU"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = storage.NewBucketIAMMember(ctx, "viewer", &storage.BucketIAMMemberArgs{
 * 			Bucket: registry.ID(),
 * 			Role:   pulumi.String("roles/storage.objectViewer"),
 * 			Member: pulumi.String("user:[email protected]"),
 * 		})
 * 		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.container.Registry;
 * import com.pulumi.gcp.container.RegistryArgs;
 * import com.pulumi.gcp.storage.BucketIAMMember;
 * import com.pulumi.gcp.storage.BucketIAMMemberArgs;
 * 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 registry = new Registry("registry", RegistryArgs.builder()
 *             .project("my-project")
 *             .location("EU")
 *             .build());
 *         var viewer = new BucketIAMMember("viewer", BucketIAMMemberArgs.builder()
 *             .bucket(registry.id())
 *             .role("roles/storage.objectViewer")
 *             .member("user:[email protected]")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   registry:
 *     type: gcp:container:Registry
 *     properties:
 *       project: my-project
 *       location: EU
 *   viewer:
 *     type: gcp:storage:BucketIAMMember
 *     properties:
 *       bucket: ${registry.id}
 *       role: roles/storage.objectViewer
 *       member: user:[email protected]
 * ```
 * 
 * ## Import
 * This resource does not support import.
 * @property location The location of the registry. One of `ASIA`, `EU`, `US` or not specified. See [the official documentation](https://cloud.google.com/container-registry/docs/pushing-and-pulling#pushing_an_image_to_a_registry) for more information on registry locations.
 * @property project The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
 */
public data class RegistryArgs(
    public val location: Output? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.container.RegistryArgs =
        com.pulumi.gcp.container.RegistryArgs.builder()
            .location(location?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RegistryArgs].
 */
@PulumiTagMarker
public class RegistryArgsBuilder internal constructor() {
    private var location: Output? = null

    private var project: Output? = null

    /**
     * @param value The location of the registry. One of `ASIA`, `EU`, `US` or not specified. See [the official documentation](https://cloud.google.com/container-registry/docs/pushing-and-pulling#pushing_an_image_to_a_registry) for more information on registry locations.
     */
    @JvmName("bhxtlodiqpwamxcs")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

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

    /**
     * @param value The location of the registry. One of `ASIA`, `EU`, `US` or not specified. See [the official documentation](https://cloud.google.com/container-registry/docs/pushing-and-pulling#pushing_an_image_to_a_registry) for more information on registry locations.
     */
    @JvmName("yebgbodvskmwnptq")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

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

    internal fun build(): RegistryArgs = RegistryArgs(
        location = location,
        project = project,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy