Skip to content

Terraform/OpenTofu module that simplifies the process of applying the correct AWS tags to Northwood Labs resources.

License

Notifications You must be signed in to change notification settings

northwood-labs/mod-aws-resource-tags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seal of ApprovalSeal of Approval

AWS Resource Tags Module

AWS Terraform OpenTofu Golang Node.js

Simplifies the process of applying the correct AWS tags to Northwood Labs resources.

Information Description
Terraform Versions 1.6, 1.7, 1.8
OpenTofu Versions 1.6, 1.7

Features

  • Designed to be highly composable, and has no hard-dependencies on other modules.

  • Integration tests run automatically on every commit against supported versions of Terraform/OpenTofu.

  • Outputs can be easily used with other modules or resources which support tagging.

  • Adds tag data about the ARN of the user who performed the deployment, as well as a timestamp of the deployment.

  • Only looks-up data, but does not persist any data itself, making it completely stateless.

  • Purpose-built, meaning that it is designed to solve a single orthogonal problem. Aims to fit 90% of use-cases.

Examples

More examples can be found in the ./examples directory.

# Load the module
module "aws_resource_tags" {
  source = "https://github.com/northwood-labs/mod-aws-resource-tags.git?ref={tag}"

  app = "sample-app"
  env = "sandbox"
}

Requirements

Name Provider Version
terraform ~> 1.6
aws hashicorp/aws ~> 5.42

Inputs

Req Variable Type Description Default
app string The app tag. Lowercase and hyphenated.
env string The env tag. Lowercase.
extra map Additional (ad hoc) tags to apply. {}

Outputs

Name Description
app The value of the app input variable.
common_tags Most services support simple key = value pairs.
deployed_at The RFC 3339 at which the resources were deployed.
deployed_by The ARN of the assumed role which performed the deployment.
env The value of the env input variable.
launch_template_resource_tags Tags formatted for use with Launch Templates.
region The AWS region in which the resources are being created.

Resources

Kind Source Name Provider
data source data.aws_caller_identity current hashicorp/aws
data source data.aws_region current hashicorp/aws

Testing

For integration tests, we use the Terratest testing framework. All of the building and testing dependencies are bundled-up as a Docker image, so see northwood-labs/dev-env before running these tests.

These tests create real resources, which cost real money.

make test

About

Terraform/OpenTofu module that simplifies the process of applying the correct AWS tags to Northwood Labs resources.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published