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

azurerm_postgresql_flexible_server - Add support for version 15 #21934

Merged
merged 3 commits into from May 26, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -125,10 +125,12 @@ func resourcePostgresqlFlexibleServer() *pluginsdk.Resource {
},

"version": {
Type: pluginsdk.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(servers.PossibleValuesForServerVersion(), false),
Type: pluginsdk.TypeString,
Optional: true,
Computed: true,
// TODO: Remove "15" after this issue has been resolved:
// https://github.com/Azure/azure-rest-api-specs/issues/24186
ValidateFunc: validation.StringInSlice(append(servers.PossibleValuesForServerVersion(), "15"), false),
aristosvo marked this conversation as resolved.
Show resolved Hide resolved
aristosvo marked this conversation as resolved.
Show resolved Hide resolved
},

"zone": commonschema.ZoneSingleOptional(),
Expand Down
Expand Up @@ -343,7 +343,21 @@ func TestAccPostgresqlFlexibleServer_upgradeVersion(t *testing.T) {
},
data.ImportStep("administrator_password", "create_mode"),
{
Config: r.upgradeVersion(data),
Config: r.upgradeVersion(data, "13"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep("administrator_password", "create_mode"),
{
Config: r.upgradeVersion(data, "14"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep("administrator_password", "create_mode"),
{
Config: r.upgradeVersion(data, "15"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
Expand Down Expand Up @@ -876,7 +890,7 @@ resource "azurerm_postgresql_flexible_server" "replica" {
`, r.basic(data), data.RandomInteger)
}

func (r PostgresqlFlexibleServerResource) upgradeVersion(data acceptance.TestData) string {
func (r PostgresqlFlexibleServerResource) upgradeVersion(data acceptance.TestData, version string) string {
return fmt.Sprintf(`
%s

Expand All @@ -888,9 +902,9 @@ resource "azurerm_postgresql_flexible_server" "test" {
administrator_password = "QAZwsx123"
storage_mb = 32768
create_mode = "Update"
version = "13"
version = "%s"
sku_name = "GP_Standard_D2s_v3"
zone = "2"
}
`, r.template(data), data.RandomInteger)
`, r.template(data), data.RandomInteger, version)
}
2 changes: 1 addition & 1 deletion website/docs/r/postgresql_flexible_server.html.markdown
Expand Up @@ -134,7 +134,7 @@ The following arguments are supported:

* `tags` - (Optional) A mapping of tags which should be assigned to the PostgreSQL Flexible Server.

* `version` - (Optional) The version of PostgreSQL Flexible Server to use. Possible values are `11`,`12`, `13` and `14`. Required when `create_mode` is `Default`. Changing this forces a new PostgreSQL Flexible Server to be created.
* `version` - (Optional) The version of PostgreSQL Flexible Server to use. Possible values are `11`,`12`, `13`, `14` and `15`. Required when `create_mode` is `Default`. Changing this forces a new PostgreSQL Flexible Server to be created.

-> **Note:** When `create_mode` is `Update`, upgrading version wouldn't force a new resource to be created.

Expand Down