claranet / terraform-azurerm-rg Goto Github PK
View Code? Open in Web Editor NEWTerraform module for Azure Resource Group
License: Apache License 2.0
Terraform module for Azure Resource Group
License: Apache License 2.0
1.4.6
3.61.0
azurerm_resource_group
I'm using Terragrunt, but essentially what I do is
locals {
g_vars = read_terragrunt_config(find_in_parent_folders("global.hcl"))
e_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
r_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
path_suffix = g_vars.locals.path_suffix
resource_name_suffix = "001"
tags = merge(
local.g_vars.inputs.global_tags,
local.e_vars.inputs.env_tags,
local.r_vars.inputs.region_tags,
{
# any additional local tags
tf_path = "${local.path_suffix}/${path_relative_to_include()}"
})
}
inputs = {
# use values merged from included configs
location = dependency.region.outputs.location
name = dependency.region.outputs.name
name_suffix = local.resource_name_suffix
extra_tags = merge(
local.tags
)
}
Terraform will perform the following actions:
# azurerm_resource_group.main_rg will be created
+ resource "azurerm_resource_group" "main_rg" {
+ id = (known after apply)
+ location = "eastus"
+ name = "rg-infra-xxx-prod"
+ tags = {
+ "client" = "xxx"
+ "env" = "prod"
+ "repository" = "xxx"
+ "stack" = "infra"
+ "tf_managed" = "true"
+ "tf_path" = "envs/prod/eastus/rg-001"
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Changes to Outputs:
+ resource_group_id = (known after apply)
+ resource_group_location = "eastus"
+ resource_group_name = "rg-infra-xxx-prod"
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
### Expected Behaviour
Resource name should be `rg-infra-xxx-prod-001`
### Actual Behaviour
REsource is `rg-infra-xxx-prod`
### Steps to Reproduce
_No response_
### Important Factoids
_No response_
### References
_No response_
I'm wondering if it would be possible to extend the default tags with new tags indicating who/what and when created a particular resource group, that is, something like:
tags = {
created_at = timestamp()
created_by = data.azuread_directory_object.terraform.object_id
}
Perhaps it could be added via a new set of tags, along with default
and extra
, and controlled with new variable creator_tags_enabled
.
Perhaps such feature would be sensible across all modules creating resources where tags
are supported.
I'd be interested to hear your comments on this idea.
azurerm_resource_group
resource "azurerm_resource_group" "main" {
name = data.azurecaf_name.main_rg.result
location = module.azure_region.location
tags = {
created_at = timestamp()
created_by = data.azuread_directory_object.terraform.object_id
}
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.