Skip to content

Commit

Permalink
chore: update imports and added example
Browse files Browse the repository at this point in the history
  • Loading branch information
kian99 committed Nov 22, 2024
1 parent c566fa0 commit 298fcd7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/data-sources/jaas_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,23 @@ description: |-

A data source representing a Juju JAAS Group.


## Example Usage

```terraform
resource "juju_jaas_group" "test" {
name = "group-0"
}
data "juju_jaas_group" "test" {
name = juju_jaas_group.test.name
// from a separate plan use a string literal
// name = "group-0"
}
output "group_uuid" {
value = data.juju_jaas_group.test.uuid
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
13 changes: 13 additions & 0 deletions examples/data-sources/juju_jaas_group/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resource "juju_jaas_group" "test" {
name = "group-0"
}

data "juju_jaas_group" "test" {
name = juju_jaas_group.test.name
// from a separate plan use a string literal
// name = "group-0"
}

output "group_uuid" {
value = data.juju_jaas_group.test.uuid
}
1 change: 1 addition & 0 deletions internal/provider/data_source_jaas_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-log/tflog"

"github.com/juju/terraform-provider-juju/internal/juju"
)

Expand Down

0 comments on commit 298fcd7

Please sign in to comment.