SecretArgs

data class SecretArgs(val contentType: Output<String>? = null, val expirationDate: Output<String>? = null, val keyVaultId: Output<String>? = null, val name: Output<String>? = null, val notBeforeDate: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val value: Output<String>? = null) : ConvertibleToJava<SecretArgs>

Manages a Key Vault Secret. <<<<<<< HEAD

Note: All arguments including the secret value will be stored in the raw state as plain-text. Read more about sensitive data in state. Note: The Azure Provider includes a Feature Toggle which will purge a Key Vault Secret resource on destroy, rather than the default soft-delete. See purge_soft_deleted_secrets_on_destroy for more information. =======

8d78c87098 (Update-documentation)

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.keyvault.KeyVault;
import com.pulumi.azure.keyvault.KeyVaultArgs;
import com.pulumi.azure.keyvault.inputs.KeyVaultAccessPolicyArgs;
import com.pulumi.azure.keyvault.Secret;
import com.pulumi.azure.keyvault.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 current = CoreFunctions.getClientConfig();
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.skuName("premium")
.softDeleteRetentionDays(7)
.accessPolicies(KeyVaultAccessPolicyArgs.builder()
.tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
.keyPermissions(
"Create",
"Get")
.secretPermissions(
"Set",
"Get",
"Delete",
"Purge",
"Recover")
.build())
.build());
var exampleSecret = new Secret("exampleSecret", SecretArgs.builder()
.value("szechuan")
.keyVaultId(exampleKeyVault.id())
.build());
}
}

Import

Key Vault Secrets which are Enabled can be imported using the resource id, e.g.

$ pulumi import azure:keyvault/secret:Secret example "https://example-keyvault.vault.azure.net/secrets/example/fdf067c93bbb4b22bff4d8b7a9a56217"

Constructors

Link copied to clipboard
fun SecretArgs(contentType: Output<String>? = null, expirationDate: Output<String>? = null, keyVaultId: Output<String>? = null, name: Output<String>? = null, notBeforeDate: Output<String>? = null, tags: Output<Map<String, String>>? = null, value: Output<String>? = null)

Functions

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

Properties

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

Specifies the content type for the Key Vault Secret.

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

Expiration UTC datetime (Y-m-d'T'H:M:S'Z').

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

The ID of the Key Vault where the Secret should be created. Changing this forces a new resource to be created.

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

Specifies the name of the Key Vault Secret. Changing this forces a new resource to be created.

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

Key not usable before the provided UTC datetime (Y-m-d'T'H:M:S'Z').

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 value: Output<String>? = null

Specifies the value of the Key Vault Secret. Changing this will create a new version of the Key Vault Secret.