Resource: aws_secretsmanager_secret

Provides a resource to manage AWS Secrets Manager secret metadata. To manage secret rotation, see the aws_secretsmanager_secret_rotation resource. To manage a secret value, see the aws_secretsmanager_secret_version resource.

Example Usage

Basic

resource "aws_secretsmanager_secret" "example" {
  name = "example"
}

Argument Reference

This resource supports the following arguments:

replica

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

replica

Import

In Terraform v1.5.0 and later, use an import block to import aws_secretsmanager_secret using the secret Amazon Resource Name (ARN). For example:

import {
  to = aws_secretsmanager_secret.example
  id = "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-123456"
}

Using terraform import, import aws_secretsmanager_secret using the secret Amazon Resource Name (ARN). For example:

% terraform import aws_secretsmanager_secret.example arn:aws:secretsmanager:us-east-1:123456789012:secret:example-123456