Skip to content

Latest commit

 

History

History
118 lines (93 loc) · 2.57 KB

vault_database_secret_backend_static_role.md

File metadata and controls

118 lines (93 loc) · 2.57 KB

vault_database_secret_backend_static_role

back

Index

Terraform

terraform {
  required_providers {
    vault = ">= 2.19.0"
  }
}

top

Example Usage

module "vault_database_secret_backend_static_role" {
  source = "./modules/vault/r/vault_database_secret_backend_static_role"

  # backend - (required) is a type of string
  backend = null
  # db_name - (required) is a type of string
  db_name = null
  # name - (required) is a type of string
  name = null
  # rotation_period - (required) is a type of number
  rotation_period = null
  # rotation_statements - (optional) is a type of list of string
  rotation_statements = []
  # username - (required) is a type of string
  username = null
}

top

Variables

variable "backend" {
  description = "(required) - The path of the Database Secret Backend the role belongs to."
  type        = string
}

variable "db_name" {
  description = "(required) - Database connection to use for this role."
  type        = string
}

variable "name" {
  description = "(required) - Unique name for the static role."
  type        = string
}

variable "rotation_period" {
  description = "(required) - The amount of time Vault should wait before rotating the password, in seconds."
  type        = number
}

variable "rotation_statements" {
  description = "(optional) - Database statements to execute to rotate the password for the configured database user."
  type        = list(string)
  default     = null
}

variable "username" {
  description = "(required) - The database username that this role corresponds to."
  type        = string
}

top

Resource

resource "vault_database_secret_backend_static_role" "this" {
  # backend - (required) is a type of string
  backend = var.backend
  # db_name - (required) is a type of string
  db_name = var.db_name
  # name - (required) is a type of string
  name = var.name
  # rotation_period - (required) is a type of number
  rotation_period = var.rotation_period
  # rotation_statements - (optional) is a type of list of string
  rotation_statements = var.rotation_statements
  # username - (required) is a type of string
  username = var.username
}

top

Outputs

output "id" {
  description = "returns a string"
  value       = vault_database_secret_backend_static_role.this.id
}

output "this" {
  value = vault_database_secret_backend_static_role.this
}

top