SecretArgs

data class SecretArgs(val properties: Output<SecretPropertiesArgs>? = null, val resourceGroupName: Output<String>? = null, val secretName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val vaultName: Output<String>? = null) : ConvertibleToJava<SecretArgs>

Resource information with extended details. Uses Azure REST API version 2023-02-01. In version 1.x of the Azure Native provider, it used API version 2019-09-01. Other available API versions: 2023-07-01, 2024-04-01-preview, 2024-11-01, 2024-12-01-preview.

Example Usage

Create a secret

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var secret = new AzureNative.KeyVault.Secret("secret", new()
{
Properties = new AzureNative.KeyVault.Inputs.SecretPropertiesArgs
{
Value = "secret-value",
},
ResourceGroupName = "sample-group",
SecretName = "secret-name",
VaultName = "sample-vault",
});
});
package main
import (
keyvault "github.com/pulumi/pulumi-azure-native-sdk/keyvault/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := keyvault.NewSecret(ctx, "secret", &keyvault.SecretArgs{
Properties: &keyvault.SecretPropertiesArgs{
Value: pulumi.String("secret-value"),
},
ResourceGroupName: pulumi.String("sample-group"),
SecretName: pulumi.String("secret-name"),
VaultName: pulumi.String("sample-vault"),
})
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.azurenative.keyvault.Secret;
import com.pulumi.azurenative.keyvault.SecretArgs;
import com.pulumi.azurenative.keyvault.inputs.SecretPropertiesArgs;
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 = new Secret("secret", SecretArgs.builder()
.properties(SecretPropertiesArgs.builder()
.value("secret-value")
.build())
.resourceGroupName("sample-group")
.secretName("secret-name")
.vaultName("sample-vault")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:keyvault:Secret secret-name /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}

Constructors

Link copied to clipboard
constructor(properties: Output<SecretPropertiesArgs>? = null, resourceGroupName: Output<String>? = null, secretName: Output<String>? = null, tags: Output<Map<String, String>>? = null, vaultName: Output<String>? = null)

Properties

Link copied to clipboard
val properties: Output<SecretPropertiesArgs>? = null

Properties of the secret

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

The name of the Resource Group to which the vault belongs.

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

Name of the secret. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information.

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

The tags that will be assigned to the secret.

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

Name of the vault

Functions

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