Show / Hide Table of Contents

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,
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Secret
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.SecretsManager
Assembly: Pulumi.Aws.dll
Syntax
public class Secret : CustomResource

Constructors

View Source

Secret(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 Source

Arn

Amazon Resource Name (ARN) of the secret.

Declaration
public Output<string> Arn { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

A description of the secret.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

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>
View Source

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>
View Source

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>
View Source

Policy

A valid JSON document representing a resource policy.

Declaration
public Output<string> Policy { get; }
Property Value
Type Description
Output<System.String>
View Source

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>>
View Source

RotationEnabled

Specifies whether automatic rotation is enabled for this secret.

Declaration
public Output<bool> RotationEnabled { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

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>
View Source

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>
View Source

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 Source

Get(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
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.