SecretArgs

data class SecretArgs(val description: Output<String>? = null, val dkmsInstanceId: Output<String>? = null, val enableAutomaticRotation: Output<Boolean>? = null, val encryptionKeyId: Output<String>? = null, val extendedConfig: Output<String>? = null, val forceDeleteWithoutRecovery: Output<Boolean>? = null, val policy: Output<String>? = null, val recoveryWindowInDays: Output<Int>? = null, val rotationInterval: Output<String>? = null, val secretData: Output<String>? = null, val secretDataType: Output<String>? = null, val secretName: Output<String>? = null, val secretType: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val versionId: Output<String>? = null, val versionStages: Output<List<String>>? = null) : ConvertibleToJava<SecretArgs>

Provides a KMS Secret resource. For information about KMS Secret and how to use it, see What is Secret.

NOTE: Available since v1.76.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new alicloud.kms.Secret("default", {
secretName: name,
secretData: "Secret data",
versionId: "v1",
forceDeleteWithoutRecovery: true,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.kms.Secret("default",
secret_name=name,
secret_data="Secret data",
version_id="v1",
force_delete_without_recovery=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = new AliCloud.Kms.Secret("default", new()
{
SecretName = name,
SecretData = "Secret data",
VersionId = "v1",
ForceDeleteWithoutRecovery = true,
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := kms.NewSecret(ctx, "default", &kms.SecretArgs{
SecretName: pulumi.String(name),
SecretData: pulumi.String("Secret data"),
VersionId: pulumi.String("v1"),
ForceDeleteWithoutRecovery: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.kms.Secret;
import com.pulumi.alicloud.kms.SecretArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var default_ = new Secret("default", SecretArgs.builder()
.secretName(name)
.secretData("Secret data")
.versionId("v1")
.forceDeleteWithoutRecovery(true)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:kms:Secret
properties:
secretName: ${name}
secretData: Secret data
versionId: v1
forceDeleteWithoutRecovery: true

Import

KMS Secret can be imported using the id, e.g.

$ pulumi import alicloud:kms/secret:Secret example <id>

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, dkmsInstanceId: Output<String>? = null, enableAutomaticRotation: Output<Boolean>? = null, encryptionKeyId: Output<String>? = null, extendedConfig: Output<String>? = null, forceDeleteWithoutRecovery: Output<Boolean>? = null, policy: Output<String>? = null, recoveryWindowInDays: Output<Int>? = null, rotationInterval: Output<String>? = null, secretData: Output<String>? = null, secretDataType: Output<String>? = null, secretName: Output<String>? = null, secretType: Output<String>? = null, tags: Output<Map<String, String>>? = null, versionId: Output<String>? = null, versionStages: Output<List<String>>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

The description of the secret.

Link copied to clipboard
val dkmsInstanceId: Output<String>? = null

The ID of the KMS instance.

Link copied to clipboard
val enableAutomaticRotation: Output<Boolean>? = null

Specifies whether to enable automatic rotation. Default value: false. Valid values: true, false.

Link copied to clipboard
val encryptionKeyId: Output<String>? = null

The ID of the KMS key.

Link copied to clipboard
val extendedConfig: Output<String>? = null

The extended configuration of the secret. For more information, see How to use it.

Link copied to clipboard
val forceDeleteWithoutRecovery: Output<Boolean>? = null

Specifies whether to immediately delete a secret. Default value: false. Valid values: true, false.

Link copied to clipboard
val policy: Output<String>? = null

The content of the secret policy. The value is in the JSON format. The value can be up to 32,768 bytes in length. For more information, see How to use it.

Link copied to clipboard
val recoveryWindowInDays: Output<Int>? = null

Specifies the recovery period of the secret if you do not forcibly delete it. Default value: 30. NOTE: If force_delete_without_recovery is set to true, recovery_window_in_days will be ignored.

Link copied to clipboard
val rotationInterval: Output<String>? = null

The interval for automatic rotation.

Link copied to clipboard
val secretData: Output<String>? = null

The data of the secret. NOTE: From version 1.204.1, attribute secret_data updating diff will be ignored when secret_type is not Generic.

Link copied to clipboard
val secretDataType: Output<String>? = null

The type of the secret value. Default value: text. Valid values: text, binary.

Link copied to clipboard
val secretName: Output<String>? = null

The name of the secret.

Link copied to clipboard
val secretType: Output<String>? = null

The type of the secret. Valid values:

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val versionId: Output<String>? = null

The version number of the initial version.

Link copied to clipboard
val versionStages: Output<List<String>>? = null

The stage label that is used to mark the new version.

Functions

Link copied to clipboard
open override fun toJava(): SecretArgs