Skip to content

Commit

Permalink
Resource google_sql_database_instance root_password (MS SQL) for GA (#…
Browse files Browse the repository at this point in the history
…3638)

Co-authored-by: Edward Sun <[email protected]>
  • Loading branch information
edwardmedia and Edward Sun authored Jun 16, 2020
1 parent d7c4d91 commit f43e99b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
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

0 comments on commit f43e99b

Please sign in to comment.