Skip to content

Commit

Permalink
Remove or replace references to the Postgres "mini" plan (#387)
Browse files Browse the repository at this point in the history
* Remove or replace references to the Postgres "mini" plan

* Some test assertions require the default postgres plan name

* Distinguish the user-set Add-on attribute from the Add-on's provisioned plan
  • Loading branch information
mars authored Jul 17, 2024
1 parent 0cd2b9e commit ff6a485
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/resources/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "heroku_app" "default" {
# Create a database, and configure the app to use it
resource "heroku_addon" "database" {
app_id = heroku_app.default.id
plan = "heroku-postgresql:mini"
plan = "heroku-postgresql:standard-0"
}
```

Expand Down
4 changes: 2 additions & 2 deletions heroku/resource_heroku_addon_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ resource "heroku_app" "foobar" {
resource "heroku_addon" "foobar" {
app_id = heroku_app.foobar.id
plan = "heroku-postgresql:mini"
plan = "heroku-postgresql"
}
resource "heroku_addon_attachment" "foobar" {
Expand All @@ -74,7 +74,7 @@ resource "heroku_app" "foobar" {
resource "heroku_addon" "foobar" {
app_id = heroku_app.foobar.id
plan = "heroku-postgresql:mini"
plan = "heroku-postgresql"
}
resource "heroku_addon_attachment" "foobar" {
Expand Down
22 changes: 11 additions & 11 deletions heroku/resource_heroku_addon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ func TestAccHerokuAddon_noPlan(t *testing.T) {
Config: testAccCheckHerokuAddonConfig_no_plan(appName),
Check: resource.ComposeTestCheckFunc(
testAccCheckHerokuAddonExists("heroku_addon.foobar", &addon),
testAccCheckHerokuAddonPlan(&addon, "heroku-postgresql:mini"),
testAccCheckHerokuAddonPlan(&addon, "heroku-postgresql:essential-0"),
resource.TestCheckResourceAttrSet(
"heroku_addon.foobar", "app_id"),
resource.TestCheckResourceAttr(
"heroku_addon.foobar", "plan", "heroku-postgresql:mini"),
"heroku_addon.foobar", "plan", "heroku-postgresql"),
),
},
{
Config: testAccCheckHerokuAddonConfig_no_plan(appName),
Check: resource.ComposeTestCheckFunc(
testAccCheckHerokuAddonExists("heroku_addon.foobar", &addon),
testAccCheckHerokuAddonPlan(&addon, "heroku-postgresql:mini"),
testAccCheckHerokuAddonPlan(&addon, "heroku-postgresql:essential-0"),
resource.TestCheckResourceAttrSet(
"heroku_addon.foobar", "app_id"),
resource.TestCheckResourceAttr(
"heroku_addon.foobar", "plan", "heroku-postgresql:mini"),
"heroku_addon.foobar", "plan", "heroku-postgresql"),
),
},
},
Expand All @@ -85,7 +85,7 @@ func TestAccHerokuAddon_ConfigVarValues(t *testing.T) {
Config: testAccCheckHerokuAddonConfig_configVarValues(appName),
Check: resource.ComposeTestCheckFunc(
testAccCheckHerokuAddonExists("heroku_addon.pg", &addon),
testAccCheckHerokuAddonPlan(&addon, "heroku-postgresql:mini"),
testAccCheckHerokuAddonPlan(&addon, "heroku-postgresql:essential-0"),
testAccCheckHerokuAddonConfigVarValueHasDatabaseURL("heroku_addon.pg", &addon),
),
},
Expand Down Expand Up @@ -123,11 +123,11 @@ func TestAccHerokuAddon_CustomName(t *testing.T) {
Config: testAccCheckHerokuAddonConfig_CustomName(appName, customName),
Check: resource.ComposeTestCheckFunc(
testAccCheckHerokuAddonExists("heroku_addon.foobar", &addon),
testAccCheckHerokuAddonPlan(&addon, "heroku-postgresql:mini"),
testAccCheckHerokuAddonPlan(&addon, "heroku-postgresql:essential-0"),
resource.TestCheckResourceAttrSet(
"heroku_addon.foobar", "app_id"),
resource.TestCheckResourceAttr(
"heroku_addon.foobar", "plan", "heroku-postgresql:mini"),
"heroku_addon.foobar", "plan", "heroku-postgresql"),
resource.TestCheckResourceAttr(
"heroku_addon.foobar", "name", customName),
),
Expand Down Expand Up @@ -325,7 +325,7 @@ resource "heroku_app" "foobar" {
resource "heroku_addon" "pg" {
app_id = heroku_app.foobar.id
plan = "heroku-postgresql:mini"
plan = "heroku-postgresql"
}`, appName)
}

Expand All @@ -344,7 +344,7 @@ resource "heroku_app" "foobar" {
resource "heroku_addon" "pg" {
app_id = heroku_app.foobar.id
plan = "heroku-postgresql:mini"
plan = "heroku-postgresql"
}`, appName)
}

Expand All @@ -357,7 +357,7 @@ resource "heroku_app" "foobar" {
resource "heroku_addon" "foobar" {
app_id = heroku_app.foobar.id
plan = "heroku-postgresql:mini"
plan = "heroku-postgresql"
}`, appName)
}

Expand All @@ -370,7 +370,7 @@ resource "heroku_app" "foobar" {
resource "heroku_addon" "foobar" {
app_id = heroku_app.foobar.id
plan = "heroku-postgresql:mini"
plan = "heroku-postgresql"
name = "%s"
}`, appName, customAddonName)
}

0 comments on commit ff6a485

Please sign in to comment.