Skip to content
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

Google Cloud SQL Instance MSSQL collation prevents any modification to settings block #11947

Closed
mcdermg opened this issue Jun 24, 2022 · 4 comments · Fixed by GoogleCloudPlatform/magic-modules#6298, hashicorp/terraform-provider-google-beta#4505 or #12131
Assignees
Labels

Comments

@mcdermg
Copy link

mcdermg commented Jun 24, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.2.3
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v4.26.0
  • provider registry.terraform.io/hashicorp/random v3.3.2

Affected Resource(s)

  • google_sql_database_instance

Terraform Configuration Files

resource "random_id" "suffix" {
  byte_length = 5
}

resource "random_password" "password" {
  length           = 16
  special          = true
  override_special = "()-=<>"
}

resource "google_sql_database_instance" "test" {
  name                = "testing-${lower(random_id.suffix.id)}"
  region              = "us-central1"
  database_version    = "SQLSERVER_2017_STANDARD"
  deletion_protection = false

  root_password       = random_password.password.result


  settings {
    pricing_plan = "PER_USE"
    tier         = "db-custom-2-3840"
    disk_type    = "PD_SSD"
    collation    = "Latin1_General_BIN"
    ip_configuration {
      ipv4_enabled       = false
      private_network    = google_compute_network.vpc.id
      allocated_ip_range = "google-managed-services-default"
    }
  }
}

Addition of an authorized network (Although it appears any setting in the settings block will produce a similar error)

resource "random_id" "suffix" {
  byte_length = 5
}

resource "random_password" "password" {
  length           = 16
  special          = true
  override_special = "()-=<>"
}

resource "google_sql_database_instance" "test" {
  name                = "testing-${lower(random_id.suffix.id)}"
  region              = "us-central1"
  database_version    = "SQLSERVER_2017_STANDARD"
  deletion_protection = false

  root_password       = random_password.password.result


  settings {
    pricing_plan = "PER_USE"
    tier         = "db-custom-2-3840"
    disk_type    = "PD_SSD"
    collation    = "Latin1_General_BIN"
    ip_configuration {
      ipv4_enabled       = false
      private_network    = google_compute_network.vpc.id
      allocated_ip_range = "google-managed-services-default"
      authorized_networks {
        name  = "testing"
        value = "186.22.152.169"
      }
    }
  }
}

Debug Output

https://gist.github.com/mcdermg/40a5579981199da144c52eb3cb79693b

Panic Output

N/A

Expected Behavior

The settings block should be updated in place. In the case of adding an authored network. Addition of the specified network/s.

Actual Behavior

Terraform encounters the following error

╷
│ Error: Error, failed to update instance settings for : googleapi: Error 400: Invalid request: Unsupported setting key: collation., invalid
│ 
│   with google_sql_database_instance.test,
│   on main.tf line 11, in resource "google_sql_database_instance" "test":
│   11: resource "google_sql_database_instance" "test" {
│ 

Although the collation is not being altered the API rejects the change to the settings of the instance.

Steps to Reproduce

  1. Deploy a Google Cloud SQL Instance of type SQL-Server with the parameter collation configured to a non default value.
  2. terraform apply
  3. Change some configuration on the Instance in the settings block or add an additional attribute
  4. terraform apply

References

@mcdermg mcdermg added the bug label Jun 24, 2022
@mcdermg
Copy link
Author

mcdermg commented Jun 24, 2022

@c2thorn the issue discussed in relation to the collation that was encountered by client earlier this week

@c2thorn c2thorn self-assigned this Jun 24, 2022
@mcdermg
Copy link
Author

mcdermg commented Jul 13, 2022

@c2thorn Any update on this, client was asking if there is an ETA on a fix?

@c2thorn
Copy link
Collaborator

c2thorn commented Jul 13, 2022

@mcdermg planning on having the fix in by next available release cut, which would place the ETA for release on July 25th

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.