Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/santiagoagustinplaza/azure-modules-metadata-validation
https://github.com/santiagoagustinplaza/azure-modules-metadata-validation
Last synced: about 22 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/santiagoagustinplaza/azure-modules-metadata-validation
- Owner: santiagoagustinplaza
- Created: 2024-10-28T21:49:48.000Z (22 days ago)
- Default Branch: main
- Last Pushed: 2024-10-28T23:58:41.000Z (22 days ago)
- Last Synced: 2024-10-29T00:18:19.676Z (22 days ago)
- Language: HCL
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Azure Modules Metadata Validation
This Terraform module generates a standardized name for resources based on the provided `environment`, `project_id`, `location`, and a `provided_name`. It outputs the `constructed_name`(whose length does not exceed 24 characters) in the format `"env_code"+"project_id"+"location_code"+"provided_name"` using preset codes for the environment and location. It validates the allowed `project_id` list for resource deployment. The module also outputs a standardized set of `tags` for tracking resource metadata and ensures that the resources can be deployed on an appropiate resource group validating it with its tags. For this it requires the `resource_group_name`.
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.5.0 |
| [null](#requirement\_null) | >= 3.2.3 |## Usage
```hcl
module "metadata_validation" {
source = "./modules/metadata_validation"resource_name = "myResource"
environment = "production"
project_id = "2345"
location = "centralus"
resource_group_name = "myResourceGroup"
}
```
## Inputs| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [environment](#input\_environment) | The environment of the resource (must be 'production' or 'development') | `string` | n/a | yes |
| [location](#input\_location) | The Azure location of the resource | `string` | n/a | yes |
| [project\_id](#input\_project\_id) | The project ID (4 numeric characters) | `string` | n/a | yes |
| [provided\_name](#input\_provided\_name) | The name of the resource to construct the full name | `string` | n/a | yes |
| [resource\_group\_name](#input\_resource\_group\_name) | The name of the resource group | `string` | n/a | yes |## Outputs
| Name | Description |
|------|-------------|
| [constructed\_name](#output\_constructed\_name) | Output for the constructed name |
| [tags](#output\_tags) | Output for the tags |