Skip to content

ModeSevenIndustrialSolutions/terraform-aws-mandatory-tags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tags Module

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

Usage

module "tags" {
  source  = "shared/tags"

  application = "Access to AWS storage environment"
  creator = "terraform"
  created = "2023-08-22"
  account = "arn:aws:iam::012345678910:role/terraform-role"
  environment = "production"
  billing = "OS-Climate"
  origin  = "github.com/os-climate/terraform/terraform/shared/tags"
}

Output

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

{
  "application" = "Access to AWS storage environment",
  "creator" = "terraform"
  "created" = "2023-08-22"
  "account" = "arn:aws:iam::012345678910:role/terraform-role",
  "environment" = "production",
  "billing" = "OS-Climate",
  "origin" = "github.com/os-climate/terraform/terraform/shared/tags"
}

Code example:

[
  {
	key = "application",
	value = "Access to AWS storage environment",
	propogate_at_launch = true
  }, {
	key = "creator,
	value = "terraform",
	propagate_at_launch = true
  },
  	key = "created",
	value = "2023-08-22T15:43",
	propagate_at_launch = true
  }, {
	key = "account",
	value = "arn:aws:iam::012345678910:role/terraform-role",
	propagate_at_launch = true
  }, {
	key = "environment",
	value = "production",
	propagate_at_launch = true
  }, {
	key = "billing",
	value = "OS-Climate",
	propagate_at_launch = true
  }, {
	key = "origin",
	value = "github.com/os-climate/terraform/terraform/shared/tags",
	propagate_at_launch = true
  }
]

Requirements

Providers

Name Version
aws N/A

Modules

No modules.

Resources

Name Type
aws_caller_identity.current data source
aws_caller_identity.current.user_id data source

Inputs

Name Description Type Default Required
application Application name and/or identifier string null yes
creator The framework, tool, and/or method that created this resource - terraform, serverless, pulumi, manual, etc. string "terraform" yes
creator The date this resource was created in %Y-%m-%d format string "terraform" yes
account The IAM user or role that deployed the infrastructure string n/a yes
environment The environment does this resource belong to? - sandbox, nonprod, prod string n/a yes
billing The organisation/project/entity responsible for resource costs string n/a yes
origin The repository where the relevant code is stored string n/a yes

Outputs

Name Description
tags Tags which are applicable to all resources - map of {key: value} pairs

License

Mozilla Public License Version 2.0

About

Terraform module to implement mandatory metadata/tags

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages