Skip to content

Terraform module to manage organization wide standard tag structure and minimum required tags

License

Notifications You must be signed in to change notification settings

clowdhaus/terraform-aws-tags

Repository files navigation

Tags Module

Provides both tag validation as well as ensuring required tags are populated.

Example:

module "tags" {
  source  = "clowdhaus/tags/aws"

  application = "serverless-gitops-infrastructure"
  environment = "nonprod"
  repository  = "github.com/serverless-delivery/serverless-gitops-infrastructure"
}

From this module, the output will provide tags in the following format:

{
  "Application" = "serverless-gitops-infrastructure",
  "CreatedBy = "terraform"
  "DeployedBy" = "arn:aws:iam::012345678910:role/terraform-role",
  "Environment" = "nonprod",
  "Repository" = "github.com/serverless-delivery/serverless-gitops-infrastructure"
}

As well as a formatted output for use in autoscaling groups with tag propogation:

[
  {
    key = "Application",
    value = "serverless-gitops-",
    propogate_at_launch = true
  }, {
    key = "CreatedBy,
    value = "terraform",
    propagate_at_launch = true
  },
    key = "DeployedBy",
    value = "arn:aws:iam::012345678910:role/terraform-role",
    propagate_at_launch = true
  }, {
    key = "Environment",
    value = "nonprod",
    propagate_at_launch = true
  }, {
    key = "Repository",
    value = "github.com/serverless-delivery/serverless-gitops-infrastructure",
    propagate_at_launch = true
  }
]

Requirements

Name Version
terraform >= 1.0
aws >= 4.0

Providers

Name Version
aws >= 4.0

Modules

No modules.

Resources

Name Type
aws_caller_identity.current data source

Inputs

Name Description Type Default Required
application Application name and/or identifier string null no
created_by The framework, tool, and/or method that created this resource - terraform, serverless, pulumi, manual, etc. string "terraform" no
environment The environment does this resource belong to? - sandbox, nonprod, prod string n/a yes
repository The repository name where this resource is managed and codified string n/a yes

Outputs

Name Description
asg_tags Tags which are appropriate auto scaling group (i.e. as a list of maps). See: https://www.terraform.io/docs/providers/aws/r/autoscaling_group.html
tags Tags which are applicable to all resources - map of {key: value} pairs

License

Apache-2.0 Licensed. See LICENSE.

About

Terraform module to manage organization wide standard tag structure and minimum required tags

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages