Module library

Secrets Manager

Terraform module to create AWS Secrets Manager resources

Inputs

28
block_public_policyoptionalbool

Makes an optional API call to Zelkova to validate the Resource Policy to prevent broad access to your secret

Defaultnull
createoptionalbool

Determines whether resources will be created (affects all resources)

Defaulttrue
create_policyoptionalbool

Determines whether a policy will be created

Defaultfalse
create_random_passwordoptionalbool

Determines whether an ephemeral random password will be generated for `secret_string_wo`

Defaultfalse
descriptionoptionalstring

A description of the secret

Defaultnull
enable_rotationoptionalbool

Determines whether secret rotation is enabled

Defaultfalse
force_overwrite_replica_secretoptionalbool

Accepts boolean value to specify whether to overwrite a secret with the same name in the destination Region

Defaultnull
ignore_secret_changesoptionalbool

Determines whether or not Terraform will ignore changes made externally to `secret_string` or `secret_binary`. Changing this value after creation is a destructive operation

Defaultfalse
kms_key_idoptionalstring

ARN or Id of the AWS KMS key to be used to encrypt the secret values in the versions stored in this secret. If you need to reference a CMK in a different account, you can use only the key ARN. If you don't specify this value, then Secrets Manager defaults to using the AWS account's default KMS key (…

Defaultnull
nameoptionalstring

Friendly name of the new secret. The secret name can consist of uppercase letters, lowercase letters, digits, and any of the following characters: `/_+=.@-`

Defaultnull
name_prefixoptionalstring

Creates a unique name beginning with the specified prefix

Defaultnull
override_policy_documentsoptionallist(string)

List of IAM policy documents that are merged together into the exported document. In merging, statements with non-blank `sid`s will override statements with the same `sid`

Default[]
policy_statementsoptionalmap(object({ sid = optional(string) actions = optional(list(string)) not_actions…

A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage

Defaultnull
random_password_lengthoptionalnumber

The length of the generated random password

Default32
random_password_override_specialoptionalstring

Supply your own list of special characters to use for string generation. This overrides the default character list in the special argument

Default!@#$%&*()-_=+[]{}<>:?
recovery_window_in_daysoptionalnumber

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`

Defaultnull
regionoptionalstring

Region where the resource(s) will be managed. Defaults to the Region set in the provider configuration

Defaultnull
replicaoptionalmap(object({ kms_key_id = optional(string) region = optional(string) # will defa…

Configuration block to support secret replication

Defaultnull
rotate_immediatelyoptionalbool

Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. The rotation schedule is defined in `rotation_rules`

Defaultnull
rotation_lambda_arnoptionalstring

Specifies the ARN of the Lambda function that can rotate the secret

Default""
rotation_rulesoptionalobject({ automatically_after_days = optional(number) duration = optional(string)…

A structure that defines the rotation configuration for this secret

Defaultnull
secret_binaryoptionalstring

Specifies binary data that you want to encrypt and store in this version of the secret. This is required if `secret_string` or `secret_string_wo` is not set. Needs to be encoded to base64

Defaultnull
secret_stringoptionalstring

Specifies text data that you want to encrypt and store in this version of the secret. This is required if `secret_binary` or `secret_string_wo` is not set

Defaultnull
secret_string_wooptionalstring

Specifies text data that you want to encrypt and store in this version of the secret. This is required if `secret_binary` or `secret_string` is not set

Defaultnull
secret_string_wo_versionoptionalstring

Used together with `secret_string_wo` to trigger an update. Increment this value when an update to `secret_string_wo` is required

Defaultnull
source_policy_documentsoptionallist(string)

List of IAM policy documents that are merged together into the exported document. Statements must have unique `sid`s

Default[]
tagsoptionalmap(string)

A map of tags to add to all resources

Default{}
version_stagesoptionallist(string)

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

Defaultnull

All 28 are optional — the module deploys with none of them set.

Outputs

7
secret_arn

The ARN of the secret

secret_binary

The secret binary

secret_id

The ID of the secret

secret_name

The name of the secret

secret_replica

Attributes of the replica created

secret_string

The secret string

secret_version_id

The unique identifier of the version of the secret

What the agent wires into the next module. An edge on the architecture diagram is one of these consumed by something else.