Skip to content

Commit

Permalink
Update action and blueprints permissions documentation (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tankilevitch authored May 18, 2024
1 parent 9f7726b commit e0dfe33
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 206 deletions.
14 changes: 6 additions & 8 deletions docs/resources/port_action.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Required:

Optional:

- `payload` (String) The Azure Devops workflow payload (array or object encoded to a string)
- `payload` (String) The Azure Devops workflow [payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload) should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).


<a id="nestedatt--github_method"></a>
Expand All @@ -238,7 +238,7 @@ Required:
Optional:

- `report_workflow_status` (String) Report the workflow status when invoking the action
- `workflow_inputs` (String) The GitHub workflow inputs (key-value object encoded to a string)
- `workflow_inputs` (String) The GitHub [workflow inputs](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload) should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).


<a id="nestedatt--gitlab_method"></a>
Expand All @@ -252,15 +252,15 @@ Required:
Optional:

- `default_ref` (String) The default ref of the action
- `pipeline_variables` (String) The Gitlab pipeline variables (key-value object encoded to a string)
- `pipeline_variables` (String) The Gitlab pipeline variables should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).


<a id="nestedatt--kafka_method"></a>
### Nested Schema for `kafka_method`

Optional:

- `payload` (String) The Kafka message payload (array or object encoded to a string)
- `payload` (String) The Kafka message [payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload) should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).


<a id="nestedatt--self_service_trigger"></a>
Expand Down Expand Up @@ -469,9 +469,7 @@ Required:
Optional:

- `agent` (String) Use the agent to invoke the action
- `body` (String) The Webhook body (array or object encoded to a string)
- `headers` (Map of String) The HTTP method to invoke the action
- `body` (String) The Webhook body should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).
- `headers` (Map of String) The HTTP headers for invoking the action. They should be encoded as a key-value object to a string using [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode). Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).
- `method` (String) The HTTP method to invoke the action
- `synchronized` (String) Synchronize the action


2 changes: 0 additions & 2 deletions docs/resources/port_action_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,5 +218,3 @@ Optional:
- `roles` (List of String) The roles with execution permission
- `teams` (List of String) The teams with execution permission
- `users` (List of String) The users with execution permission


2 changes: 0 additions & 2 deletions docs/resources/port_aggregation_properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -645,5 +645,3 @@ Optional:

- `average_of` (String) The time periods to calculate the average of, e.g. hour, day, week, month
- `measure_time_by` (String) The property name on which to calculate the the time periods, e.g. $createdAt, $updated_at or any other date property


2 changes: 0 additions & 2 deletions docs/resources/port_blueprint.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,5 +498,3 @@ Required:
Optional:

- `agent` (Boolean) The agent of the webhook changelog destination


217 changes: 110 additions & 107 deletions docs/resources/port_blueprint_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,64 @@ description: |-
Docs about blueprint permissions can be found here https://docs.getport.io/build-your-software-catalog/set-catalog-rbac/examples/#setting-blueprint-permissions
Example Usage
Allow access to all members:
hcl
resource "port_blueprint_permissions" "microservices_permissions" {
blueprint_identifier = "my_blueprint_identifier"
entities= {
```hcl
resource "portblueprintpermissions" "microservicespermissions" {
blueprintidentifier = "myblueprintidentifier"
entities = {
"register" = {
"roles": [
"Member",
],
"users": [],
"teams": []
"roles" : [
"Member",
],
"users" : [],
"teams" : []
},
"unregister" = {
"roles": [
"Member",
],
"users": [],
"teams": []
"roles" : [
"Member",
],
"users" : [],
"teams" : []
},
"update" = {
"roles": [
"Member",
],
"users": ["[email protected]"],
"teams": []
},
"update_metadata_properties" = {
"icon" = {
"roles": [
"Member",
],
"users": [],
"teams": []
},
"identifier" = {
"roles": [
"Member",
],
"users": [],
"teams": ["Team Spiderman"]
},
"team" = {
"roles": [
"Admin",
],
"users": [],
"teams": []
},
"title" = {
"roles": [
"Member",
],
"users": [],
"teams": []
},
"roles" : [
"Member",
],
"users" : ["[email protected]"],
"teams" : []
},
"updatemetadataproperties" = {
"icon" = {
"roles" : [
"Member",
],
"users" : [],
"teams" : []
},
"identifier" = {
"roles" : [
"Member",
],
"users" : [],
"teams" : ["Team Spiderman"]
},
"team" = {
"roles" : [
"Admin",
],
"users" : [],
"teams" : []
},
"title" = {
"roles" : [
"Member",
],
"users" : [],
"teams" : []
}
}
}
}
```
NOTE:
You always need to explicity set register|unregister|update|update_metadata_propertiesproperties
Allow update myStringProperty` for admins and a specific user and team:
Expand Down Expand Up @@ -120,59 +121,61 @@ Docs about blueprint permissions can be found [here](https://docs.getport.io/bui
```hcl
resource "port_blueprint_permissions" "microservices_permissions" {
blueprint_identifier = "my_blueprint_identifier"
entities= {
"register" = {
"roles": [
"Member",
],
"users": [],
"teams": []
},
"unregister" = {
"roles": [
"Member",
],
"users": [],
"teams": []
},
"update" = {
"roles": [
"Member",
],
"users": ["[email protected]"],
"teams": []
},
"update_metadata_properties" = {
"icon" = {
"roles": [
"Member",
],
"users": [],
"teams": []
},
"identifier" = {
"roles": [
"Member",
],
"users": [],
"teams": ["Team Spiderman"]
},
"team" = {
"roles": [
"Admin",
],
"users": [],
"teams": []
},
"title" = {
"roles": [
"Member",
],
"users": [],
"teams": []
},
},
entities = {
"register" = {
"roles" : [
"Member",
],
"users" : [],
"teams" : []
},
"unregister" = {
"roles" : [
"Member",
],
"users" : [],
"teams" : []
},
"update" = {
"roles" : [
"Member",
],
"users" : ["[email protected]"],
"teams" : []
},
"update_metadata_properties" = {
"icon" = {
"roles" : [
"Member",
],
"users" : [],
"teams" : []
},
"identifier" = {
"roles" : [
"Member",
],
"users" : [],
"teams" : ["Team Spiderman"]
},
"team" = {
"roles" : [
"Admin",
],
"users" : [],
"teams" : []
},
"title" = {
"roles" : [
"Member",
],
"users" : [],
"teams" : []
}
}
}
}
```

#### NOTE:
Expand Down Expand Up @@ -244,17 +247,17 @@ resource "port_blueprint_permissions" "microservices_permissions" {
Required:
- `register` (Attributes) Enable permissions to register entities of the blueprint (see [below for nested schema](#nestedatt--entities--register))
- `unregister` (Attributes) Enable permissions to unregister entities of the blueprint (see [below for nested schema](#nestedatt--entities--unregister))
- `update` (Attributes) Enable permissions to update entities of the blueprint (see [below for nested schema](#nestedatt--entities--update))
- `register` (Attributes) Manage permissions to register entities of the blueprint (see [below for nested schema](#nestedatt--entities--register))
- `unregister` (Attributes) Manage permissions to unregister entities of the blueprint (see [below for nested schema](#nestedatt--entities--unregister))
- `update` (Attributes) Manage permissions to update entities of the blueprint (see [below for nested schema](#nestedatt--entities--update))
- `update_metadata_properties` (Attributes) Manage permissions to the metadata properties (`$icon|$title|$team|$identifier`)
These are translated to the updateProperties in the Port Api, proxied since we can't have Terraform properties starting with `$`signs.
See [here](https://docs.getport.io/build-your-software-catalog/customize-integrations/configure-data-model/setup-blueprint/properties/meta-properties/) for more details. (see [below for nested schema](#nestedatt--entities--update_metadata_properties))
Optional:
- `update_properties` (Attributes Map) Enable permissions to update the entity properties (see [below for nested schema](#nestedatt--entities--update_properties))
- `update_relations` (Attributes Map) Enable permissions to update the entity relations (see [below for nested schema](#nestedatt--entities--update_relations))
- `update_properties` (Attributes Map) Manage permissions to update the entity properties (see [below for nested schema](#nestedatt--entities--update_properties))
- `update_relations` (Attributes Map) Manage permissions to update the entity relations (see [below for nested schema](#nestedatt--entities--update_relations))
<a id="nestedatt--entities--register"></a>
### Nested Schema for `entities.register`
Expand Down
2 changes: 0 additions & 2 deletions docs/resources/port_entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,3 @@ Optional:

- `many_relations` (Map of List of String) The many relation of the entity
- `single_relations` (Map of String) The single relation of the entity


2 changes: 0 additions & 2 deletions docs/resources/port_page_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,3 @@ Optional:
- `roles` (List of String) The roles with read permission
- `teams` (List of String) The teams with read permission
- `users` (List of String) The users with read permission


2 changes: 0 additions & 2 deletions docs/resources/port_scorecard.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,5 +243,3 @@ Required:

- `combinator` (String) The combinator of the query
- `conditions` (List of String) The conditions of the query. Each condition object should be encoded to a string


2 changes: 0 additions & 2 deletions docs/resources/port_team.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ Team resource
- `id` (String) The ID of this resource.
- `provider_name` (String) The provider of the team
- `updated_at` (String) The last update date of the team


2 changes: 0 additions & 2 deletions docs/resources/port_webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,3 @@ Optional:
- `signature_algorithm` (String) The signature algorithm of the webhook
- `signature_header_name` (String) The signature header name of the webhook
- `signature_prefix` (String) The signature prefix of the webhook


12 changes: 6 additions & 6 deletions port/action/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func ActionSchema() map[string]schema.Attribute {
Optional: true,
Attributes: map[string]schema.Attribute{
"payload": schema.StringAttribute{
MarkdownDescription: "The Kafka message payload (array or object encoded to a string)",
MarkdownDescription: "The Kafka message [payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload) should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).",
Optional: true,
},
},
Expand Down Expand Up @@ -175,12 +175,12 @@ func ActionSchema() map[string]schema.Attribute {
Optional: true,
},
"headers": schema.MapAttribute{
MarkdownDescription: "The HTTP method to invoke the action",
MarkdownDescription: "The HTTP headers for invoking the action. They should be encoded as a key-value object to a string using [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode). Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).",
ElementType: types.StringType,
Optional: true,
},
"body": schema.StringAttribute{
MarkdownDescription: "The Webhook body (array or object encoded to a string)",
MarkdownDescription: "The Webhook body should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).",
Optional: true,
},
},
Expand All @@ -202,7 +202,7 @@ func ActionSchema() map[string]schema.Attribute {
Required: true,
},
"workflow_inputs": schema.StringAttribute{
MarkdownDescription: "The GitHub workflow inputs (key-value object encoded to a string)",
MarkdownDescription: "The GitHub [workflow inputs](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload) should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).",
Optional: true,
},
"report_workflow_status": schema.StringAttribute{
Expand All @@ -229,7 +229,7 @@ func ActionSchema() map[string]schema.Attribute {
Optional: true,
},
"pipeline_variables": schema.StringAttribute{
MarkdownDescription: "The Gitlab pipeline variables (key-value object encoded to a string)",
MarkdownDescription: "The Gitlab pipeline variables should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).",
Optional: true,
},
},
Expand All @@ -247,7 +247,7 @@ func ActionSchema() map[string]schema.Attribute {
Required: true,
},
"payload": schema.StringAttribute{
MarkdownDescription: "The Azure Devops workflow payload (array or object encoded to a string)",
MarkdownDescription: "The Azure Devops workflow [payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload) should be in `JSON` format, encoded as a string. Use [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) to encode arrays or objects. Learn about how to [define the action payload](https://docs.getport.io/create-self-service-experiences/setup-backend/#define-the-actions-payload).",
Optional: true,
},
},
Expand Down
Loading

0 comments on commit e0dfe33

Please sign in to comment.