/terraform-aws-ssm-key-group

Terraform module that allows to define a group of variables in a project

Primary LanguageHCL

terraform-aws-ssm-key-group

Resource that allows to declare multiple variables in map, and for each of them creates a new AWS SSM key resource.

Requirements

Name Version
terraform >= 0.13
aws >= 3.27.0

Providers

Name Version
aws >= 3.27.0

Resources

Name Type
aws_ssm_parameter.default resource

Providers

Name Version
aws >= 3.27.0

Inputs

Name Description Type Default Required
name_parts Parts of ssm variable name list(string) n/a yes
env_object Map with ssm variable name and its value map(string) n/a yes
description Description that will be passed to each variable string "" no
type Available (String, StringList, SecureString) string "String" no
key_id Key id that will be passed to each variable any null no
tags Tags of resource. Provided values will be merged with default_tags map(string) {} no
default_tags Default tags that will be merged with var.tags map(string)
{
"ManagedBy": "terraform",
"Module": "ssm-key-group"
}
no

Examples

Basic example

module "string_ssm_keys" {
  source     = "git@github.com:masterborn/terraform-aws-ssm-key-group.git?ref=v1.0.2"
  name_parts = [local.tags["Module"]]

  env_object = merge(
    {
      VPC_ID     = var.vpc_id
      SUBNET_IDS = join(",", var.subnet_ids)
      NODE_ENV   = "production"
    },
    var.string_keys
  )

  tags = local.tags
}

Secure string example

module "secure_string_ssm_keys" {
  source     = "git@github.com:masterborn/terraform-aws-ssm-key-group.git?ref=v1.0.2"
  name_parts = [local.tags["Module"]]

  type   = "SecureString"
  key_id = module.main-kms.key_id

  env_object = var.secret_string_keys

  tags = local.tags
}

Enabling pre-commit hooks

Following pre-commit hooks are provided:

Requirements

Installation

To install pre-commit check .

pre-commit install