-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I rename resources? #332
Comments
Hi @manfred0191... great that you've got this working and you're on the right track. Due to the extra Resource Groups needed for
As such you need to use the following: advanced = {
custom_settings_by_resource_type = {
azurerm_resource_group = {
connectivity = {
westeurope = { # replace with the location you're using
name = "rg-fits-test-connectivity"
}
}
... Note that there are also multiple Resource Groups for different resource categories, as per the broader context of the local setting these: terraform-azurerm-caf-enterprise-scale/modules/connectivity/locals.tf Lines 243 to 264 in c773f61
Hope this helps? |
Just going to cross-reference #292 as these requests are related. |
You are perfect, but I guess you know that ;) And now the final question: For the recource groups virtual_wan, dns and ddos, is it done accordingly and in the same advanced block? Can you maybe give an example as of how to do it for all 4 RGs ?? |
Forget it, I got it:
Anyway thanks so much for your help !!! |
That's the one 😄 |
For the virtual network, the procedure is the same, but how do I do it for the virtual network gateways and the corresponding public IPs? There is a distinction between ergw and vpngw and I don't see how to implement that |
Same basic structure but you have to reference
and
resulting in: advanced = {
custom_settings_by_resource_type = {
azurerm_virtual_network_gateway = {
expressroute = {
(var.location) = {
name = "expressroute-gateway"
}
},
vpn = {
(var.location) = {
name = "vpn-gateway"
}
}
}
}
}
}
} |
Funny you should mention that resource as I was just discussing this with a colleague this morning. That and the Resource Group created by the For now the PIP resources will all be named after their associated resources, whether gateway of firewall. And the Policy created one will always be Awaiting these to be added as issues, but will track against this too. Both an easy fix and not breaking changes, so expect an upcoming hotfix release soon. cc: @mbilalamjad |
If the issue number 292 is not sufficient for that, I can easily open a new one. As always thank you so much for your help! |
Actually, scrap the above thought... I would like dedicated issues for each to simplify tracking and sign-off. I've asked @mbilalamjad to do this as he was originally requesting, but happy for you to do so if you would like to. Regarding the "recommended naming" from CAF which you mention in #292, we consider this to be more general guidance for those who want something to follow. I cannot speak for why ES chose not to follow this convention as that decision was made before I joined the team, but the Terraform module follows the ES convention for consistency. Given the number of requests relating to this, I will look into how feasible this is to incorporate but would need to be controlled via a feature flag to make it a non-breaking change for all customers who are happy with the current naming scheme. |
Thanks Kevin, so I will let @mbilalamjad open the request. Yes, I agree, it also surpises me that the suggested naming convention for Azure resources has not been taken into consideration. But it is like it is. If one can change it, everything is fine. |
Made progress on PIP renaming in the code for our next release: This uses the same standard as before with regard to referencing resource types at a scope. Just a heads up though... For the greater good of anyone who uses this in the future, I am also simplifying the |
@manfred0191 - IMPORTANT Please take note of the PR description on #331 so you're aware of the breaking changes before upgrading when this code is merged and released! We will do our best to document this clearly, but want to raise additional awareness. |
Sounds great. I already told you that you're the best. Nothing to add to that. |
Release Please see the release notes for more information: I will close this issue as I believe we've dealt with it, but please feel free to open a new one if you require further assistance. |
Hi,
I am looking for a possibility to give all resources deployed by the model a name by my individual naming convention.
To do this I wanted to start with the resource groups.
For the management resource group, I can add in my settings_management.tf
and the resource group gets the name specified and no longer the "rootid-mgmt" which is otherwise given.
For the connectivity this doesn't work. If setting in the settings_connectivity.tf
the resource group gets the name "rootid-connectivity-location" as before.
What do I have to set in the settings_connectivity.tf under advanced so that the name is given like I want it to be for all resource groups deployed in the connectivity subscription??
The text was updated successfully, but these errors were encountered: