Class SecretVersion
Provides a resource to manage AWS Secrets Manager secret version including its secret value. To manage secret metadata, see the aws.secretsmanager.Secret resource.
NOTE: If the
AWSCURRENTstaging label is present on this version during resource deletion, that label cannot be removed and will be skipped to prevent errors when fully deleting the secret. That label will leave this secret version active even after the resource is deleted from this provider unless the secret itself is deleted. Move theAWSCURRENTstaging label before or after deleting this resource from this provider to fully trigger version deprecation if necessary.
Example Usage
Simple String Value
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.SecretsManager.SecretVersion("example", new Aws.SecretsManager.SecretVersionArgs
{
SecretId = aws_secretsmanager_secret.Example.Id,
SecretString = "example-string-to-protect",
});
}
}
Inherited Members
Namespace: Pulumi.Aws.SecretsManager
Assembly: Pulumi.Aws.dll
Syntax
public class SecretVersion : CustomResource
Constructors
View SourceSecretVersion(String, SecretVersionArgs, CustomResourceOptions)
Create a SecretVersion resource with the given unique name, arguments, and options.
Declaration
public SecretVersion(string name, SecretVersionArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| SecretVersionArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceArn
The ARN of the secret.
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SecretBinary
Specifies binary data that you want to encrypt and store in this version of the secret. This is required if secret_string is not set. Needs to be encoded to base64.
Declaration
public Output<string> SecretBinary { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SecretId
Specifies the secret to which you want to add a new version. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret. The secret must already exist.
Declaration
public Output<string> SecretId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SecretString
Specifies text data that you want to encrypt and store in this version of the secret. This is required if secret_binary is not set.
Declaration
public Output<string> SecretString { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VersionId
The unique identifier of the version of the secret.
Declaration
public Output<string> VersionId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VersionStages
Specifies a list of staging labels that are attached to this version of the secret. A staging label must be unique to a single version of the secret. If you specify a staging label that's already associated with a different version of the same secret then that staging label is automatically removed from the other version and attached to this version. If you do not specify a value, then AWS Secrets Manager automatically moves the staging label AWSCURRENT to this new version on creation.
Declaration
public Output<ImmutableArray<string>> VersionStages { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Methods
View SourceGet(String, Input<String>, SecretVersionState, CustomResourceOptions)
Get an existing SecretVersion resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static SecretVersion Get(string name, Input<string> id, SecretVersionState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| SecretVersionState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| SecretVersion |