Skip to content

Commit

Permalink
Add guide for annotations in cedar terraform provider (#7)
Browse files Browse the repository at this point in the history
* Add guide for annotations in cedar terraform  provider

* go generate

* change back auto formatted Note

* Correctly change the doc source

* nit
  • Loading branch information
ckluy31 authored Aug 27, 2024
1 parent da5be76 commit 966d96c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ data "cedar_policyset" "example" {
policy {
effect = "permit"
annotation {
name = "advice"
value = "Allow admins to read public resources unless owned by Alice"
}
principal_in = {
type = "Group"
id = "admins"
Expand All @@ -30,6 +35,7 @@ data "cedar_policyset" "example" {
The `data.cedar_policyset.example.text` output will be:

```
@advice("Allow admins to read public resources unless owned by Alice")
permit (
principal in Group::"admins",
action == Action::"Read",
Expand Down
6 changes: 6 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ data "cedar_policyset" "example" {
policy {
effect = "permit"
annotation {
name = "advice"
value = "Allow admins to read public resources unless owned by Alice"
}
principal_in = {
type = "Group"
id = "admins"
Expand All @@ -34,6 +39,7 @@ data "cedar_policyset" "example" {
The `data.cedar_policyset.example.text` output will be:

```
@advice("Allow admins to read public resources unless owned by Alice")
permit (
principal in Group::"admins",
action == Action::"Read",
Expand Down
6 changes: 6 additions & 0 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ data "cedar_policyset" "example" {
policy {
effect = "permit"

annotation {
name = "advice"
value = "Allow admins to read public resources unless owned by Alice"
}

principal_in = {
type = "Group"
id = "admins"
Expand All @@ -34,6 +39,7 @@ data "cedar_policyset" "example" {
The `data.cedar_policyset.example.text` output will be:

```
@advice("Allow admins to read public resources unless owned by Alice")
permit (
principal in Group::"admins",
action == Action::"Read",
Expand Down

0 comments on commit 966d96c

Please sign in to comment.