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

Resource google_sql_database_instance root_password (MS SQL) for GA #5870

Closed
goobysnack opened this issue Mar 10, 2020 · 9 comments · Fixed by GoogleCloudPlatform/magic-modules#3638, #6601 or hashicorp/terraform-provider-google-beta#2173

Comments

@goobysnack
Copy link

Based on #4776

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 v0.12.18
Initializing provider plugins...

  • Checking for available provider plugins...
  • Downloading plugin for provider "random" (hashicorp/random) 2.2.1...
  • Downloading plugin for provider "vault" (hashicorp/vault) 2.8.0...
  • Downloading plugin for provider "google" (hashicorp/google) 3.11.0...
  • Downloading plugin for provider "null" (hashicorp/null) 2.1.2...

Affected Resource(s)

google_sql_database_instance

Terraform Configuration Files

resource "google_sql_database_instance" "master" {
  depends_on       = [random_password.root_password]
  project          = var.project_id
  name             = var.master_name
  database_version = var.db_version
  region           = var.region
  root_password    = random_password.root_password.result
  settings {
    tier             = var.tier
    disk_size        = var.disk_size
    replication_type = "SYNCHRONOUS"

    backup_configuration {
      binary_log_enabled = false
      enabled            = true
    }
    maintenance_window {
      day          = var.maint_day
      hour         = var.maint_hour
    }

    ip_configuration {
<removed>
        }
      }
    }
  }
}

Debug Output

Panic Output

Expected Behavior

The module should accept the root_password argument per https://www.terraform.io/docs/providers/google/r/sql_database_instance.html#root_password
--it says beta, but the issue above indicates it was merged into the GA provider.

Actual Behavior

on .terraform/modules/gcp_csql_instances/main.tf line xx, in resource "google_sql_database_instance" "master":
  22:   root_password    = random_password.root_password.result

An argument named "root_password" is not expected here.

Steps to Reproduce

  1. terraform apply with a root_password configured.

Important Factoids

References

  • #0000
@ghost ghost added the bug label Mar 10, 2020
@edwardmedia edwardmedia self-assigned this Mar 11, 2020
@edwardmedia edwardmedia reopened this Mar 11, 2020
@edwardmedia
Copy link
Contributor

edwardmedia commented Mar 11, 2020

Change this issue to enhancement as the user wants root_password for MS SQL available in GA.
Refer to: GoogleCloudPlatform/magic-modules#2592

@edwardmedia edwardmedia removed their assignment Mar 11, 2020
@edwardmedia edwardmedia removed the bug label Mar 11, 2020
@edwardmedia edwardmedia changed the title Resource google_sql_database_instance not working for MS SQL Resource google_sql_database_instance root_password (MS SQL) for GA Mar 11, 2020
@ghost ghost added the bug label Mar 11, 2020
@edwardmedia edwardmedia removed the bug label Mar 11, 2020
@goobysnack
Copy link
Author

It does work in google-beta. I was told to open an issue to get it moved to google provider. Is that not accurate?

@asbchakri
Copy link

I have the same issue. It works in Provider=google-Beta but nit in Provider = Google

@danawillow danawillow added this to the Near-Term Goals milestone Mar 16, 2020
@asbchakri
Copy link

Any update on when this enhancement will be released

@asbchakri
Copy link

I'm still having issues creating a SQL Server Instance using the Google provider. Can you let me know when this enhancement will be released.

@goobysnack
Copy link
Author

I'm still having issues creating a SQL Server Instance using the Google provider. Can you let me know when this enhancement will be released.

It's working. I just created one. You will need a variable input configuration file, but here's the module. I believe you still have to use the beta provider.

provider "google-beta" {
  credentials = ""
  version     = "~> 3.0"
}

resource "random_password" "root_password" {
  length = 48
  special = true
  override_special = "_^*($@?-+)"
}

// Create SQL Instance

resource "google_sql_database_instance" "master" {
  provider  = google-beta
  depends_on       = [random_password.root_password]
  project          = var.project_id
  name             = var.master_name
  database_version = var.db_version
  region           = var.region
  root_password    = random_password.root_password.result
  settings {
    tier             = var.tier
    disk_size        = var.disk_size

    backup_configuration {
      binary_log_enabled = true
      enabled            = true
    }
    maintenance_window {
      day          = var.maint_day
      hour         = var.maint_hour
    }

    availability_type = "REGIONAL"

    ip_configuration {
      ipv4_enabled = true
      require_ssl = true
      dynamic "authorized_networks" {
        for_each = var.authorized_nets
        iterator = authorized_nets
        content {
         name = "authorized_nets-${authorized_nets.key}"
         value = authorized_nets.value
        }
      }
    }
  }
}

@asbchakri
Copy link

Yes it works with the beta provider, i've been creating instances with that, but what i'm saying is it does not work with Provider=Google and i guess this is what this Enhancement is for.

@goobysnack
Copy link
Author

Yes it works with the beta provider, i've been creating instances with that, but what i'm saying is it does not work with Provider=Google and i guess this is what this Enhancement is for.

Fair point :D

@ghost
Copy link

ghost commented Jul 16, 2020

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!

@ghost ghost locked and limited conversation to collaborators Jul 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.