Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into PORT-9448-run-trigger…
Browse files Browse the repository at this point in the history
…ed-event-type-for-automations
  • Loading branch information
pazhersh committed Sep 8, 2024
2 parents f59d4e9 + c027225 commit dafdcdb
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 66 deletions.
38 changes: 19 additions & 19 deletions docs/resources/port_action.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,17 +489,17 @@ Optional:

Optional:

- `boolean_items` (Attributes) The items of the array property (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--array_props--boolean_items))
- `boolean_items` (Attributes) An array of boolean items within the property (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--array_props--boolean_items))
- `default_jq_query` (String) The default jq query of the array property
- `depends_on` (List of String) The properties that this property depends on
- `description` (String) The description of the property
- `icon` (String) The icon of the property
- `max_items` (Number) The max items of the array property
- `min_items` (Number) The min items of the array property
- `number_items` (Attributes) The items of the array property (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--array_props--number_items))
- `object_items` (Attributes) The items of the array property (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--array_props--object_items))
- `number_items` (Attributes) An array of number items within the property (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--array_props--number_items))
- `object_items` (Attributes) An array of object items within the property (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--array_props--object_items))
- `required` (Boolean) Whether the property is required, by default not required, this property can't be set at the same time if `required_jq_query` is set, and only supports true as value
- `string_items` (Attributes) The items of the array property (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--array_props--string_items))
- `string_items` (Attributes) An array of string items within the property (see [below for nested schema](#nestedatt--self_service_trigger--user_properties--array_props--string_items))
- `title` (String) The title of the property
- `visible` (Boolean) The visibility of the array property
- `visible_jq_query` (String) The visibility condition jq query of the array property
Expand All @@ -509,38 +509,38 @@ Optional:

Optional:

- `default` (List of Boolean) The default of the items
- `default` (List of Boolean) The default values for the boolean items


<a id="nestedatt--self_service_trigger--user_properties--array_props--number_items"></a>
### Nested Schema for `self_service_trigger.user_properties.array_props.visible_jq_query`

Optional:

- `default` (List of Number) The default of the items
- `enum` (List of Number) The enum of the items
- `enum_jq_query` (String) The enum jq query of the number items
- `default` (List of Number) The default values for the number items
- `enum` (List of Number) The enum of possible values for the number items
- `enum_jq_query` (String) The jq query for the enum number items


<a id="nestedatt--self_service_trigger--user_properties--array_props--object_items"></a>
### Nested Schema for `self_service_trigger.user_properties.array_props.visible_jq_query`

Optional:

- `default` (List of Map of String) The default of the items
- `default` (List of Map of String) The default values for the object items


<a id="nestedatt--self_service_trigger--user_properties--array_props--string_items"></a>
### Nested Schema for `self_service_trigger.user_properties.array_props.visible_jq_query`

Optional:

- `blueprint` (String) The blueprint identifier the property relates to
- `dataset` (String) The dataset of an the entity-format items
- `default` (List of String) The default of the items
- `enum` (List of String) The enum of the items
- `enum_jq_query` (String) The enum jq query of the string items
- `format` (String) The format of the items
- `blueprint` (String) The blueprint identifier related to each string item
- `dataset` (String) The dataset of the entity-format items
- `default` (List of String) The default value of the items
- `enum` (List of String) The enum of possible values for the string items
- `enum_jq_query` (String) The jq query for the enum of string items
- `format` (String) The format of the string property, Accepted values include `date-time`, `url`, `email`, `ipv4`, `ipv6`, `yaml`, `entity`, `user`, `team`, `proto`, `markdown`



Expand Down Expand Up @@ -589,7 +589,7 @@ Optional:
- `default_jq_query` (String) The default jq query of the object property
- `depends_on` (List of String) The properties that this property depends on
- `description` (String) The description of the property
- `encryption` (String) The algorithm to encrypt the property with
- `encryption` (String) The algorithm to encrypt the property with. Accepted value: `aes256-gcm`
- `icon` (String) The icon of the property
- `required` (Boolean) Whether the property is required, by default not required, this property can't be set at the same time if `required_jq_query` is set, and only supports true as value
- `title` (String) The title of the property
Expand All @@ -608,10 +608,10 @@ Optional:
- `default_jq_query` (String) The default jq query of the string property
- `depends_on` (List of String) The properties that this property depends on
- `description` (String) The description of the property
- `encryption` (String) The algorithm to encrypt the property with
- `encryption` (String) The algorithm to encrypt the property with. Accepted value: `aes256-gcm`
- `enum` (List of String) The enum of the string property
- `enum_jq_query` (String) The enum jq query of the string property
- `format` (String) The format of the string property
- `format` (String) The format of the string property, Accepted values include `date-time`, `url`, `email`, `ipv4`, `ipv6`, `yaml`, `entity`, `user`, `team`, `proto`, `markdown`
- `icon` (String) The icon of the property
- `max_length` (Number) The max length of the string property
- `min_length` (Number) The min length of the string property
Expand Down Expand Up @@ -689,7 +689,7 @@ Required:

Optional:

- `agent` (String) Use the agent to invoke the action
- `agent` (String) Specifies whether to use an agent to invoke the action. This can be a boolean value (`'true''` or `'false'`) or a JQ if dynamic evaluation is needed.
- `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
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/port_action_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ page_title: "port_action_permissions Resource - terraform-provider-port-labs"
subcategory: ""
description: |-
Action Permissions resource
Docs for the Action Permissions resource can be found here https://docs.getport.io/create-self-service-experiences/set-self-service-actions-rbac/examples.
Docs for the Action Permissions resource can be found here https://docs.getport.io/actions-and-automations/create-self-service-experiences/set-self-service-actions-rbac/?config-method=terraform.
Example Usage
hcl
resource "port_action_permissions" "restart_microservice_permissions" {
Expand Down Expand Up @@ -107,7 +107,7 @@ description: |-

# Action Permissions resource

Docs for the Action Permissions resource can be found [here](https://docs.getport.io/create-self-service-experiences/set-self-service-actions-rbac/examples).
Docs for the Action Permissions resource can be found [here](https://docs.getport.io/actions-and-automations/create-self-service-experiences/set-self-service-actions-rbac/?config-method=terraform).

## Example Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/port_aggregation_properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ subcategory: ""
description: |-
Aggregation Properties
This resource allows you to manage aggregation properties of a blueprint.
See the Port documentation https://docs.getport.io/build-your-software-catalog/define-your-data-model/setup-blueprint/properties/aggregation-properties/ for more information about aggregation properties.
See the Port documentation https://docs.getport.io/build-your-software-catalog/customize-integrations/configure-data-model/setup-blueprint/properties/aggregation-property/ for more information about aggregation properties.
Supported Methods:
count_entities - Count the entities of the target blueprintaverage_entities - Average the entities of the target blueprint by time periodsaveragebyproperty - Calculate the average by property value of the target entitiesaggregatebyproperty - Calculate the aggregate by property value of the target entities, such as sum, min, max, median
Example Usage
Expand Down Expand Up @@ -276,7 +276,7 @@ description: |-

This resource allows you to manage aggregation properties of a blueprint.

See the [Port documentation](https://docs.getport.io/build-your-software-catalog/define-your-data-model/setup-blueprint/properties/aggregation-properties/) for more information about aggregation properties.
See the [Port documentation](https://docs.getport.io/build-your-software-catalog/customize-integrations/configure-data-model/setup-blueprint/properties/aggregation-property/) for more information about aggregation properties.


Supported Methods:
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/port_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: |-
resource "portintegration" "mycustomintegration" {
installationid = "my-custom-integration-id"
title = "My Custom Integration"
version = "1.33.7"
version = "1.33.7" # Optional, can be omitted
config = jsonencode({
createMissingRelatedEntitiesboolean = true
deleteDependentEntities = true,
Expand Down Expand Up @@ -56,7 +56,7 @@ Docs about how to import existing integrations and manage their mappings can be
resource "port_integration" "my_custom_integration" {
installation_id = "my-custom-integration-id"
title = "My Custom Integration"
version = "1.33.7"
version = "1.33.7" # Optional, can be omitted
config = jsonencode({
createMissingRelatedEntitiesboolean = true
deleteDependentEntities = true,
Expand Down
19 changes: 10 additions & 9 deletions docs/resources/port_scorecard.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ description: |-
operator = "isNotEmpty"
}),
jsonencode({
property = "author",
operator : "=",
property = "author"
operator : "="
value : "myValue"
})
]
Expand Down Expand Up @@ -97,6 +97,7 @@ description: |-
portblueprint.microservice
]
}
```
Example Usage with Levels
This will override the default levels (Basic, Bronze, Silver, Gold) with the provided levels: Not Ready, Partially Ready, Ready.
```hcl
Expand Down Expand Up @@ -156,8 +157,8 @@ description: |-
operator = "isNotEmpty"
}),
jsonencode({
property = "author",
operator : "=",
property = "author"
operator : "="
value : "myValue"
})
]
Expand Down Expand Up @@ -262,8 +263,8 @@ resource "port_scorecard" "readiness" {
operator = "isNotEmpty"
}),
jsonencode({
property = "author",
operator : "=",
property = "author"
operator : "="
value : "myValue"
})
]
Expand Down Expand Up @@ -309,7 +310,7 @@ resource "port_scorecard" "readiness" {
]
}
```

## Example Usage with Levels

Expand Down Expand Up @@ -375,8 +376,8 @@ resource "port_scorecard" "readiness" {
operator = "isNotEmpty"
}),
jsonencode({
property = "author",
operator : "=",
property = "author"
operator : "="
value : "myValue"
})
]
Expand Down
34 changes: 33 additions & 1 deletion examples/resources/port_integration/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
resource "port_integration" "my_custom_integration" {
installation_id = "my-custom-integration-id"
title = "My Custom Integration"
version = "1.33.7"
installation_app_type = "WEBHOOK"
config = jsonencode({
createMissingRelatedEntitiesboolean = true
Expand All @@ -27,3 +26,36 @@ resource "port_integration" "my_custom_integration" {
}]
})
}

resource "port_integration" "my_k8s_exporter" {
installation_id = "my-"
title = "My K8S Exporter with version managed by Terraform"
installation_app_type = "K8S EXPORTER"
# NOTE: This property is by default not used, since it can change outside of terraform
# Include this only if you explicitly want to control the version with Terraform
version = "1.33.7"
config = jsonencode({
createMissingRelatedEntitiesboolean = true
deleteDependentEntities = true
resources = [{
kind = "apps/v1/replicasets"
selector = {
query = ".metadata.namespace | startswith(\"kube\") | not"
}
port = {
entity = {
mappings = [{
identifier = ".metadata.name"
title = ".metadata.name"
blueprint = "'deploymentConfig'"
properties = {
creationTimestamp = ".metadata.creationTimestamp"
annotations = ".metadata.annotations"
status = ".status"
}
}]
}
}
}]
})
}
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ require (
require (
github.com/ProtonMail/go-crypto v0.0.0-20230626094100-7e9e0395ebec // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/gertd/go-pluralize v0.2.1 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
Expand Down Expand Up @@ -48,7 +47,7 @@ require (
github.com/hashicorp/terraform-json v0.17.1 // indirect
github.com/hashicorp/terraform-plugin-framework-validators v0.10.0
github.com/hashicorp/terraform-plugin-go v0.18.0
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-testing v1.3.0
github.com/hashicorp/terraform-registry-address v0.2.1 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA=
github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk=
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4=
github.com/go-git/go-git/v5 v5.6.1 h1:q4ZRqQl4pR/ZJHc1L5CFjGA1a10u76aV1iC+nh+bHsk=
Expand Down
2 changes: 1 addition & 1 deletion port/action-permissions/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ var ActionPermissionsResourceMarkdownDescription = `
# Action Permissions resource
Docs for the Action Permissions resource can be found [here](https://docs.getport.io/create-self-service-experiences/set-self-service-actions-rbac/examples).
Docs for the Action Permissions resource can be found [here](https://docs.getport.io/actions-and-automations/create-self-service-experiences/set-self-service-actions-rbac/?config-method=terraform).
## Example Usage
Expand Down
Loading

0 comments on commit dafdcdb

Please sign in to comment.