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

new resource for creating PG followers #27

Open
davidji99 opened this issue Sep 10, 2020 · 1 comment
Open

new resource for creating PG followers #27

davidji99 opened this issue Sep 10, 2020 · 1 comment

Comments

@davidji99
Copy link
Owner

davidji99 commented Sep 10, 2020

`https://data-api.heroku.com/graphql` POST (returns 200)

Authorization: Bearer <API_TOKEN>

{"query":"mutation AddPostgresFollower($addonUUID: ID!, $plan: String!, $region: String!) { addPostgresFollower(        leader_uuid: $addonUUID       plan: $plan        region: $region      ) {        id        name      }    }","variables":{"addonUUID":"ORIGINAL_UUID,"plan":"heroku-postgresql:private-0","region":"virginia"}}

{"data":{"addPostgresFollower":{"id":"UUID","name":"postgresql-round-#####"}},"extensions":{}}
@davidji99 davidji99 changed the title new resource for pg promote new resource for creating PG followers Sep 10, 2020
@davidji99
Copy link
Owner Author

resource "herokux_postgres" "leader" {
   app_id = "APP_UUID"
   db_leader_id = "PG_UUID"
   plan = "standard-0"
   state = "leader"  
}

resource "herokux_postgres" "follower" {
   db_leader_id = herokux_postgres.leader.id
   plan = "standard-0"
   state = "follower"  
}
  • state cannot be changed from "leader" to "follower" but the opposite is valid. If "follower" becomes "leader", this will trigger a "pg:promote".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant