azure-native.keyvault.Secret
Explore with Pulumi AI
Resource information with extended details. API Version: 2019-09-01.
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"
"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 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(Map.of("value", "secret-value"))
.resourceGroupName("sample-group")
.secretName("secret-name")
.vaultName("sample-vault")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
secret = azure_native.keyvault.Secret("secret",
properties=azure_native.keyvault.SecretPropertiesArgs(
value="secret-value",
),
resource_group_name="sample-group",
secret_name="secret-name",
vault_name="sample-vault")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const secret = new azure_native.keyvault.Secret("secret", {
properties: {
value: "secret-value",
},
resourceGroupName: "sample-group",
secretName: "secret-name",
vaultName: "sample-vault",
});
resources:
secret:
type: azure-native:keyvault:Secret
properties:
properties:
value: secret-value
resourceGroupName: sample-group
secretName: secret-name
vaultName: sample-vault
Create Secret Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Secret(name: string, args: SecretArgs, opts?: CustomResourceOptions);
@overload
def Secret(resource_name: str,
args: SecretArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Secret(resource_name: str,
opts: Optional[ResourceOptions] = None,
properties: Optional[SecretPropertiesArgs] = None,
resource_group_name: Optional[str] = None,
vault_name: Optional[str] = None,
secret_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewSecret(ctx *Context, name string, args SecretArgs, opts ...ResourceOption) (*Secret, error)
public Secret(string name, SecretArgs args, CustomResourceOptions? opts = null)
public Secret(String name, SecretArgs args)
public Secret(String name, SecretArgs args, CustomResourceOptions options)
type: azure-native:keyvault:Secret
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SecretArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args SecretArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args SecretArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecretArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecretArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var examplesecretResourceResourceFromKeyvault = new AzureNative.Keyvault.Secret("examplesecretResourceResourceFromKeyvault", new()
{
Properties =
{
{ "attributes",
{
{ "enabled", false },
{ "expires", 0 },
{ "notBefore", 0 },
} },
{ "contentType", "string" },
{ "value", "string" },
},
ResourceGroupName = "string",
VaultName = "string",
SecretName = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := keyvault.NewSecret(ctx, "examplesecretResourceResourceFromKeyvault", &keyvault.SecretArgs{
Properties: map[string]interface{}{
"attributes": map[string]interface{}{
"enabled": false,
"expires": 0,
"notBefore": 0,
},
"contentType": "string",
"value": "string",
},
ResourceGroupName: "string",
VaultName: "string",
SecretName: "string",
Tags: map[string]interface{}{
"string": "string",
},
})
var examplesecretResourceResourceFromKeyvault = new Secret("examplesecretResourceResourceFromKeyvault", SecretArgs.builder()
.properties(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.resourceGroupName("string")
.vaultName("string")
.secretName("string")
.tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build());
examplesecret_resource_resource_from_keyvault = azure_native.keyvault.Secret("examplesecretResourceResourceFromKeyvault",
properties={
attributes: {
enabled: False,
expires: 0,
notBefore: 0,
},
contentType: string,
value: string,
},
resource_group_name=string,
vault_name=string,
secret_name=string,
tags={
string: string,
})
const examplesecretResourceResourceFromKeyvault = new azure_native.keyvault.Secret("examplesecretResourceResourceFromKeyvault", {
properties: {
attributes: {
enabled: false,
expires: 0,
notBefore: 0,
},
contentType: "string",
value: "string",
},
resourceGroupName: "string",
vaultName: "string",
secretName: "string",
tags: {
string: "string",
},
});
type: azure-native:keyvault:Secret
properties:
properties:
attributes:
enabled: false
expires: 0
notBefore: 0
contentType: string
value: string
resourceGroupName: string
secretName: string
tags:
string: string
vaultName: string
Secret Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Secret resource accepts the following input properties:
- Properties
Pulumi.
Azure Native. Key Vault. Inputs. Secret Properties - Properties of the secret
- Resource
Group stringName - The name of the Resource Group to which the vault belongs.
- Vault
Name string - Name of the vault
- Secret
Name string - Name of the secret
- Dictionary<string, string>
- The tags that will be assigned to the secret.
- Properties
Secret
Properties Args - Properties of the secret
- Resource
Group stringName - The name of the Resource Group to which the vault belongs.
- Vault
Name string - Name of the vault
- Secret
Name string - Name of the secret
- map[string]string
- The tags that will be assigned to the secret.
- properties
Secret
Properties - Properties of the secret
- resource
Group StringName - The name of the Resource Group to which the vault belongs.
- vault
Name String - Name of the vault
- secret
Name String - Name of the secret
- Map<String,String>
- The tags that will be assigned to the secret.
- properties
Secret
Properties - Properties of the secret
- resource
Group stringName - The name of the Resource Group to which the vault belongs.
- vault
Name string - Name of the vault
- secret
Name string - Name of the secret
- {[key: string]: string}
- The tags that will be assigned to the secret.
- properties
Secret
Properties Args - Properties of the secret
- resource_
group_ strname - The name of the Resource Group to which the vault belongs.
- vault_
name str - Name of the vault
- secret_
name str - Name of the secret
- Mapping[str, str]
- The tags that will be assigned to the secret.
- properties Property Map
- Properties of the secret
- resource
Group StringName - The name of the Resource Group to which the vault belongs.
- vault
Name String - Name of the vault
- secret
Name String - Name of the secret
- Map<String>
- The tags that will be assigned to the secret.
Outputs
All input properties are implicitly available as output properties. Additionally, the Secret resource produces the following output properties:
Supporting Types
SecretAttributes, SecretAttributesArgs
- enabled bool
- Determines whether the object is enabled.
- expires int
- Expiry date in seconds since 1970-01-01T00:00:00Z.
- not_
before int - Not before date in seconds since 1970-01-01T00:00:00Z.
SecretAttributesResponse, SecretAttributesResponseArgs
- Created int
- Creation time in seconds since 1970-01-01T00:00:00Z.
- Updated int
- Last updated time in seconds since 1970-01-01T00:00:00Z.
- Enabled bool
- Determines whether the object is enabled.
- Expires int
- Expiry date in seconds since 1970-01-01T00:00:00Z.
- Not
Before int - Not before date in seconds since 1970-01-01T00:00:00Z.
- Created int
- Creation time in seconds since 1970-01-01T00:00:00Z.
- Updated int
- Last updated time in seconds since 1970-01-01T00:00:00Z.
- Enabled bool
- Determines whether the object is enabled.
- Expires int
- Expiry date in seconds since 1970-01-01T00:00:00Z.
- Not
Before int - Not before date in seconds since 1970-01-01T00:00:00Z.
- created Integer
- Creation time in seconds since 1970-01-01T00:00:00Z.
- updated Integer
- Last updated time in seconds since 1970-01-01T00:00:00Z.
- enabled Boolean
- Determines whether the object is enabled.
- expires Integer
- Expiry date in seconds since 1970-01-01T00:00:00Z.
- not
Before Integer - Not before date in seconds since 1970-01-01T00:00:00Z.
- created number
- Creation time in seconds since 1970-01-01T00:00:00Z.
- updated number
- Last updated time in seconds since 1970-01-01T00:00:00Z.
- enabled boolean
- Determines whether the object is enabled.
- expires number
- Expiry date in seconds since 1970-01-01T00:00:00Z.
- not
Before number - Not before date in seconds since 1970-01-01T00:00:00Z.
- created int
- Creation time in seconds since 1970-01-01T00:00:00Z.
- updated int
- Last updated time in seconds since 1970-01-01T00:00:00Z.
- enabled bool
- Determines whether the object is enabled.
- expires int
- Expiry date in seconds since 1970-01-01T00:00:00Z.
- not_
before int - Not before date in seconds since 1970-01-01T00:00:00Z.
- created Number
- Creation time in seconds since 1970-01-01T00:00:00Z.
- updated Number
- Last updated time in seconds since 1970-01-01T00:00:00Z.
- enabled Boolean
- Determines whether the object is enabled.
- expires Number
- Expiry date in seconds since 1970-01-01T00:00:00Z.
- not
Before Number - Not before date in seconds since 1970-01-01T00:00:00Z.
SecretProperties, SecretPropertiesArgs
- Attributes
Pulumi.
Azure Native. Key Vault. Inputs. Secret Attributes - The attributes of the secret.
- Content
Type string - The content type of the secret.
- Value string
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- Attributes
Secret
Attributes - The attributes of the secret.
- Content
Type string - The content type of the secret.
- Value string
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- attributes
Secret
Attributes - The attributes of the secret.
- content
Type String - The content type of the secret.
- value String
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- attributes
Secret
Attributes - The attributes of the secret.
- content
Type string - The content type of the secret.
- value string
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- attributes
Secret
Attributes - The attributes of the secret.
- content_
type str - The content type of the secret.
- value str
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- attributes Property Map
- The attributes of the secret.
- content
Type String - The content type of the secret.
- value String
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
SecretPropertiesResponse, SecretPropertiesResponseArgs
- Secret
Uri string - The URI to retrieve the current version of the secret.
- Secret
Uri stringWith Version - The URI to retrieve the specific version of the secret.
- Attributes
Pulumi.
Azure Native. Key Vault. Inputs. Secret Attributes Response - The attributes of the secret.
- Content
Type string - The content type of the secret.
- Value string
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- Secret
Uri string - The URI to retrieve the current version of the secret.
- Secret
Uri stringWith Version - The URI to retrieve the specific version of the secret.
- Attributes
Secret
Attributes Response - The attributes of the secret.
- Content
Type string - The content type of the secret.
- Value string
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- secret
Uri String - The URI to retrieve the current version of the secret.
- secret
Uri StringWith Version - The URI to retrieve the specific version of the secret.
- attributes
Secret
Attributes Response - The attributes of the secret.
- content
Type String - The content type of the secret.
- value String
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- secret
Uri string - The URI to retrieve the current version of the secret.
- secret
Uri stringWith Version - The URI to retrieve the specific version of the secret.
- attributes
Secret
Attributes Response - The attributes of the secret.
- content
Type string - The content type of the secret.
- value string
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- secret_
uri str - The URI to retrieve the current version of the secret.
- secret_
uri_ strwith_ version - The URI to retrieve the specific version of the secret.
- attributes
Secret
Attributes Response - The attributes of the secret.
- content_
type str - The content type of the secret.
- value str
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
- secret
Uri String - The URI to retrieve the current version of the secret.
- secret
Uri StringWith Version - The URI to retrieve the specific version of the secret.
- attributes Property Map
- The attributes of the secret.
- content
Type String - The content type of the secret.
- value String
- The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets.
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/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault/secrets/secret-name
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- azure-native-v1 pulumi/pulumi-azure-native
- License
- Apache-2.0