From d5d94e2a106da2f4e8cb23f6caeaba2029d73900 Mon Sep 17 00:00:00 2001 From: Amanda Hager Lopes de Andrade Katz Date: Tue, 17 Dec 2024 14:49:00 -0300 Subject: [PATCH] docs: add doc usage --- docs/resources/access_offer.md | 20 +++++++++++++++++++ .../resources/juju_access_offer/import.sh | 6 ++++++ .../resources/juju_access_offer/resource.tf | 4 ++++ 3 files changed, 30 insertions(+) create mode 100644 examples/resources/juju_access_offer/import.sh create mode 100644 examples/resources/juju_access_offer/resource.tf diff --git a/docs/resources/access_offer.md b/docs/resources/access_offer.md index 11fb896d..13cec545 100644 --- a/docs/resources/access_offer.md +++ b/docs/resources/access_offer.md @@ -10,7 +10,14 @@ description: |- A resource that represent a Juju Access Offer. Warning: Do not repeat users across different access levels. +## Example Usage +```terraform +resource "juju_access_offer" "this" { + offer_url = juju_offer.my_application_offer.url + consume = [juju_user.dev.name] +} +``` ## Schema @@ -28,3 +35,16 @@ A resource that represent a Juju Access Offer. Warning: Do not repeat users acro ### Read-Only - `id` (String) The ID of this resource. + +## Import + +Import is supported using the following syntax: + +```shell +# Access Offers can be imported by using the Offer URL as in the juju show-offers output. +# Example: +# $juju show-offer mysql +# Store URL Access Description Endpoint Interface Role +# mycontroller admin/db.mysql admin MariaDB Server is one of the most ... mysql mysql provider +$ terraform import juju_access_offer.db admin/db.mysql +``` diff --git a/examples/resources/juju_access_offer/import.sh b/examples/resources/juju_access_offer/import.sh new file mode 100644 index 00000000..094b0170 --- /dev/null +++ b/examples/resources/juju_access_offer/import.sh @@ -0,0 +1,6 @@ +# Access Offers can be imported by using the Offer URL as in the juju show-offers output. +# Example: +# $juju show-offer mysql +# Store URL Access Description Endpoint Interface Role +# mycontroller admin/db.mysql admin MariaDB Server is one of the most ... mysql mysql provider +$ terraform import juju_access_offer.db admin/db.mysql diff --git a/examples/resources/juju_access_offer/resource.tf b/examples/resources/juju_access_offer/resource.tf new file mode 100644 index 00000000..265ee378 --- /dev/null +++ b/examples/resources/juju_access_offer/resource.tf @@ -0,0 +1,4 @@ +resource "juju_access_offer" "this" { + offer_url = juju_offer.my_application_offer.url + consume = [juju_user.dev.name] +}