Secret

class Secret : KotlinCustomResource

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>

Properties

Link copied to clipboard
val arn: Output<String>

The ARN of the secret.

Link copied to clipboard
val createTime: Output<String>

(Available since v1.224.0) The time when the secret is created.

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

The description of the secret.

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

The ID of the KMS instance.

Link copied to clipboard

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

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

The ID of the KMS key.

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

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

Link copied to clipboard

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The time when the secret is scheduled to be deleted.

Link copied to clipboard
val policy: Output<String>

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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>?

The interval for automatic rotation.

Link copied to clipboard
val secretData: Output<String>

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>?

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

Link copied to clipboard
val secretName: Output<String>

The name of the secret.

Link copied to clipboard
val secretType: Output<String>

The type of the secret. Valid values:

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

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val versionId: Output<String>

The version number of the initial version.

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

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