hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.89k stars 9.22k forks source link

fsx ontap SVM Requires Replacement due to domain_name Case Changes #22276

Open khan-belal opened 2 years ago

khan-belal commented 2 years ago

Community Note

Terraform CLI and Terraform AWS Provider Version

I am using Terraform 1.0.11 with 3.70.0 as the AWS provider.

Affected Resource(s)

Terraform Configuration Files

I have an SVM setup using a self managed AD.

Whenever I push changes after the SVM has been created, terraform wants to replace the SVM as the case of the domain name has changed from lower to upper case.

Nothing from my SVM code has changed between pushes.

See example code below:

active_directory_configuration {

    self_managed_active_directory_configuration {
      dns_ips       = aws_directory_service_directory.my-AD.dns_ip_addresses
      domain_name   = aws_directory_service_directory.my-AD.name

The first time I run this code, the SVM is created successfully. On subsequent changes, I get the following output:

~ self_managed_active_directory_configuration {
              ~ domain_name                             = "MYDOMAN.COM" -> "mydomain.com" # forces replacement

The only way I have got past this issue is to use the upper() function around the domain_name reference.

  1. Why is my domain changing case?
  2. Why is this field case sensitive?
justinretzolk commented 2 years ago

Hey @khan-belal 👋 Thank you for taking the time to raise this. So that we have all of the information necessary to look into this, can you update the issue description with the rest of the information requested in the bug report template?