Class Secret
Provides a resource to manage AWS Secrets Manager secret metadata. To manage a secret value, see the aws.secretsmanager.SecretVersion resource.
Example Usage
Basic
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.SecretsManager.Secret("example", new Aws.SecretsManager.SecretArgs
{
});
}
}
Rotation Configuration
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var rotation_example = new Aws.SecretsManager.Secret("rotation-example", new Aws.SecretsManager.SecretArgs
{
RotationLambdaArn = aws_lambda_function.Example.Arn,
RotationRules = new Aws.SecretsManager.Inputs.SecretRotationRulesArgs
{
AutomaticallyAfterDays = 7,
},
});
}
}
Inherited Members
Namespace: Pulumi.Aws.SecretsManager
Assembly: Pulumi.Aws.dll
Syntax
public class Secret : CustomResource
Constructors
View SourceSecret(String, SecretArgs, CustomResourceOptions)
Create a Secret resource with the given unique name, arguments, and options.
Declaration
public Secret(string name, SecretArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| SecretArgs | 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
Amazon Resource Name (ARN) of the secret.
Declaration
public Output<string> Arn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
A description of the secret.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
KmsKeyId
Specifies the ARN or alias of the AWS KMS customer master key (CMK) to be used to encrypt the secret values in the versions stored in this secret. If you don't specify this value, then Secrets Manager defaults to using the AWS account's default CMK (the one named aws/secretsmanager). If the default KMS CMK with that name doesn't yet exist, then AWS Secrets Manager creates it for you automatically the first time.
Declaration
public Output<string> KmsKeyId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Specifies the friendly name of the new secret. The secret name can consist of uppercase letters, lowercase letters, digits, and any of the following characters: /_+=.@- Conflicts with name_prefix.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NamePrefix
Creates a unique name beginning with the specified prefix. Conflicts with name.
Declaration
public Output<string> NamePrefix { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Policy
A valid JSON document representing a resource policy.
Declaration
public Output<string> Policy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RecoveryWindowInDays
Specifies the number of days that AWS Secrets Manager waits before it can delete the secret. This value can be 0 to force deletion without recovery or range from 7 to 30 days. The default value is 30.
Declaration
public Output<int?> RecoveryWindowInDays { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
RotationEnabled
Specifies whether automatic rotation is enabled for this secret.
Declaration
public Output<bool> RotationEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
RotationLambdaArn
Specifies the ARN of the Lambda function that can rotate the secret.
Declaration
public Output<string> RotationLambdaArn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RotationRules
A structure that defines the rotation configuration for this secret. Defined below.
Declaration
public Output<SecretRotationRules> RotationRules { get; }
Property Value
| Type | Description |
|---|---|
| Output<SecretRotationRules> |
Tags
Specifies a key-value map of user-defined tags that are attached to the secret.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Methods
View SourceGet(String, Input<String>, SecretState, CustomResourceOptions)
Get an existing Secret resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Secret Get(string name, Input<string> id, SecretState 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. |
| SecretState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Secret |