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 #3638

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,13 @@ settings.backup_configuration.binary_log_enabled are both set to true.`,
<% end -%>


<% unless version == 'ga' -%>
"root_password": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Sensitive: true,
Description: `Initial root password. Required for MS SQL Server, ignored by MySQL and PostgreSQL.`,
},
<% end -%>

"ip_address": {
Type: schema.TypeList,
Expand Down Expand Up @@ -641,12 +639,10 @@ func resourceSqlDatabaseInstanceCreate(d *schema.ResourceData, meta interface{})
ReplicaConfiguration: expandReplicaConfiguration(d.Get("replica_configuration").([]interface{})),
}

<% unless version == 'ga' -%>
// MSSQL Server require rootPassword to be set
if strings.Contains(instance.DatabaseVersion, "SQLSERVER") {
instance.RootPassword = d.Get("root_password").(string)
}
<% end -%>

// Modifying a replica during Create can cause problems if the master is
// modified at the same time. Lock the master until we're done in order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ func TestAccSqlDatabaseInstance_basicSecondGen(t *testing.T) {
})
}

<% unless version == 'ga' -%>
func TestAccSqlDatabaseInstance_basicMSSQL(t *testing.T) {
t.Parallel()

Expand All @@ -222,7 +221,6 @@ func TestAccSqlDatabaseInstance_basicMSSQL(t *testing.T) {
},
})
}
<% end -%>

func TestAccSqlDatabaseInstance_dontDeleteDefaultUserOnReplica(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -677,7 +675,6 @@ resource "google_sql_database_instance" "instance" {
}
`

<% unless version == 'ga' -%>
var testGoogleSqlDatabaseInstance_basic_mssql = `
resource "google_sql_database_instance" "instance" {
name = "%s"
Expand All @@ -688,7 +685,6 @@ resource "google_sql_database_instance" "instance" {
}
}
`
<% end -%>

func testGoogleSqlDatabaseInstanceConfig_withoutReplica(instanceName string) string {
return fmt.Sprintf(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ includes an up-to-date reference of supported versions.
* `replica_configuration` - (Optional) The configuration for replication. The
configuration is detailed below.

* `root_password` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) Initial root password. Required for MS SQL Server, ignored by MySQL and PostgreSQL.
* `root_password` - (Optional) Initial root password. Required for MS SQL Server, ignored by MySQL and PostgreSQL.

* `encryption_key_name` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html))
The full path to the encryption key used for the CMEK disk encryption. Setting
Expand Down