Code Monkey home page Code Monkey logo

terraform-claranet-default-tags's Introduction

Claranet Terraform default tags module

Claranet's Terraform default tags module is here to help you deploy Claranet's tagging policy on your projects.

Usage

AWS

On AWS you can use module output to set the default_tags parameter of the AWS provider:

module "default_tags" {
  source = "github.com/claranet/claranet-terraform-default-tags"

  environment              = var.environment
}

provider "aws" {
  region     = var.aws_region
  access_key = var.aws_access_key
  secret_key = var.aws_secret_key
  token      = var.aws_token

  default_tags {
    tags = module.default_tags.default_tags
  }
}

You can add any tag you want by merging the output with additional tags:

provider "aws" {
  region     = var.aws_region
  access_key = var.aws_access_key
  secret_key = var.aws_secret_key
  token      = var.aws_token

  default_tags {
    tags = merge(
      module.default_tags.default_tags,
      {
        environment = var.environment
      }
    )
  }
}

Azure

On Azure using Claranet modules you can use the extra_tags parameter:

module "default_tags" {
  source = "github.com/claranet/claranet-terraform-default-tags"

  environment = var.environment
}

module "azure_region" {
  source  = "claranet/regions/azurerm"

  azure_region = var.azure_region
}

module "rg" {
  source  = "claranet/rg/azurerm"

  location    = module.azure_region.location
  client_name = var.client_name
  environment = var.environment
  stack       = var.stack

  extra_tags = module.default_tags.default_tags
}

Requirements

Name Version
terraform >= 1
git >= 2023.1.20

Providers

Name Version
git >= 2023.1.20

Modules

No modules.

Resources

Name Type
git_remotes.current data source

Inputs

Name Description Type Default Required
application_stack_name Application stack name string null no
custom_iac_git_url Optional custom iac git url string null no
deployed_by How the resources are managed string "terraform" no
environment What is the environment of the resources string n/a yes
git_remote_name Git remote name string "origin" no
managed_by Who is managing the resources string "claranet" no
owner Who is owner of the resources string null no
stack Terraform stack name string null no
supervised_by Who is supervising the resources string "claranet" no
synapps_project_id Project ID as defined in Claranet SynApps CMDB to set the claranet_project_id tag string null no
synapps_status Resource status as defined in Claranet SynApps CMDB to override the status field string null no

Outputs

Name Description
default_tags Generated default tags.

Development

To automatically install required plugins and versions with asdf use:

make dev-install

asdf

asdf allows to easily manage tools version per project. See documentation for installation instructions.

Versions are described in the .tool-versions file. If you already have the required plugins installed, simply run:

asdf install

pre-commit

To enable pre-commit hooks, run:

pre-commit install

terraform-docs

To update Terraform documentation in README.md run:

make docs

tflint and tfsec

To manually run linters run:

make lint

terraform-claranet-default-tags's People

Contributors

nsenaud avatar semantic-release-bot avatar pdecat avatar shr3ps avatar zfiel avatar

Watchers

Adrien Pestel avatar Spi avatar  avatar  avatar Arnaud Dematte avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.