Skip to content

Commit

Permalink
docs: fix examples and update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
reinoudk committed Nov 8, 2021
1 parent a2351d5 commit fe214ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Utility toggles for Terraform. Experimental so expect breaking changes.

See the [documentation](https://registry.terraform.io/providers/reinoudk/toggles/latest/docs) for more information about
usage.

## Build provider

Run the following command to build the provider
Expand Down
9 changes: 5 additions & 4 deletions docs/resources/leapfrog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ description: |-

# Resource `toggles_leapfrog`

The leapfrog resource allows you to change a single value of two outputs in an alternating fashion.
The leapfrog resource allows you to change a single value of two outputs in an alternating fashion. This is useful when
you want to rotate a resource but always keep the previous version around as well.

## Example Usage

Expand All @@ -24,19 +25,19 @@ resource "google_service_account_key" "key_blue" {
service_account_id = google_service_account.account.name
keepers = {
rotation = toggle_leapfrog.toggle.blue
rotation = toggle_leapfrog.toggle.blue_timestamp
}
}
resource "google_service_account_key" "key_green" {
service_account_id = google_service_account.account.name
keepers = {
rotation = toggle_leapfrog.toggle.green
rotation = toggle_leapfrog.toggle.green_timestamp
}
}
output "active_key" {
output "newest_key" {
value = toggles_leapfrog.blue ? google_service_account_key.key_blue : google_service_account_key.key_green
}
```
Expand Down

0 comments on commit fe214ef

Please sign in to comment.