Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/claranet/terraform-azurerm-tagging

Terraform module for Resources Tagging
https://github.com/claranet/terraform-azurerm-tagging

azure claranet module terraform

Last synced: 2 months ago
JSON representation

Terraform module for Resources Tagging

Awesome Lists containing this project

README

        

# Azure tagging
[![Changelog](https://img.shields.io/badge/changelog-release-green.svg)](CHANGELOG.md) [![Notice](https://img.shields.io/badge/notice-copyright-blue.svg)](NOTICE) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-orange.svg)](LICENSE) [![OpenTofu Registry](https://img.shields.io/badge/opentofu-registry-yellow.svg)](https://search.opentofu.org/module/claranet/tagging/azurerm/)

This Terraform helper allows to merge or overwrite tags on a resource.

## Global versioning rule for Claranet Azure modules

| Module version | Terraform version | OpenTofu version | AzureRM version |
| -------------- | ----------------- | ---------------- | --------------- |
| >= 8.x.x | **Unverified** | 1.8.x | >= 4.0 |
| >= 7.x.x | 1.3.x | | >= 3.0 |
| >= 6.x.x | 1.x | | >= 3.0 |
| >= 5.x.x | 0.15.x | | >= 2.0 |
| >= 4.x.x | 0.13.x / 0.14.x | | >= 2.0 |
| >= 3.x.x | 0.12.x | | >= 2.0 |
| >= 2.x.x | 0.12.x | | < 2.0 |
| < 2.x.x | 0.11.x | | < 2.0 |

## Contributing

If you want to contribute to this repository, feel free to use our [pre-commit](https://pre-commit.com/) git hook configuration
which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.

More details are available in the [CONTRIBUTING.md](./CONTRIBUTING.md#pull-request-process) file.

## Usage

This module is optimized to work with the [Claranet terraform-wrapper](https://github.com/claranet/terraform-wrapper) tool
which set some terraform variables in the environment needed by this module.
More details about variables set by the `terraform-wrapper` available in the [documentation](https://github.com/claranet/terraform-wrapper#environment).

⚠️ Since modules version v8.0.0, we do not maintain/check anymore the compatibility with
[Hashicorp Terraform](https://github.com/hashicorp/terraform/). Instead, we recommend to use [OpenTofu](https://github.com/opentofu/opentofu/).

```hcl
module "myresource_tagging" {
source = "claranet/tagging/azurerm"
version = "x.x.x"

nb_resources = 2
resource_ids = [var.myresource_id_1, var.myresource_id_2]
behavior = "merge" # Must be "merge" or "overwrite"

tags = {
"foo" = "bar"
"monitoring" = "true"
}
}
```

## Providers

| Name | Version |
|------|---------|
| azurerm | >= 1.31 |
| null | >= 2 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [null_resource.tags](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| behavior | Behavior for tags applying. Must be `merge` or `overwrite`. | `string` | `"merge"` | no |
| force | True to apply every time | `bool` | `false` | no |
| interpreter | System interpreter to use for tagging script. | `string` | `"bash"` | no |
| nb\_resources | Number of resources to tag | `number` | n/a | yes |
| resource\_ids | Id of the Azure resources to tag | `list(string)` | n/a | yes |
| tags | Tags to apply on resource | `map(string)` | n/a | yes |

## Outputs

No outputs.

## Related documentation

Microsoft Azure tagging documentation: [docs.microsoft.com/fr-fr/azure/azure-resource-manager/resource-group-using-tags](https://docs.microsoft.com/fr-fr/azure/azure-resource-manager/resource-group-using-tags)