Skip to content

Commit

Permalink
Added Cloud SQL Server with authorized network example (#5756) (#4099)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Mar 3, 2022
1 parent adc0d76 commit 3b63fc2
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .changelog/5756.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```release-note:none
```
46 changes: 46 additions & 0 deletions google-beta/resource_cgc_snippet_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,52 @@ resource "google_sql_database_instance" "instance" {
`, context)
}

func TestAccCGCSnippet_sqlSqlserverInstanceAuthorizedNetworkExample(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": randString(t, 10),
}

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccCGCSnippet_sqlSqlserverInstanceAuthorizedNetworkExample(context),
},
{
ResourceName: "google_sql_database_instance.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"deletion_protection", "root_password"},
},
},
})
}

func testAccCGCSnippet_sqlSqlserverInstanceAuthorizedNetworkExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_sql_database_instance" "default" {
name = "myinstance%{random_suffix}"
region = "us-central1"
database_version = "SQLSERVER_2017_STANDARD"
root_password = "INSERT-PASSWORD-HERE"
settings {
tier = "db-custom-2-7680"
ip_configuration {
authorized_networks {
name = "Network Name"
value = "192.0.2.0/24"
expiration_time = "3021-11-15T16:19:00.094Z"
}
}
}
deletion_protection = false
}
`, context)
}

func TestAccCGCSnippet_storageNewBucketExample(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 3b63fc2

Please sign in to comment.