diff --git a/README.md b/README.md index 70678a5..95d9ecb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/resources/leapfrog.md b/docs/resources/leapfrog.md index b9f7b3d..c0d46f4 100644 --- a/docs/resources/leapfrog.md +++ b/docs/resources/leapfrog.md @@ -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 @@ -24,7 +25,7 @@ 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 } } @@ -32,11 +33,11 @@ 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 } ```