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

com.pulumi.gcp.secretmanager.kotlin.SecretArgs.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.secretmanager.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.secretmanager.SecretArgs.builder
import com.pulumi.gcp.secretmanager.kotlin.inputs.SecretReplicationArgs
import com.pulumi.gcp.secretmanager.kotlin.inputs.SecretReplicationArgsBuilder
import com.pulumi.gcp.secretmanager.kotlin.inputs.SecretRotationArgs
import com.pulumi.gcp.secretmanager.kotlin.inputs.SecretRotationArgsBuilder
import com.pulumi.gcp.secretmanager.kotlin.inputs.SecretTopicArgs
import com.pulumi.gcp.secretmanager.kotlin.inputs.SecretTopicArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A Secret is a logical secret whose value and versions can be accessed.
 * To get more information about Secret, see:
 * * [API documentation](https://cloud.google.com/secret-manager/docs/reference/rest/v1/projects.secrets)
 * ## Example Usage
 * ### Secret Config Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
 *     secretId: "secret",
 *     labels: {
 *         label: "my-label",
 *     },
 *     replication: {
 *         userManaged: {
 *             replicas: [
 *                 {
 *                     location: "us-central1",
 *                 },
 *                 {
 *                     location: "us-east1",
 *                 },
 *             ],
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * secret_basic = gcp.secretmanager.Secret("secret-basic",
 *     secret_id="secret",
 *     labels={
 *         "label": "my-label",
 *     },
 *     replication=gcp.secretmanager.SecretReplicationArgs(
 *         user_managed=gcp.secretmanager.SecretReplicationUserManagedArgs(
 *             replicas=[
 *                 gcp.secretmanager.SecretReplicationUserManagedReplicaArgs(
 *                     location="us-central1",
 *                 ),
 *                 gcp.secretmanager.SecretReplicationUserManagedReplicaArgs(
 *                     location="us-east1",
 *                 ),
 *             ],
 *         ),
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var secret_basic = new Gcp.SecretManager.Secret("secret-basic", new()
 *     {
 *         SecretId = "secret",
 *         Labels =
 *         {
 *             { "label", "my-label" },
 *         },
 *         Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
 *         {
 *             UserManaged = new Gcp.SecretManager.Inputs.SecretReplicationUserManagedArgs
 *             {
 *                 Replicas = new[]
 *                 {
 *                     new Gcp.SecretManager.Inputs.SecretReplicationUserManagedReplicaArgs
 *                     {
 *                         Location = "us-central1",
 *                     },
 *                     new Gcp.SecretManager.Inputs.SecretReplicationUserManagedReplicaArgs
 *                     {
 *                         Location = "us-east1",
 *                     },
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := secretmanager.NewSecret(ctx, "secret-basic", &secretmanager.SecretArgs{
 * 			SecretId: pulumi.String("secret"),
 * 			Labels: pulumi.StringMap{
 * 				"label": pulumi.String("my-label"),
 * 			},
 * 			Replication: &secretmanager.SecretReplicationArgs{
 * 				UserManaged: &secretmanager.SecretReplicationUserManagedArgs{
 * 					Replicas: secretmanager.SecretReplicationUserManagedReplicaArray{
 * 						&secretmanager.SecretReplicationUserManagedReplicaArgs{
 * 							Location: pulumi.String("us-central1"),
 * 						},
 * 						&secretmanager.SecretReplicationUserManagedReplicaArgs{
 * 							Location: pulumi.String("us-east1"),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.secretmanager.Secret;
 * import com.pulumi.gcp.secretmanager.SecretArgs;
 * import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
 * import com.pulumi.gcp.secretmanager.inputs.SecretReplicationUserManagedArgs;
 * 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 secret_basic = new Secret("secret-basic", SecretArgs.builder()
 *             .secretId("secret")
 *             .labels(Map.of("label", "my-label"))
 *             .replication(SecretReplicationArgs.builder()
 *                 .userManaged(SecretReplicationUserManagedArgs.builder()
 *                     .replicas(
 *                         SecretReplicationUserManagedReplicaArgs.builder()
 *                             .location("us-central1")
 *                             .build(),
 *                         SecretReplicationUserManagedReplicaArgs.builder()
 *                             .location("us-east1")
 *                             .build())
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   secret-basic:
 *     type: gcp:secretmanager:Secret
 *     properties:
 *       secretId: secret
 *       labels:
 *         label: my-label
 *       replication:
 *         userManaged:
 *           replicas:
 *             - location: us-central1
 *             - location: us-east1
 * ```
 * 
 * ### Secret With Annotations
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const secret_with_annotations = new gcp.secretmanager.Secret("secret-with-annotations", {
 *     secretId: "secret",
 *     labels: {
 *         label: "my-label",
 *     },
 *     annotations: {
 *         key1: "someval",
 *         key2: "someval2",
 *         key3: "someval3",
 *         key4: "someval4",
 *         key5: "someval5",
 *     },
 *     replication: {
 *         auto: {},
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * secret_with_annotations = gcp.secretmanager.Secret("secret-with-annotations",
 *     secret_id="secret",
 *     labels={
 *         "label": "my-label",
 *     },
 *     annotations={
 *         "key1": "someval",
 *         "key2": "someval2",
 *         "key3": "someval3",
 *         "key4": "someval4",
 *         "key5": "someval5",
 *     },
 *     replication=gcp.secretmanager.SecretReplicationArgs(
 *         auto=gcp.secretmanager.SecretReplicationAutoArgs(),
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var secret_with_annotations = new Gcp.SecretManager.Secret("secret-with-annotations", new()
 *     {
 *         SecretId = "secret",
 *         Labels =
 *         {
 *             { "label", "my-label" },
 *         },
 *         Annotations =
 *         {
 *             { "key1", "someval" },
 *             { "key2", "someval2" },
 *             { "key3", "someval3" },
 *             { "key4", "someval4" },
 *             { "key5", "someval5" },
 *         },
 *         Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
 *         {
 *             Auto = null,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := secretmanager.NewSecret(ctx, "secret-with-annotations", &secretmanager.SecretArgs{
 * 			SecretId: pulumi.String("secret"),
 * 			Labels: pulumi.StringMap{
 * 				"label": pulumi.String("my-label"),
 * 			},
 * 			Annotations: pulumi.StringMap{
 * 				"key1": pulumi.String("someval"),
 * 				"key2": pulumi.String("someval2"),
 * 				"key3": pulumi.String("someval3"),
 * 				"key4": pulumi.String("someval4"),
 * 				"key5": pulumi.String("someval5"),
 * 			},
 * 			Replication: &secretmanager.SecretReplicationArgs{
 * 				Auto: nil,
 * 			},
 * 		})
 * 		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.secretmanager.Secret;
 * import com.pulumi.gcp.secretmanager.SecretArgs;
 * import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
 * import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
 * 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 secret_with_annotations = new Secret("secret-with-annotations", SecretArgs.builder()
 *             .secretId("secret")
 *             .labels(Map.of("label", "my-label"))
 *             .annotations(Map.ofEntries(
 *                 Map.entry("key1", "someval"),
 *                 Map.entry("key2", "someval2"),
 *                 Map.entry("key3", "someval3"),
 *                 Map.entry("key4", "someval4"),
 *                 Map.entry("key5", "someval5")
 *             ))
 *             .replication(SecretReplicationArgs.builder()
 *                 .auto()
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   secret-with-annotations:
 *     type: gcp:secretmanager:Secret
 *     properties:
 *       secretId: secret
 *       labels:
 *         label: my-label
 *       annotations:
 *         key1: someval
 *         key2: someval2
 *         key3: someval3
 *         key4: someval4
 *         key5: someval5
 *       replication:
 *         auto: {}
 * ```
 * 
 * ### Secret With Version Destroy Ttl
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const secret_with_version_destroy_ttl = new gcp.secretmanager.Secret("secret-with-version-destroy-ttl", {
 *     secretId: "secret",
 *     versionDestroyTtl: "2592000s",
 *     replication: {
 *         auto: {},
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * secret_with_version_destroy_ttl = gcp.secretmanager.Secret("secret-with-version-destroy-ttl",
 *     secret_id="secret",
 *     version_destroy_ttl="2592000s",
 *     replication=gcp.secretmanager.SecretReplicationArgs(
 *         auto=gcp.secretmanager.SecretReplicationAutoArgs(),
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var secret_with_version_destroy_ttl = new Gcp.SecretManager.Secret("secret-with-version-destroy-ttl", new()
 *     {
 *         SecretId = "secret",
 *         VersionDestroyTtl = "2592000s",
 *         Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
 *         {
 *             Auto = null,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := secretmanager.NewSecret(ctx, "secret-with-version-destroy-ttl", &secretmanager.SecretArgs{
 * 			SecretId:          pulumi.String("secret"),
 * 			VersionDestroyTtl: pulumi.String("2592000s"),
 * 			Replication: &secretmanager.SecretReplicationArgs{
 * 				Auto: nil,
 * 			},
 * 		})
 * 		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.secretmanager.Secret;
 * import com.pulumi.gcp.secretmanager.SecretArgs;
 * import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
 * import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
 * 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 secret_with_version_destroy_ttl = new Secret("secret-with-version-destroy-ttl", SecretArgs.builder()
 *             .secretId("secret")
 *             .versionDestroyTtl("2592000s")
 *             .replication(SecretReplicationArgs.builder()
 *                 .auto()
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   secret-with-version-destroy-ttl:
 *     type: gcp:secretmanager:Secret
 *     properties:
 *       secretId: secret
 *       versionDestroyTtl: 2592000s
 *       replication:
 *         auto: {}
 * ```
 * 
 * ### Secret With Automatic Cmek
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const project = gcp.organizations.getProject({});
 * const kms_secret_binding = new gcp.kms.CryptoKeyIAMMember("kms-secret-binding", {
 *     cryptoKeyId: "kms-key",
 *     role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *     member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-secretmanager.iam.gserviceaccount.com`),
 * });
 * const secret_with_automatic_cmek = new gcp.secretmanager.Secret("secret-with-automatic-cmek", {
 *     secretId: "secret",
 *     replication: {
 *         auto: {
 *             customerManagedEncryption: {
 *                 kmsKeyName: "kms-key",
 *             },
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * project = gcp.organizations.get_project()
 * kms_secret_binding = gcp.kms.CryptoKeyIAMMember("kms-secret-binding",
 *     crypto_key_id="kms-key",
 *     role="roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *     member=f"serviceAccount:service-{project.number}@gcp-sa-secretmanager.iam.gserviceaccount.com")
 * secret_with_automatic_cmek = gcp.secretmanager.Secret("secret-with-automatic-cmek",
 *     secret_id="secret",
 *     replication=gcp.secretmanager.SecretReplicationArgs(
 *         auto=gcp.secretmanager.SecretReplicationAutoArgs(
 *             customer_managed_encryption=gcp.secretmanager.SecretReplicationAutoCustomerManagedEncryptionArgs(
 *                 kms_key_name="kms-key",
 *             ),
 *         ),
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var kms_secret_binding = new Gcp.Kms.CryptoKeyIAMMember("kms-secret-binding", new()
 *     {
 *         CryptoKeyId = "kms-key",
 *         Role = "roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *         Member = $"serviceAccount:service-{project.Apply(getProjectResult => getProjectResult.Number)}@gcp-sa-secretmanager.iam.gserviceaccount.com",
 *     });
 *     var secret_with_automatic_cmek = new Gcp.SecretManager.Secret("secret-with-automatic-cmek", new()
 *     {
 *         SecretId = "secret",
 *         Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
 *         {
 *             Auto = new Gcp.SecretManager.Inputs.SecretReplicationAutoArgs
 *             {
 *                 CustomerManagedEncryption = new Gcp.SecretManager.Inputs.SecretReplicationAutoCustomerManagedEncryptionArgs
 *                 {
 *                     KmsKeyName = "kms-key",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		project, err := organizations.LookupProject(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = kms.NewCryptoKeyIAMMember(ctx, "kms-secret-binding", &kms.CryptoKeyIAMMemberArgs{
 * 			CryptoKeyId: pulumi.String("kms-key"),
 * 			Role:        pulumi.String("roles/cloudkms.cryptoKeyEncrypterDecrypter"),
 * 			Member:      pulumi.String(fmt.Sprintf("serviceAccount:service-%[email protected]", project.Number)),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = secretmanager.NewSecret(ctx, "secret-with-automatic-cmek", &secretmanager.SecretArgs{
 * 			SecretId: pulumi.String("secret"),
 * 			Replication: &secretmanager.SecretReplicationArgs{
 * 				Auto: &secretmanager.SecretReplicationAutoArgs{
 * 					CustomerManagedEncryption: &secretmanager.SecretReplicationAutoCustomerManagedEncryptionArgs{
 * 						KmsKeyName: pulumi.String("kms-key"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.kms.CryptoKeyIAMMember;
 * import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs;
 * import com.pulumi.gcp.secretmanager.Secret;
 * import com.pulumi.gcp.secretmanager.SecretArgs;
 * import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
 * import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
 * import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoCustomerManagedEncryptionArgs;
 * 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) {
 *         final var project = OrganizationsFunctions.getProject();
 *         var kms_secret_binding = new CryptoKeyIAMMember("kms-secret-binding", CryptoKeyIAMMemberArgs.builder()
 *             .cryptoKeyId("kms-key")
 *             .role("roles/cloudkms.cryptoKeyEncrypterDecrypter")
 *             .member(String.format("serviceAccount:service-%[email protected]", project.applyValue(getProjectResult -> getProjectResult.number())))
 *             .build());
 *         var secret_with_automatic_cmek = new Secret("secret-with-automatic-cmek", SecretArgs.builder()
 *             .secretId("secret")
 *             .replication(SecretReplicationArgs.builder()
 *                 .auto(SecretReplicationAutoArgs.builder()
 *                     .customerManagedEncryption(SecretReplicationAutoCustomerManagedEncryptionArgs.builder()
 *                         .kmsKeyName("kms-key")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   kms-secret-binding:
 *     type: gcp:kms:CryptoKeyIAMMember
 *     properties:
 *       cryptoKeyId: kms-key
 *       role: roles/cloudkms.cryptoKeyEncrypterDecrypter
 *       member: serviceAccount:service-${project.number}@gcp-sa-secretmanager.iam.gserviceaccount.com
 *   secret-with-automatic-cmek:
 *     type: gcp:secretmanager:Secret
 *     properties:
 *       secretId: secret
 *       replication:
 *         auto:
 *           customerManagedEncryption:
 *             kmsKeyName: kms-key
 * variables:
 *   project:
 *     fn::invoke:
 *       Function: gcp:organizations:getProject
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Secret can be imported using any of these accepted formats:
 * * `projects/{{project}}/secrets/{{secret_id}}`
 * * `{{project}}/{{secret_id}}`
 * * `{{secret_id}}`
 * When using the `pulumi import` command, Secret can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:secretmanager/secret:Secret default projects/{{project}}/secrets/{{secret_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:secretmanager/secret:Secret default {{project}}/{{secret_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:secretmanager/secret:Secret default {{secret_id}}
 * ```
 * @property annotations Custom metadata about the secret. Annotations are distinct from various forms of labels. Annotations exist to allow
 * client tools to store their own state information without requiring a database. Annotation keys must be between 1 and 63
 * characters long, have a UTF-8 encoding of maximum 128 bytes, begin and end with an alphanumeric character ([a-z0-9A-Z]),
 * and may have dashes (-), underscores (_), dots (.), and alphanumerics in between these symbols. The total size of
 * annotation keys and values must be less than 16KiB. An object containing a list of "key": value pairs. Example: {
 * "name": "wrench", "mass": "1.3kg", "count": "3" }. **Note**: This field is non-authoritative, and will only manage the
 * annotations present in your configuration. Please refer to the field 'effective_annotations' for all of the annotations
 * present on the resource.
 * @property expireTime Timestamp in UTC when the Secret is scheduled to expire. This is always provided on output, regardless of what was sent
 * on input. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
 * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Only one of 'expire_time' or 'ttl' can be
 * provided.
 * @property labels The labels assigned to this Secret. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of
 * maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
 * Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to
 * the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be assigned to a given
 * resource. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3"
 * }. **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 project
 * @property replication The replication policy of the secret data attached to the Secret. It cannot be changed
 * after the Secret has been created.
 * Structure is documented below.
 * @property rotation The rotation time and period for a Secret. At 'next_rotation_time', Secret Manager will send a Pub/Sub notification to
 * the topics configured on the Secret. 'topics' must be set to configure rotation.
 * @property secretId This must be unique within the project.
 * @property topics A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret
 * or its versions.
 * @property ttl The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
 * Only one of 'ttl' or 'expire_time' can be provided.
 * @property versionAliases Mapping from version alias to version name. A version alias is a string with a maximum length of 63 characters and can
 * contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore ('_') characters. An alias string
 * must start with a letter and cannot be the string 'latest' or 'NEW'. No more than 50 aliases can be assigned to a given
 * secret. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
 * @property versionDestroyTtl Secret Version TTL after destruction request. This is a part of the delayed delete feature on Secret Version. For secret
 * with versionDestroyTtl>0, version destruction doesn't happen immediately on calling destroy instead the version goes to
 * a disabled state and the actual destruction happens after this TTL expires.
 */
public data class SecretArgs(
    public val annotations: Output>? = null,
    public val expireTime: Output? = null,
    public val labels: Output>? = null,
    public val project: Output? = null,
    public val replication: Output? = null,
    public val rotation: Output? = null,
    public val secretId: Output? = null,
    public val topics: Output>? = null,
    public val ttl: Output? = null,
    public val versionAliases: Output>? = null,
    public val versionDestroyTtl: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.secretmanager.SecretArgs =
        com.pulumi.gcp.secretmanager.SecretArgs.builder()
            .annotations(
                annotations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .expireTime(expireTime?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .project(project?.applyValue({ args0 -> args0 }))
            .replication(replication?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .rotation(rotation?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .secretId(secretId?.applyValue({ args0 -> args0 }))
            .topics(topics?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .ttl(ttl?.applyValue({ args0 -> args0 }))
            .versionAliases(
                versionAliases?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .versionDestroyTtl(versionDestroyTtl?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SecretArgs].
 */
@PulumiTagMarker
public class SecretArgsBuilder internal constructor() {
    private var annotations: Output>? = null

    private var expireTime: Output? = null

    private var labels: Output>? = null

    private var project: Output? = null

    private var replication: Output? = null

    private var rotation: Output? = null

    private var secretId: Output? = null

    private var topics: Output>? = null

    private var ttl: Output? = null

    private var versionAliases: Output>? = null

    private var versionDestroyTtl: Output? = null

    /**
     * @param value Custom metadata about the secret. Annotations are distinct from various forms of labels. Annotations exist to allow
     * client tools to store their own state information without requiring a database. Annotation keys must be between 1 and 63
     * characters long, have a UTF-8 encoding of maximum 128 bytes, begin and end with an alphanumeric character ([a-z0-9A-Z]),
     * and may have dashes (-), underscores (_), dots (.), and alphanumerics in between these symbols. The total size of
     * annotation keys and values must be less than 16KiB. An object containing a list of "key": value pairs. Example: {
     * "name": "wrench", "mass": "1.3kg", "count": "3" }. **Note**: This field is non-authoritative, and will only manage the
     * annotations present in your configuration. Please refer to the field 'effective_annotations' for all of the annotations
     * present on the resource.
     */
    @JvmName("utlbuskgwuabghlu")
    public suspend fun annotations(`value`: Output>) {
        this.annotations = value
    }

    /**
     * @param value Timestamp in UTC when the Secret is scheduled to expire. This is always provided on output, regardless of what was sent
     * on input. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
     * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Only one of 'expire_time' or 'ttl' can be
     * provided.
     */
    @JvmName("fibymdqlngaagvfl")
    public suspend fun expireTime(`value`: Output) {
        this.expireTime = value
    }

    /**
     * @param value The labels assigned to this Secret. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of
     * maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
     * Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to
     * the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be assigned to a given
     * resource. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3"
     * }. **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("ffwmsufhgqoucbtc")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value
     */
    @JvmName("bsloqhwqbvvyccft")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The replication policy of the secret data attached to the Secret. It cannot be changed
     * after the Secret has been created.
     * Structure is documented below.
     */
    @JvmName("wjwqigaopbarowtp")
    public suspend fun replication(`value`: Output) {
        this.replication = value
    }

    /**
     * @param value The rotation time and period for a Secret. At 'next_rotation_time', Secret Manager will send a Pub/Sub notification to
     * the topics configured on the Secret. 'topics' must be set to configure rotation.
     */
    @JvmName("jsjcnjbfynsuikof")
    public suspend fun rotation(`value`: Output) {
        this.rotation = value
    }

    /**
     * @param value This must be unique within the project.
     */
    @JvmName("vcholuwnnowdjqbf")
    public suspend fun secretId(`value`: Output) {
        this.secretId = value
    }

    /**
     * @param value A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret
     * or its versions.
     */
    @JvmName("dqjnyfubnbbssovs")
    public suspend fun topics(`value`: Output>) {
        this.topics = value
    }

    @JvmName("bnrjppunfngdybts")
    public suspend fun topics(vararg values: Output) {
        this.topics = Output.all(values.asList())
    }

    /**
     * @param values A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret
     * or its versions.
     */
    @JvmName("omeriiiugpobhxco")
    public suspend fun topics(values: List>) {
        this.topics = Output.all(values)
    }

    /**
     * @param value The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
     * Only one of 'ttl' or 'expire_time' can be provided.
     */
    @JvmName("xbwukkcwevxshoml")
    public suspend fun ttl(`value`: Output) {
        this.ttl = value
    }

    /**
     * @param value Mapping from version alias to version name. A version alias is a string with a maximum length of 63 characters and can
     * contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore ('_') characters. An alias string
     * must start with a letter and cannot be the string 'latest' or 'NEW'. No more than 50 aliases can be assigned to a given
     * secret. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     */
    @JvmName("iyastryvwdapfkqo")
    public suspend fun versionAliases(`value`: Output>) {
        this.versionAliases = value
    }

    /**
     * @param value Secret Version TTL after destruction request. This is a part of the delayed delete feature on Secret Version. For secret
     * with versionDestroyTtl>0, version destruction doesn't happen immediately on calling destroy instead the version goes to
     * a disabled state and the actual destruction happens after this TTL expires.
     */
    @JvmName("ghwfxkjbhrpubbru")
    public suspend fun versionDestroyTtl(`value`: Output) {
        this.versionDestroyTtl = value
    }

    /**
     * @param value Custom metadata about the secret. Annotations are distinct from various forms of labels. Annotations exist to allow
     * client tools to store their own state information without requiring a database. Annotation keys must be between 1 and 63
     * characters long, have a UTF-8 encoding of maximum 128 bytes, begin and end with an alphanumeric character ([a-z0-9A-Z]),
     * and may have dashes (-), underscores (_), dots (.), and alphanumerics in between these symbols. The total size of
     * annotation keys and values must be less than 16KiB. An object containing a list of "key": value pairs. Example: {
     * "name": "wrench", "mass": "1.3kg", "count": "3" }. **Note**: This field is non-authoritative, and will only manage the
     * annotations present in your configuration. Please refer to the field 'effective_annotations' for all of the annotations
     * present on the resource.
     */
    @JvmName("mhoyswmugfiqwpli")
    public suspend fun annotations(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param values Custom metadata about the secret. Annotations are distinct from various forms of labels. Annotations exist to allow
     * client tools to store their own state information without requiring a database. Annotation keys must be between 1 and 63
     * characters long, have a UTF-8 encoding of maximum 128 bytes, begin and end with an alphanumeric character ([a-z0-9A-Z]),
     * and may have dashes (-), underscores (_), dots (.), and alphanumerics in between these symbols. The total size of
     * annotation keys and values must be less than 16KiB. An object containing a list of "key": value pairs. Example: {
     * "name": "wrench", "mass": "1.3kg", "count": "3" }. **Note**: This field is non-authoritative, and will only manage the
     * annotations present in your configuration. Please refer to the field 'effective_annotations' for all of the annotations
     * present on the resource.
     */
    @JvmName("rhyxuamdjjjuvrgx")
    public fun annotations(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param value Timestamp in UTC when the Secret is scheduled to expire. This is always provided on output, regardless of what was sent
     * on input. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
     * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". Only one of 'expire_time' or 'ttl' can be
     * provided.
     */
    @JvmName("gtxhqtctidsduynv")
    public suspend fun expireTime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expireTime = mapped
    }

    /**
     * @param value The labels assigned to this Secret. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of
     * maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
     * Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to
     * the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be assigned to a given
     * resource. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3"
     * }. **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("obgfrnhpouichulm")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values The labels assigned to this Secret. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of
     * maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
     * Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to
     * the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be assigned to a given
     * resource. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3"
     * }. **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("isrkjyahymisqtfo")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value
     */
    @JvmName("nlyttnlmkqvtadgg")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The replication policy of the secret data attached to the Secret. It cannot be changed
     * after the Secret has been created.
     * Structure is documented below.
     */
    @JvmName("edljnwxfssoorwfr")
    public suspend fun replication(`value`: SecretReplicationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replication = mapped
    }

    /**
     * @param argument The replication policy of the secret data attached to the Secret. It cannot be changed
     * after the Secret has been created.
     * Structure is documented below.
     */
    @JvmName("dtypmacevrsmscad")
    public suspend fun replication(argument: suspend SecretReplicationArgsBuilder.() -> Unit) {
        val toBeMapped = SecretReplicationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.replication = mapped
    }

    /**
     * @param value The rotation time and period for a Secret. At 'next_rotation_time', Secret Manager will send a Pub/Sub notification to
     * the topics configured on the Secret. 'topics' must be set to configure rotation.
     */
    @JvmName("ojgdqpauyooikplj")
    public suspend fun rotation(`value`: SecretRotationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rotation = mapped
    }

    /**
     * @param argument The rotation time and period for a Secret. At 'next_rotation_time', Secret Manager will send a Pub/Sub notification to
     * the topics configured on the Secret. 'topics' must be set to configure rotation.
     */
    @JvmName("vqucooeapnpgkduf")
    public suspend fun rotation(argument: suspend SecretRotationArgsBuilder.() -> Unit) {
        val toBeMapped = SecretRotationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.rotation = mapped
    }

    /**
     * @param value This must be unique within the project.
     */
    @JvmName("rqughkjughxvvaau")
    public suspend fun secretId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secretId = mapped
    }

    /**
     * @param value A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret
     * or its versions.
     */
    @JvmName("vrrvvnfndmorhlfu")
    public suspend fun topics(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.topics = mapped
    }

    /**
     * @param argument A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret
     * or its versions.
     */
    @JvmName("piblunqvvlknedgw")
    public suspend fun topics(argument: List Unit>) {
        val toBeMapped = argument.toList().map { SecretTopicArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.topics = mapped
    }

    /**
     * @param argument A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret
     * or its versions.
     */
    @JvmName("rqdxggmbhbpstmkm")
    public suspend fun topics(vararg argument: suspend SecretTopicArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { SecretTopicArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.topics = mapped
    }

    /**
     * @param argument A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret
     * or its versions.
     */
    @JvmName("bptdbrbxkwsolltd")
    public suspend fun topics(argument: suspend SecretTopicArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(SecretTopicArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.topics = mapped
    }

    /**
     * @param values A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret
     * or its versions.
     */
    @JvmName("mromcpgsjboreymb")
    public suspend fun topics(vararg values: SecretTopicArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.topics = mapped
    }

    /**
     * @param value The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
     * Only one of 'ttl' or 'expire_time' can be provided.
     */
    @JvmName("oaetjfqumpyvoamg")
    public suspend fun ttl(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ttl = mapped
    }

    /**
     * @param value Mapping from version alias to version name. A version alias is a string with a maximum length of 63 characters and can
     * contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore ('_') characters. An alias string
     * must start with a letter and cannot be the string 'latest' or 'NEW'. No more than 50 aliases can be assigned to a given
     * secret. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     */
    @JvmName("iyvheicwpcsqdash")
    public suspend fun versionAliases(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.versionAliases = mapped
    }

    /**
     * @param values Mapping from version alias to version name. A version alias is a string with a maximum length of 63 characters and can
     * contain uppercase and lowercase letters, numerals, and the hyphen (-) and underscore ('_') characters. An alias string
     * must start with a letter and cannot be the string 'latest' or 'NEW'. No more than 50 aliases can be assigned to a given
     * secret. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     */
    @JvmName("xnvekvmshyvetunu")
    public fun versionAliases(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.versionAliases = mapped
    }

    /**
     * @param value Secret Version TTL after destruction request. This is a part of the delayed delete feature on Secret Version. For secret
     * with versionDestroyTtl>0, version destruction doesn't happen immediately on calling destroy instead the version goes to
     * a disabled state and the actual destruction happens after this TTL expires.
     */
    @JvmName("khrhgifdpqmflbth")
    public suspend fun versionDestroyTtl(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.versionDestroyTtl = mapped
    }

    internal fun build(): SecretArgs = SecretArgs(
        annotations = annotations,
        expireTime = expireTime,
        labels = labels,
        project = project,
        replication = replication,
        rotation = rotation,
        secretId = secretId,
        topics = topics,
        ttl = ttl,
        versionAliases = versionAliases,
        versionDestroyTtl = versionDestroyTtl,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy