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

allow postgres version 10.0 #1457

Merged
merged 4 commits into from
Jun 28, 2018
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
2 changes: 2 additions & 0 deletions azurerm/resource_arm_postgresql_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ func resourceArmPostgreSQLServer() *schema.Resource {
ValidateFunc: validation.StringInSlice([]string{
string(postgresql.NineFullStopFive),
string(postgresql.NineFullStopSix),
// TODO: Swap for the azure go api enum once supported.
"10.0",
}, true),
DiffSuppressFunc: ignoreCaseDiffSuppressFunc,
},
Expand Down
55 changes: 55 additions & 0 deletions azurerm/resource_arm_postgresql_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,28 @@ func TestAccAzureRMPostgreSQLServer_basicNinePointSix(t *testing.T) {
})
}

func TestAccAzureRMPostgreSQLServer_basicTenPointZero(t *testing.T) {
resourceName := "azurerm_postgresql_server.test"
ri := acctest.RandInt()

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMPostgreSQLServerDestroy,
Steps: []resource.TestStep{
{
Config: testAccAzureRMPostgreSQLServer_basicTenPointZero(ri, testLocation()),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMPostgreSQLServerExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "administrator_login", "acctestun"),
resource.TestCheckResourceAttr(resourceName, "version", "10.0"),
resource.TestCheckResourceAttr(resourceName, "ssl_enforcement", "Enabled"),
),
},
},
})
}

func TestAccAzureRMPostgreSQLServer_basicMaxStorage(t *testing.T) {
resourceName := "azurerm_postgresql_server.test"
ri := acctest.RandInt()
Expand Down Expand Up @@ -299,6 +321,39 @@ resource "azurerm_postgresql_server" "test" {
`, rInt, location, rInt)
}

func testAccAzureRMPostgreSQLServer_basicTenPointZero(rInt int, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "%s"
}

resource "azurerm_postgresql_server" "test" {
name = "acctestpsqlsvr-%d"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"

sku {
name = "B_Gen4_2"
capacity = 2
tier = "Basic"
family = "Gen4"
}

storage_profile {
storage_mb = 51200
backup_retention_days = 7
geo_redundant_backup = "Disabled"
}

administrator_login = "acctestun"
administrator_login_password = "H@Sh1CoR3!"
version = "10.0"
ssl_enforcement = "Enabled"
}
`, rInt, location, rInt)
}

func testAccAzureRMPostgreSQLServer_basicNinePointSixUpdatedPassword(rInt int, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/postgresql_server.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The following arguments are supported:

* `administrator_login_password` - (Required) The Password associated with the `administrator_login` for the PostgreSQL Server.

* `version` - (Required) Specifies the version of PostgreSQL to use. Valid values are `9.5` and `9.6`. Changing this forces a new resource to be created.
* `version` - (Required) Specifies the version of PostgreSQL to use. Valid values are `9.5`, `9.6`, and `10.0`. Changing this forces a new resource to be created.

* `ssl_enforcement` - (Required) Specifies if SSL should be enforced on connections. Possible values are `Enabled` and `Disabled`.

Expand Down