Retrieve metadata information about a Secrets Manager secret. To retrieve a secret value, see the aws_secretsmanager_secret_version
data source.
data "aws_secretsmanager_secret" "by-arn" {
arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-123456"
}
data "aws_secretsmanager_secret" "by-name" {
name = "example"
}
arn
- (Optional) ARN of the secret to retrieve.name
- (Optional) Name of the secret to retrieve.This data source exports the following attributes in addition to the arguments above:
arn
- ARN of the secret.created_date
- Created date of the secret in UTC.description
- Description of the secret.kms_key_id
- Key Management Service (KMS) Customer Master Key (CMK) associated with the secret.id
- ARN of the secret.last_changed_date
- Last updated date of the secret in UTC.policy
- Resource-based policy document that's attached to the secret.tags
- Tags of the secret.