Skip to content

Commit 98fc236

Browse files
committed
Update examples
1 parent de33db0 commit 98fc236

File tree

26 files changed

+815
-395
lines changed

26 files changed

+815
-395
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Port is the Developer Platform meant to supercharge your DevOps and Developers,
1212

1313
## Documentation
1414

15-
- [Terraform registry docs](https://registry.terraform.io/providers/port-labs/port/latest/docs)
15+
- [Terraform registry docs](https://registry.terraform.io/providers/port-labs/port-labs/latest/docs)
1616
- [Port docs](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/iac/terraform)
1717

1818
## Requirements
@@ -30,7 +30,7 @@ terraform {
3030
required_providers {
3131
port = {
3232
source = "port-labs/port-labs"
33-
version = "~> 1.0.0"
33+
version = "~> 2.0.0"
3434
}
3535
}
3636
}
@@ -49,4 +49,4 @@ terraform init
4949

5050
## Examples
5151

52-
please refer to the [examples](./examples) directory
52+
Please refer to the [examples](./examples) directory

docs/resources/port_action_permissions.md

Lines changed: 80 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ description: |-
88
Example Usage
99
hcl
1010
resource "port_action_permissions" "restart_microservice_permissions" {
11-
action_identifier = port_action.restart_microservice.identifier
12-
permissions = {
13-
"execute" : {
14-
"roles" : [
15-
"Admin"
16-
],
17-
"users" : [],
18-
"teams" : [],
19-
"owned_by_team" : true
20-
},
21-
"approve" : {
22-
"roles" : ["Member", "Admin"],
23-
"users" : [],
24-
"teams" : []
11+
action_identifier = port_action.restart_microservice.identifier
12+
permissions = {
13+
"execute" : {
14+
"roles" : [
15+
"admin"
16+
],
17+
"users" : [],
18+
"teams" : [],
19+
"owned_by_team" : true
20+
},
21+
"approve" : {
22+
"roles" : ["member", "admin"],
23+
"users" : [],
24+
"teams" : []
25+
}
2526
}
26-
}
2727
}
2828
2929
Example Usage with Policy
@@ -78,7 +78,29 @@ description: |-
7878
}
7979
```
8080
Disclaimer
81-
Action permissions are created by default when creating a new action, this means that you should use this resource when you want to change the default permissions of an action.When deleting an action permissions resource using terraform, the action permissions will not be deleted from Port, as they are required for the action to work, instead, the action permissions will be removed from the terraform state.
81+
Action permissions are created by default when creating a new action, this means that you should use this resource when you want to change the default permissions of an action.When deleting an action permissions resource using terraform, the action permissions will not be deleted from Port, as they are required for the action to work, instead, the action permissions will be removed from the terraform state.All the permission lists (roles, users, teams) are managed by Port in a sorted manner, this means that if your .tf has for example roles defined out of order, your state will be invalid
82+
E.g:
83+
hcl
84+
resource "port_action_permissions" "restart_microservice_permissions" {
85+
action_identifier = port_action.restart_microservice.identifier
86+
permissions = {
87+
# invalid
88+
"execute" : {
89+
"roles" : [
90+
"member",
91+
"admin",
92+
],
93+
...
94+
},
95+
# valid
96+
"approve" : {
97+
"roles" : [
98+
"admin",
99+
"member",
100+
],
101+
}
102+
}
103+
}
82104
---
83105

84106
# port_action_permissions (Resource)
@@ -91,22 +113,22 @@ Docs for the Action Permissions resource can be found [here](https://docs.getpor
91113

92114
```hcl
93115
resource "port_action_permissions" "restart_microservice_permissions" {
94-
action_identifier = port_action.restart_microservice.identifier
95-
permissions = {
96-
"execute" : {
97-
"roles" : [
98-
"Admin"
99-
],
100-
"users" : [],
101-
"teams" : [],
102-
"owned_by_team" : true
103-
},
104-
"approve" : {
105-
"roles" : ["Member", "Admin"],
106-
"users" : [],
107-
"teams" : []
108-
}
109-
}
116+
action_identifier = port_action.restart_microservice.identifier
117+
permissions = {
118+
"execute" : {
119+
"roles" : [
120+
"admin"
121+
],
122+
"users" : [],
123+
"teams" : [],
124+
"owned_by_team" : true
125+
},
126+
"approve" : {
127+
"roles" : ["member", "admin"],
128+
"users" : [],
129+
"teams" : []
130+
}
131+
}
110132
}
111133
```
112134

@@ -166,10 +188,35 @@ resource "port_action_permissions" "restart_microservice_permissions" {
166188
}
167189
```
168190

169-
## Disclaimer
191+
## Disclaimer
170192

171193
- Action permissions are created by default when creating a new action, this means that you should use this resource when you want to change the default permissions of an action.
172194
- When deleting an action permissions resource using terraform, the action permissions will not be deleted from Port, as they are required for the action to work, instead, the action permissions will be removed from the terraform state.
195+
- All the permission lists (roles, users, teams) are managed by Port in a sorted manner, this means that if your `.tf` has for example roles defined out of order, your state will be invalid
196+
E.g:
197+
198+
```hcl
199+
resource "port_action_permissions" "restart_microservice_permissions" {
200+
action_identifier = port_action.restart_microservice.identifier
201+
permissions = {
202+
# invalid
203+
"execute" : {
204+
"roles" : [
205+
"member",
206+
"admin",
207+
],
208+
...
209+
},
210+
# valid
211+
"approve" : {
212+
"roles" : [
213+
"admin",
214+
"member",
215+
],
216+
}
217+
}
218+
}
219+
```
173220

174221

175222

0 commit comments

Comments
 (0)