Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.netapp.kotlin.KmsconfigArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.netapp.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.netapp.KmsconfigArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* NetApp Volumes always encrypts your data at rest using volume-specific keys.
* A CMEK policy (customer-managed encryption key) warps such volume-specific keys in a key stored in Cloud Key Management Service (KMS).
* To get more information about kmsconfig, see:
* * [API documentation](https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.kmsConfigs)
* * How-to Guides
* * [Documentation](https://cloud.google.com/netapp/volumes/docs/configure-and-use/cmek/cmek-overview)
* ## Example Usage
* ### Kms Config Create
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const keyring = new gcp.kms.KeyRing("keyring", {
* name: "key-ring",
* location: "us-central1",
* });
* const cryptoKey = new gcp.kms.CryptoKey("crypto_key", {
* name: "crypto-name",
* keyRing: keyring.id,
* });
* const kmsConfig = new gcp.netapp.Kmsconfig("kmsConfig", {
* name: "kms-test",
* description: "this is a test description",
* cryptoKeyName: cryptoKey.id,
* location: "us-central1",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* keyring = gcp.kms.KeyRing("keyring",
* name="key-ring",
* location="us-central1")
* crypto_key = gcp.kms.CryptoKey("crypto_key",
* name="crypto-name",
* key_ring=keyring.id)
* kms_config = gcp.netapp.Kmsconfig("kmsConfig",
* name="kms-test",
* description="this is a test description",
* crypto_key_name=crypto_key.id,
* location="us-central1")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var keyring = new Gcp.Kms.KeyRing("keyring", new()
* {
* Name = "key-ring",
* Location = "us-central1",
* });
* var cryptoKey = new Gcp.Kms.CryptoKey("crypto_key", new()
* {
* Name = "crypto-name",
* KeyRing = keyring.Id,
* });
* var kmsConfig = new Gcp.Netapp.Kmsconfig("kmsConfig", new()
* {
* Name = "kms-test",
* Description = "this is a test description",
* CryptoKeyName = cryptoKey.Id,
* Location = "us-central1",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/netapp"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* keyring, err := kms.NewKeyRing(ctx, "keyring", &kms.KeyRingArgs{
* Name: pulumi.String("key-ring"),
* Location: pulumi.String("us-central1"),
* })
* if err != nil {
* return err
* }
* cryptoKey, err := kms.NewCryptoKey(ctx, "crypto_key", &kms.CryptoKeyArgs{
* Name: pulumi.String("crypto-name"),
* KeyRing: keyring.ID(),
* })
* if err != nil {
* return err
* }
* _, err = netapp.NewKmsconfig(ctx, "kmsConfig", &netapp.KmsconfigArgs{
* Name: pulumi.String("kms-test"),
* Description: pulumi.String("this is a test description"),
* CryptoKeyName: cryptoKey.ID(),
* Location: pulumi.String("us-central1"),
* })
* 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.kms.KeyRing;
* import com.pulumi.gcp.kms.KeyRingArgs;
* import com.pulumi.gcp.kms.CryptoKey;
* import com.pulumi.gcp.kms.CryptoKeyArgs;
* import com.pulumi.gcp.netapp.Kmsconfig;
* import com.pulumi.gcp.netapp.KmsconfigArgs;
* 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 keyring = new KeyRing("keyring", KeyRingArgs.builder()
* .name("key-ring")
* .location("us-central1")
* .build());
* var cryptoKey = new CryptoKey("cryptoKey", CryptoKeyArgs.builder()
* .name("crypto-name")
* .keyRing(keyring.id())
* .build());
* var kmsConfig = new Kmsconfig("kmsConfig", KmsconfigArgs.builder()
* .name("kms-test")
* .description("this is a test description")
* .cryptoKeyName(cryptoKey.id())
* .location("us-central1")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* keyring:
* type: gcp:kms:KeyRing
* properties:
* name: key-ring
* location: us-central1
* cryptoKey:
* type: gcp:kms:CryptoKey
* name: crypto_key
* properties:
* name: crypto-name
* keyRing: ${keyring.id}
* kmsConfig:
* type: gcp:netapp:Kmsconfig
* properties:
* name: kms-test
* description: this is a test description
* cryptoKeyName: ${cryptoKey.id}
* location: us-central1
* ```
*
* ## Import
* kmsconfig can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/kmsConfigs/{{name}}`
* * `{{project}}/{{location}}/{{name}}`
* * `{{location}}/{{name}}`
* When using the `pulumi import` command, kmsconfig can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:netapp/kmsconfig:Kmsconfig default projects/{{project}}/locations/{{location}}/kmsConfigs/{{name}}
* ```
* ```sh
* $ pulumi import gcp:netapp/kmsconfig:Kmsconfig default {{project}}/{{location}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:netapp/kmsconfig:Kmsconfig default {{location}}/{{name}}
* ```
* @property cryptoKeyName Resource name of the KMS key to use. Only regional keys are supported. Format: `projects/{{project}}/locations/{{location}}/keyRings/{{key_ring}}/cryptoKeys/{{key}}`.
* @property description Description for the CMEK policy.
* @property labels Labels as key value pairs. Example: `{ "owner": "Bob", "department": "finance", "purpose": "testing" }`.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
* @property location Name of the policy location. CMEK policies apply to the whole region.
* @property name Name of the CMEK policy.
* - - -
* @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 KmsconfigArgs(
public val cryptoKeyName: Output? = null,
public val description: Output? = null,
public val labels: Output>? = null,
public val location: Output? = null,
public val name: Output? = null,
public val project: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.netapp.KmsconfigArgs =
com.pulumi.gcp.netapp.KmsconfigArgs.builder()
.cryptoKeyName(cryptoKeyName?.applyValue({ args0 -> args0 }))
.description(description?.applyValue({ args0 -> args0 }))
.labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.location(location?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [KmsconfigArgs].
*/
@PulumiTagMarker
public class KmsconfigArgsBuilder internal constructor() {
private var cryptoKeyName: Output? = null
private var description: Output? = null
private var labels: Output>? = null
private var location: Output? = null
private var name: Output? = null
private var project: Output? = null
/**
* @param value Resource name of the KMS key to use. Only regional keys are supported. Format: `projects/{{project}}/locations/{{location}}/keyRings/{{key_ring}}/cryptoKeys/{{key}}`.
*/
@JvmName("poutgyembpofkagi")
public suspend fun cryptoKeyName(`value`: Output) {
this.cryptoKeyName = value
}
/**
* @param value Description for the CMEK policy.
*/
@JvmName("odgptendmmuistpv")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value Labels as key value pairs. Example: `{ "owner": "Bob", "department": "finance", "purpose": "testing" }`.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
*/
@JvmName("ooxmkyplaqahpqem")
public suspend fun labels(`value`: Output>) {
this.labels = value
}
/**
* @param value Name of the policy location. CMEK policies apply to the whole region.
*/
@JvmName("efenoniomukmwxbe")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value Name of the CMEK policy.
* - - -
*/
@JvmName("vicyvaudgtdctgba")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("pfxkvscqyhfdtnwo")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value Resource name of the KMS key to use. Only regional keys are supported. Format: `projects/{{project}}/locations/{{location}}/keyRings/{{key_ring}}/cryptoKeys/{{key}}`.
*/
@JvmName("nnpstbbtdcmuxddy")
public suspend fun cryptoKeyName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cryptoKeyName = mapped
}
/**
* @param value Description for the CMEK policy.
*/
@JvmName("hxbcfitooxwtswxj")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value Labels as key value pairs. Example: `{ "owner": "Bob", "department": "finance", "purpose": "testing" }`.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
*/
@JvmName("gwhvadfgnidhckxu")
public suspend fun labels(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param values Labels as key value pairs. Example: `{ "owner": "Bob", "department": "finance", "purpose": "testing" }`.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
*/
@JvmName("ensonwgyvejgtoys")
public fun labels(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param value Name of the policy location. CMEK policies apply to the whole region.
*/
@JvmName("lmoypcjwlinpvrvn")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value Name of the CMEK policy.
* - - -
*/
@JvmName("mpnqxigqlontxaqb")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("qpojkejnokecvowv")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
internal fun build(): KmsconfigArgs = KmsconfigArgs(
cryptoKeyName = cryptoKeyName,
description = description,
labels = labels,
location = location,
name = name,
project = project,
)
}