-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
r/kubernetes_cluster: addon_profile.oms_agent.log_analytics_workspace_id should validate the casing #10517
Comments
@favoretti, pinging you since you worked on the original solution. |
@pedrohdz interesting.. My patch is still there. We might need a state migration here. It's not a new resource I assume? |
@favoretti, |
Ah, that's why. Proper casing for the resource is the way terraform sets it. Ideally you'd want to fetch that ID back from the resource that created it as |
Azure API resource ID casing isn't super stable, changes from resource to resource, etc, so TF currently constructs consistent casing pretty much in all of the resources regardless of what API gives back. If you still want to use static strings - look into the resource package source code in |
As mentioned above you'll need to update the casing passed in here - but we should also update the validation used on this field to ensure the casing for this field |
@favoretti If I'm reading you correctly, the output from |
@pedrohdz correct, if you reference using the Data Source or Resource directly, Terraform will update the casing in the background - as such we generally recommend using a Data Source (or Resource) reference to pass the ID's along. Going forwards Terraform will be fixing the casing on some of these older resources to workaround some subtle issues within the Azure API, but this is a gradual effort rather than a big-bang - but we're trying to add validation as we pass through doing this |
@tombuildsstuff and @favoretti, Are these best practices for the AzureRM provider documented anywhere? I looked around and could not find anything. |
@pedrohdz they're captured in Terraform's documentation - as a general rule we recommend using Resource/Data Source references since it allows us to correctly identify the position of things in the Graph (e.g. if we have a Resource Group, a Network and a Subnet - we can track we should delete the Subnet before the Network before the Resource Group) - but it also gives the side-effect of ensuring the casing is consistent. Unfortunately the Azure API's are slightly misleading, whilst there's some guidance on Resource ID's, in practice each API implements Resource ID parsing sufficiently differently (some case-sensitively, some case-insensitively, some returning the incorrect casing, some returning it as it was submitted..) that we're forced to treat these as case sensitive (and as mentioned above we're trying our best to fix these as time goes on). As such whilst this guidance can apply to the other Providers - it's most applicable to Azure due to the ID's being URI's rather than (say) a UUID (or similar) in other providers. |
This has been released in version 2.47.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.47.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.12.29
Your version of Terraform is out of date! The latest version
is 0.14.6. You can update by downloading from https://www.terraform.io/downloads.html
Affected Resource(s)
azurerm_kubernetes_cluster
Actual Behaviour
Same exact issue as in #9151. Looks like this might have not been fixed, or regressed?
@anhlqn mentioned that they are experiencing the same issue in #9151 (comment).
References
The text was updated successfully, but these errors were encountered: