page_title | subcategory | description |
---|---|---|
port_action Resource - terraform-provider-port-labs |
Action resource
Docs for the Action resource can be found here https://docs.getport.io/create-self-service-experiences/.
Example Usage
hcl
resource "port_action" "create_microservice" {
title = "Create Microservice"
identifier = "create-microservice"
icon = "Terraform"
self_service_trigger = {
operation = "CREATE"
blueprint_identifier = port_blueprint.microservice.identifier
user_properties = {
string_props = {
myStringIdentifier = {
title = "My String Identifier"
required = true
format = "entity"
blueprint = port_blueprint.parent.identifier
dataset = {
combinator = "and"
rules = [{
property = "$title"
operator = "contains"
value = {
jq_query = "\"specificValue\""
}
}]
}
}
}
number_props = {
myNumberIdentifier = {
title = "My Number Identifier"
required = true
maximum = 100
minimum = 0
}
}
boolean_props = {
myBooleanIdentifier = {
title = "My Boolean Identifier"
required = true
}
}
object_props = {
myObjectIdentifier = {
title = "My Object Identifier"
required = true
}
}
array_props = {
myArrayIdentifier = {
title = "My Array Identifier"
required = true
string_items = {
format = "entity"
blueprint = port_blueprint.parent.identifier
dataset = jsonencode({
combinator = "and"
rules = [{
property = "$title"
operator = "contains"
value = "specificValue"
}]
})
}
}
}
}
}
kafka_method = {
payload = jsonencode({
runId: "{{.run.id}}"
})
}
}
Example Usage with Automation trigger
Port allows setting an automation trigger to an action, for executing an action based on event occurred to an entity in Port.
```hcl
resource "portaction" "deletetemporarymicroservice" {
title = "Delete Temporary Microservice"
identifier = "delete-temp-microservice"
icon = "Terraform"
automationtrigger = {
timerpropertyexpiredevent = {
blueprintidentifier = portblueprint.microservice.identifier
propertyidentifier = "ttl"
}
}
kafka_method = {
payload = jsonencode({
runId: "{{.run.id}}"
})
}
}
```
Example Usage With Condition
```hcl
resource "portaction" "createmicroservice" {
title = "Create Microservice"
identifier = "create-microservice"
icon = "Terraform"
selfservicetrigger = {
operation = "CREATE"
blueprintidentifier = portblueprint.microservice.identifier
condition = jsonencode({
type = "SEARCH"
combinator = "and"
rules = [
{
property = "$title"
operator = "!="
value = "Test"
}
]
})
userproperties = {
stringprops = {
myStringIdentifier = {
title = "My String Identifier"
required = true
}
}
}
}
kafka_method = {
payload = jsonencode({
runId: "{{.run.id}}"
})
}
``` |
Docs for the Action resource can be found here.
resource "port_action" "create_microservice" {
title = "Create Microservice"
identifier = "create-microservice"
icon = "Terraform"
self_service_trigger = {
operation = "CREATE"
blueprint_identifier = port_blueprint.microservice.identifier
user_properties = {
string_props = {
myStringIdentifier = {
title = "My String Identifier"
required = true
format = "entity"
blueprint = port_blueprint.parent.identifier
dataset = {
combinator = "and"
rules = [{
property = "$title"
operator = "contains"
value = {
jq_query = "\"specificValue\""
}
}]
}
}
}
number_props = {
myNumberIdentifier = {
title = "My Number Identifier"
required = true
maximum = 100
minimum = 0
}
}
boolean_props = {
myBooleanIdentifier = {
title = "My Boolean Identifier"
required = true
}
}
object_props = {
myObjectIdentifier = {
title = "My Object Identifier"
required = true
}
}
array_props = {
myArrayIdentifier = {
title = "My Array Identifier"
required = true
string_items = {
format = "entity"
blueprint = port_blueprint.parent.identifier
dataset = jsonencode({
combinator = "and"
rules = [{
property = "$title"
operator = "contains"
value = "specificValue"
}]
})
}
}
}
}
}
kafka_method = {
payload = jsonencode({
runId: "{{.run.id}}"
})
}
}
Port allows setting an automation trigger to an action, for executing an action based on event occurred to an entity in Port.
resource "port_action" "delete_temporary_microservice" {
title = "Delete Temporary Microservice"
identifier = "delete-temp-microservice"
icon = "Terraform"
automation_trigger = {
timer_property_expired_event = {
blueprint_identifier = port_blueprint.microservice.identifier
property_identifier = "ttl"
}
}
kafka_method = {
payload = jsonencode({
runId: "{{.run.id}}"
})
}
}
resource "port_action" "create_microservice" {
title = "Create Microservice"
identifier = "create-microservice"
icon = "Terraform"
self_service_trigger = {
operation = "CREATE"
blueprint_identifier = port_blueprint.microservice.identifier
condition = jsonencode({
type = "SEARCH"
combinator = "and"
rules = [
{
property = "$title"
operator = "!="
value = "Test"
}
]
})
user_properties = {
string_props = {
myStringIdentifier = {
title = "My String Identifier"
required = true
}
}
}
}
kafka_method = {
payload = jsonencode({
runId: "{{.run.id}}"
})
}
identifier
(String) Identifier
approval_email_notification
(Object) The email notification of the approval (see below for nested schema)approval_webhook_notification
(Attributes) The webhook notification of the approval (see below for nested schema)automation_trigger
(Attributes) Automation trigger for the action (see below for nested schema)azure_method
(Attributes) Azure DevOps invocation method (see below for nested schema)blueprint
(String, Deprecated) The blueprint identifier the action relates todescription
(String) Descriptiongithub_method
(Attributes) GitHub invocation method (see below for nested schema)gitlab_method
(Attributes) Gitlab invocation method (see below for nested schema)icon
(String) Iconkafka_method
(Attributes) Kafka invocation method (see below for nested schema)publish
(Boolean) Publish actionrequired_approval
(String) Require approval before invoking the action. Can be one of "true", "false", "ANY" or "ALL"self_service_trigger
(Attributes) Self service trigger for the action (see below for nested schema)title
(String) Titleupsert_entity_method
(Attributes) Upsert Entity invocation method (see below for nested schema)webhook_method
(Attributes) Webhook invocation method (see below for nested schema)
id
(String) The ID of this resource.
Optional:
Required:
url
(String) The URL to invoke the webhook
Optional:
format
(String) The format to invoke the webhook
Optional:
any_entity_change_event
(Attributes) Any entity change event trigger (see below for nested schema)entity_created_event
(Attributes) Entity created event trigger (see below for nested schema)entity_deleted_event
(Attributes) Entity deleted event trigger (see below for nested schema)entity_updated_event
(Attributes) Entity updated event trigger (see below for nested schema)jq_condition
(Attributes) JQ condition for automation trigger (see below for nested schema)run_updated_event
(Attributes) Run updated event trigger (see below for nested schema)timer_property_expired_event
(Attributes) Timer property expired event trigger (see below for nested schema)
Required:
blueprint_identifier
(String) The blueprint identifier of the changed entity
Required:
blueprint_identifier
(String) The blueprint identifier of the created entity
Required:
blueprint_identifier
(String) The blueprint identifier of the deleted entity
Required:
blueprint_identifier
(String) The blueprint identifier of the updated entity
Required:
expressions
(List of String) The jq expressions of the condition
Optional:
combinator
(String) The combinator of the condition
Required:
action_identifier
(String) The action identifier of the updated run
Required:
blueprint_identifier
(String) The blueprint identifier of the expired timer propertyproperty_identifier
(String) The property identifier of the expired timer property
Required:
org
(String) Required when selecting type AZURE. The Azure org that the workflow belongs towebhook
(String) Required when selecting type AZURE. The Azure webhook that the workflow belongs to
Optional:
payload
(String) The Azure Devops workflow payload should be inJSON
format, encoded as a string. Use jsonencode to encode arrays or objects. Learn about how to define the action payload.
Required:
org
(String) Required when selecting type GITHUB. The GitHub org that the workflow belongs torepo
(String) Required when selecting type GITHUB. The GitHub repo that the workflow belongs toworkflow
(String) The GitHub workflow that the action belongs to
Optional:
report_workflow_status
(String) Report the workflow status when invoking the actionworkflow_inputs
(String) The GitHub workflow inputs should be inJSON
format, encoded as a string. Use jsonencode to encode arrays or objects. Learn about how to define the action payload.
Required:
group_name
(String) Required when selecting type GITLAB. The GitLab group name that the workflow belongs toproject_name
(String) Required when selecting type GITLAB. The GitLab project name that the workflow belongs to
Optional:
default_ref
(String) The default ref of the actionpipeline_variables
(String) The Gitlab pipeline variables should be inJSON
format, encoded as a string. Use jsonencode to encode arrays or objects. Learn about how to define the action payload.
Optional:
payload
(String) The Kafka message payload should be inJSON
format, encoded as a string. Use jsonencode to encode arrays or objects. Learn about how to define the action payload.
Required:
operation
(String) The operation type of the action
Optional:
blueprint_identifier
(String) The ID of the blueprintcondition
(String) Thecondition
field allows you to define rules using Port's search & query syntax to determine which entities the action will be available for.order_properties
(List of String) Order propertiesrequired_jq_query
(String) The required jq query of the propertyuser_properties
(Attributes) User properties (see below for nested schema)
Optional:
array_props
(Attributes Map) The array property of the action (see below for nested schema)boolean_props
(Attributes Map) The boolean property of the action (see below for nested schema)number_props
(Attributes Map) The number property of the action (see below for nested schema)object_props
(Attributes Map) The object property of the action (see below for nested schema)string_props
(Attributes Map) The string property of the action (see below for nested schema)
Optional:
boolean_items
(Attributes) The items of the array property (see below for nested schema)default_jq_query
(String) The default jq query of the array propertydepends_on
(List of String) The properties that this property depends ondescription
(String) The description of the propertyicon
(String) The icon of the propertymax_items
(Number) The max items of the array propertymin_items
(Number) The min items of the array propertynumber_items
(Attributes) The items of the array property (see below for nested schema)object_items
(Attributes) The items of the array property (see below for nested schema)required
(Boolean) Whether the property is required, by default not required, this property can't be set at the same time ifrequired_jq_query
is set, and only supports true as valuestring_items
(Attributes) The items of the array property (see below for nested schema)title
(String) The title of the propertyvisible
(Boolean) The visibility of the array propertyvisible_jq_query
(String) The visibility condition jq query of the array property
Optional:
default
(List of Boolean) The default of the items
Optional:
default
(List of Number) The default of the itemsenum
(List of Number) The enum of the itemsenum_jq_query
(String) The enum jq query of the number items
Optional:
default
(List of Map of String) The default of the items
Optional:
blueprint
(String) The blueprint identifier the property relates todataset
(String) The dataset of an the entity-format itemsdefault
(List of String) The default of the itemsenum
(List of String) The enum of the itemsenum_jq_query
(String) The enum jq query of the string itemsformat
(String) The format of the items
Optional:
default
(Boolean) The default of the boolean propertydefault_jq_query
(String) The default jq query of the boolean propertydepends_on
(List of String) The properties that this property depends ondescription
(String) The description of the propertyicon
(String) The icon of the propertyrequired
(Boolean) Whether the property is required, by default not required, this property can't be set at the same time ifrequired_jq_query
is set, and only supports true as valuetitle
(String) The title of the propertyvisible
(Boolean) The visibility of the boolean propertyvisible_jq_query
(String) The visibility condition jq query of the boolean property
Optional:
default
(Number) The default of the number propertydefault_jq_query
(String) The default jq query of the number propertydepends_on
(List of String) The properties that this property depends ondescription
(String) The description of the propertyenum
(List of Number) The enum of the number propertyenum_jq_query
(String) The enum jq query of the string propertyicon
(String) The icon of the propertymaximum
(Number) The min of the number propertyminimum
(Number) The max of the number propertyrequired
(Boolean) Whether the property is required, by default not required, this property can't be set at the same time ifrequired_jq_query
is set, and only supports true as valuetitle
(String) The title of the propertyvisible
(Boolean) The visibility of the number propertyvisible_jq_query
(String) The visibility condition jq query of the number property
Optional:
default
(String) The default of the object propertydefault_jq_query
(String) The default jq query of the object propertydepends_on
(List of String) The properties that this property depends ondescription
(String) The description of the propertyencryption
(String) The algorithm to encrypt the property withicon
(String) The icon of the propertyrequired
(Boolean) Whether the property is required, by default not required, this property can't be set at the same time ifrequired_jq_query
is set, and only supports true as valuetitle
(String) The title of the propertyvisible
(Boolean) The visibility of the object propertyvisible_jq_query
(String) The visibility condition jq query of the object property
Optional:
blueprint
(String) The blueprint identifier the string property relates todataset
(Attributes) The dataset of an the entity-format property (see below for nested schema)default
(String) The default of the string propertydefault_jq_query
(String) The default jq query of the string propertydepends_on
(List of String) The properties that this property depends ondescription
(String) The description of the propertyencryption
(String) The algorithm to encrypt the property withenum
(List of String) The enum of the string propertyenum_jq_query
(String) The enum jq query of the string propertyformat
(String) The format of the string propertyicon
(String) The icon of the propertymax_length
(Number) The max length of the string propertymin_length
(Number) The min length of the string propertypattern
(String) The pattern of the string propertyrequired
(Boolean) Whether the property is required, by default not required, this property can't be set at the same time ifrequired_jq_query
is set, and only supports true as valuetitle
(String) The title of the propertyvisible
(Boolean) The visibility of the string propertyvisible_jq_query
(String) The visibility condition jq query of the string property
Required:
combinator
(String) The combinator of the datasetrules
(Attributes List) The rules of the dataset (see below for nested schema)
Required:
operator
(String) The operator of the rulevalue
(Object) The value of the rule (see below for nested schema)
Optional:
blueprint
(String) The blueprint identifier of the ruleproperty
(String) The property identifier of the rule
Optional:
jq_query
(String)
Required:
blueprint_identifier
(String) Required when selecting type Upsert Entity. The blueprint identifier of the entity for the upsert
Optional:
mapping
(Attributes) Upsert Entity invocation method (see below for nested schema)title
(String) The title of the entity
Optional:
icon
(String) The icon of the entityidentifier
(String) Required when selecting type Upsert Entity. The entity identifier for the upsertproperties
(String) The properties of the entity (key-value object encoded to a string)relations
(String) The relations of the entity (key-value object encoded to a string)teams
(List of String) The teams the entity belongs to
Required:
url
(String) Required when selecting type WEBHOOK. The URL to invoke the action
Optional:
agent
(String) Use the agent to invoke the actionbody
(String) The Webhook body should be inJSON
format, encoded as a string. Use jsonencode to encode arrays or objects. Learn about how to define the action 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. Learn about how to define the action payload.method
(String) The HTTP method to invoke the actionsynchronized
(String) Synchronize the action