 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
- func ActionSchema() map[string]schema.Attribute
- func ArrayPropertySchema() schema.Attribute
- func BooleanPropertySchema() schema.Attribute
- func MetadataProperties() map[string]schema.Attribute
- func NewActionResource() resource.Resource
- func NumberPropertySchema() schema.Attribute
- func ObjectPropertySchema() schema.Attribute
- func StringBooleanOrJQTemplateValidator() []validator.String
- func StringPropertySchema() schema.Attribute
- type ActionModel
- type ActionResource
- func (r *ActionResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *ActionResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ActionResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ActionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ActionResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ActionResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ActionResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ActionResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- func (r *ActionResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, ...)
 
- type ActionTitle
- type ActionValidationModel
- type AnyEntityChangeEventModel
- type AnyRunChangeEvent
- type ApprovalWebhookNotificationModel
- type ArrayPropModel
- type ArrayPropValidationModel
- type AutomationTriggerModel
- type AzureMethodModel
- type BooleanItems
- type BooleanPropModel
- type BooleanPropValidationModel
- type DatasetModel
- type EntitiesSortModel
- type EntityCreatedEventModel
- type EntityDeletedEventModel
- type EntityUpdatedEventModel
- type GithubMethodModel
- type GitlabMethodModel
- type JqConditionModel
- type KafkaMethodModel
- type MappingModel
- type NumberItems
- type NumberPropModel
- type NumberPropValidationModel
- type ObjectItems
- type ObjectPropModel
- type ObjectPropValidationModel
- type Rule
- type RunCreatedEvent
- type RunUpdatedEvent
- type SelfServiceTriggerModel
- type Step
- type StringItems
- type StringPropModel
- type StringPropValidationModel
- type TimerPropertyExpiredEventModel
- type UpsertEntityMethodModel
- type UserPropertiesModel
- type Value
- type WebhookMethodModel
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
var ResourceMarkdownDescription = `
# 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\""
                            }
                        }]
                    }
                    sort = {
                        property = "$updatedAt"
                        order = "DESC"
                    }
				}
			}
			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"
                            }]
                        })
					}
                    sort = {
                        property = "$updatedAt"
                        order = "DESC"
                    }
				}
			}
		}
	}
	kafka_method = {
		payload = jsonencode({
		  runId: "{{"{{.run.id}}"}}"
		})
	}
}` + "\n```" + `
## 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 "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}}"}}"
		})
	}
}
` + "\n```" + `
## Example Usage With Condition
` + "```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
		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}}"}}"
		})
	}
	
` + "```" + `
`
    Functions ¶
func ActionSchema ¶
func ArrayPropertySchema ¶
func BooleanPropertySchema ¶
func MetadataProperties ¶
func NewActionResource ¶
func NumberPropertySchema ¶
func ObjectPropertySchema ¶
func StringPropertySchema ¶
Types ¶
type ActionModel ¶
type ActionModel struct {
	ID                          types.String                      `tfsdk:"id"`
	Identifier                  types.String                      `tfsdk:"identifier"`
	Blueprint                   types.String                      `tfsdk:"blueprint"`
	Title                       types.String                      `tfsdk:"title"`
	Icon                        types.String                      `tfsdk:"icon"`
	Description                 types.String                      `tfsdk:"description"`
	SelfServiceTrigger          *SelfServiceTriggerModel          `tfsdk:"self_service_trigger"`
	AutomationTrigger           *AutomationTriggerModel           `tfsdk:"automation_trigger"`
	KafkaMethod                 *KafkaMethodModel                 `tfsdk:"kafka_method"`
	WebhookMethod               *WebhookMethodModel               `tfsdk:"webhook_method"`
	GithubMethod                *GithubMethodModel                `tfsdk:"github_method"`
	GitlabMethod                *GitlabMethodModel                `tfsdk:"gitlab_method"`
	AzureMethod                 *AzureMethodModel                 `tfsdk:"azure_method"`
	UpsertEntityMethod          *UpsertEntityMethodModel          `tfsdk:"upsert_entity_method"`
	RequiredApproval            types.String                      `tfsdk:"required_approval"`
	ApprovalWebhookNotification *ApprovalWebhookNotificationModel `tfsdk:"approval_webhook_notification"`
	ApprovalEmailNotification   types.Object                      `tfsdk:"approval_email_notification"`
	Publish                     types.Bool                        `tfsdk:"publish"`
}
    type ActionResource ¶
type ActionResource struct {
	// contains filtered or unexported fields
}
    func (*ActionResource) Configure ¶
func (r *ActionResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*ActionResource) Create ¶
func (r *ActionResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*ActionResource) Delete ¶
func (r *ActionResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*ActionResource) ImportState ¶
func (r *ActionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
func (*ActionResource) Metadata ¶
func (r *ActionResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*ActionResource) Read ¶
func (r *ActionResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*ActionResource) Schema ¶
func (r *ActionResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*ActionResource) Update ¶
func (r *ActionResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
func (*ActionResource) ValidateConfig ¶
func (r *ActionResource) ValidateConfig(ctx context.Context, req resource.ValidateConfigRequest, resp *resource.ValidateConfigResponse)
type ActionTitle ¶ added in v2.9.0
type ActionValidationModel ¶
type ActionValidationModel struct {
	ID                          types.String `tfsdk:"id"`
	Identifier                  types.String `tfsdk:"identifier"`
	Blueprint                   types.String `tfsdk:"blueprint"`
	Title                       types.String `tfsdk:"title"`
	Icon                        types.String `tfsdk:"icon"`
	Description                 types.String `tfsdk:"description"`
	SelfServiceTrigger          types.Object `tfsdk:"self_service_trigger"`
	AutomationTrigger           types.Object `tfsdk:"automation_trigger"`
	KafkaMethod                 types.Object `tfsdk:"kafka_method"`
	WebhookMethod               types.Object `tfsdk:"webhook_method"`
	GithubMethod                types.Object `tfsdk:"github_method"`
	GitlabMethod                types.Object `tfsdk:"gitlab_method"`
	AzureMethod                 types.Object `tfsdk:"azure_method"`
	UpsertEntityMethod          types.Object `tfsdk:"upsert_entity_method"`
	RequiredApproval            types.String `tfsdk:"required_approval"`
	ApprovalWebhookNotification types.Object `tfsdk:"approval_webhook_notification"`
	ApprovalEmailNotification   types.Object `tfsdk:"approval_email_notification"`
	Publish                     types.Bool   `tfsdk:"publish"`
}
    ActionValidationModel is a model used for the validation of ActionModel resources
type AnyRunChangeEvent ¶ added in v2.0.21
type ArrayPropModel ¶
type ArrayPropModel struct {
	Title           types.String `tfsdk:"title"`
	Icon            types.String `tfsdk:"icon"`
	Description     types.String `tfsdk:"description"`
	Required        types.Bool   `tfsdk:"required"`
	DependsOn       types.List   `tfsdk:"depends_on"`
	DefaultJqQuery  types.String `tfsdk:"default_jq_query"`
	Visible         types.Bool   `tfsdk:"visible"`
	VisibleJqQuery  types.String `tfsdk:"visible_jq_query"`
	Disabled        types.Bool   `tfsdk:"disabled"`
	DisabledJqQuery types.String `tfsdk:"disabled_jq_query"`
	MaxItems     types.Int64        `tfsdk:"max_items"`
	MinItems     types.Int64        `tfsdk:"min_items"`
	StringItems  *StringItems       `tfsdk:"string_items"`
	NumberItems  *NumberItems       `tfsdk:"number_items"`
	BooleanItems *BooleanItems      `tfsdk:"boolean_items"`
	ObjectItems  *ObjectItems       `tfsdk:"object_items"`
	Sort         *EntitiesSortModel `tfsdk:"sort"`
}
    type ArrayPropValidationModel ¶
ArrayPropValidationModel is a model used for the validation of StringPropModel resources
func (*ArrayPropValidationModel) FromTerraform5Value ¶
func (e *ArrayPropValidationModel) FromTerraform5Value(val tftypes.Value) error
type AutomationTriggerModel ¶ added in v2.0.8
type AutomationTriggerModel struct {
	EntityCreatedEvent        *EntityCreatedEventModel        `tfsdk:"entity_created_event"`
	EntityUpdatedEvent        *EntityUpdatedEventModel        `tfsdk:"entity_updated_event"`
	EntityDeletedEvent        *EntityDeletedEventModel        `tfsdk:"entity_deleted_event"`
	AnyEntityChangeEvent      *AnyEntityChangeEventModel      `tfsdk:"any_entity_change_event"`
	TimerPropertyExpiredEvent *TimerPropertyExpiredEventModel `tfsdk:"timer_property_expired_event"`
	RunCreatedEvent           *RunCreatedEvent                `tfsdk:"run_created_event"`
	RunUpdatedEvent           *RunUpdatedEvent                `tfsdk:"run_updated_event"`
	AnyRunChangeEvent         *AnyRunChangeEvent              `tfsdk:"any_run_change_event"`
	JqCondition               *JqConditionModel               `tfsdk:"jq_condition"`
}
    type AzureMethodModel ¶
type BooleanItems ¶
type BooleanPropModel ¶
type BooleanPropModel struct {
	Title           types.String `tfsdk:"title"`
	Icon            types.String `tfsdk:"icon"`
	Description     types.String `tfsdk:"description"`
	Required        types.Bool   `tfsdk:"required"`
	DependsOn       types.List   `tfsdk:"depends_on"`
	Default         types.Bool   `tfsdk:"default"`
	DefaultJqQuery  types.String `tfsdk:"default_jq_query"`
	Visible         types.Bool   `tfsdk:"visible"`
	VisibleJqQuery  types.String `tfsdk:"visible_jq_query"`
	Disabled        types.Bool   `tfsdk:"disabled"`
	DisabledJqQuery types.String `tfsdk:"disabled_jq_query"`
}
    type BooleanPropValidationModel ¶
BooleanPropValidationModel is a model used for the validation of StringPropModel resources
func (*BooleanPropValidationModel) FromTerraform5Value ¶
func (e *BooleanPropValidationModel) FromTerraform5Value(val tftypes.Value) error
type DatasetModel ¶
type EntitiesSortModel ¶ added in v2.0.20
type EntityCreatedEventModel ¶
type EntityDeletedEventModel ¶
type EntityUpdatedEventModel ¶
type GithubMethodModel ¶
type GitlabMethodModel ¶
type JqConditionModel ¶
type KafkaMethodModel ¶
type MappingModel ¶ added in v2.0.8
type NumberItems ¶
type NumberPropModel ¶
type NumberPropModel struct {
	Title           types.String  `tfsdk:"title"`
	Icon            types.String  `tfsdk:"icon"`
	Description     types.String  `tfsdk:"description"`
	Required        types.Bool    `tfsdk:"required"`
	DependsOn       types.List    `tfsdk:"depends_on"`
	Default         types.Float64 `tfsdk:"default"`
	DefaultJqQuery  types.String  `tfsdk:"default_jq_query"`
	Visible         types.Bool    `tfsdk:"visible"`
	VisibleJqQuery  types.String  `tfsdk:"visible_jq_query"`
	Disabled        types.Bool    `tfsdk:"disabled"`
	DisabledJqQuery types.String  `tfsdk:"disabled_jq_query"`
	Maximum     types.Float64 `tfsdk:"maximum"`
	Minimum     types.Float64 `tfsdk:"minimum"`
	Enum        types.List    `tfsdk:"enum"`
	EnumColors  types.Map     `tfsdk:"enum_colors"`
	EnumJqQuery types.String  `tfsdk:"enum_jq_query"`
}
    type NumberPropValidationModel ¶
NumberPropValidationModel is a model used for the validation of StringPropModel resources
func (*NumberPropValidationModel) FromTerraform5Value ¶
func (e *NumberPropValidationModel) FromTerraform5Value(val tftypes.Value) error
type ObjectItems ¶
type ObjectPropModel ¶
type ObjectPropModel struct {
	Title           types.String `tfsdk:"title"`
	Icon            types.String `tfsdk:"icon"`
	Description     types.String `tfsdk:"description"`
	Required        types.Bool   `tfsdk:"required"`
	DependsOn       types.List   `tfsdk:"depends_on"`
	DefaultJqQuery  types.String `tfsdk:"default_jq_query"`
	Visible         types.Bool   `tfsdk:"visible"`
	VisibleJqQuery  types.String `tfsdk:"visible_jq_query"`
	Disabled        types.Bool   `tfsdk:"disabled"`
	DisabledJqQuery types.String `tfsdk:"disabled_jq_query"`
	Default    types.String `tfsdk:"default"`
	Encryption types.String `tfsdk:"encryption"`
}
    type ObjectPropValidationModel ¶
ObjectPropValidationModel is a model used for the validation of StringPropModel resources
func (*ObjectPropValidationModel) FromTerraform5Value ¶
func (e *ObjectPropValidationModel) FromTerraform5Value(val tftypes.Value) error
type RunCreatedEvent ¶ added in v2.0.21
type RunUpdatedEvent ¶ added in v2.0.17
type SelfServiceTriggerModel ¶
type SelfServiceTriggerModel struct {
	BlueprintIdentifier types.String           `tfsdk:"blueprint_identifier"`
	Operation           types.String           `tfsdk:"operation"`
	UserProperties      *UserPropertiesModel   `tfsdk:"user_properties"`
	Titles              map[string]ActionTitle `tfsdk:"titles"`
	RequiredJqQuery     types.String           `tfsdk:"required_jq_query"`
	OrderProperties     types.List             `tfsdk:"order_properties"`
	Steps               []Step                 `tfsdk:"steps"`
	Condition           types.String           `tfsdk:"condition"`
}
    type StringItems ¶
type StringPropModel ¶
type StringPropModel struct {
	Title           types.String  `tfsdk:"title"`
	Icon            types.String  `tfsdk:"icon"`
	Description     types.String  `tfsdk:"description"`
	Required        types.Bool    `tfsdk:"required"`
	DependsOn       types.List    `tfsdk:"depends_on"`
	Dataset         *DatasetModel `tfsdk:"dataset"`
	DefaultJqQuery  types.String  `tfsdk:"default_jq_query"`
	Visible         types.Bool    `tfsdk:"visible"`
	VisibleJqQuery  types.String  `tfsdk:"visible_jq_query"`
	Disabled        types.Bool    `tfsdk:"disabled"`
	DisabledJqQuery types.String  `tfsdk:"disabled_jq_query"`
	Default        types.String       `tfsdk:"default"`
	Blueprint      types.String       `tfsdk:"blueprint"`
	Format         types.String       `tfsdk:"format"`
	MaxLength      types.Int64        `tfsdk:"max_length"`
	MinLength      types.Int64        `tfsdk:"min_length"`
	Pattern        types.String       `tfsdk:"pattern"`
	PatternJqQuery types.String       `tfsdk:"pattern_jq_query"`
	Enum           types.List         `tfsdk:"enum"`
	EnumColors     types.Map          `tfsdk:"enum_colors"`
	EnumJqQuery    types.String       `tfsdk:"enum_jq_query"`
	Encryption     types.String       `tfsdk:"encryption"`
	Sort           *EntitiesSortModel `tfsdk:"sort"`
}
    type StringPropValidationModel ¶
StringPropValidationModel is a model used for the validation of StringPropModel resources
func (*StringPropValidationModel) FromTerraform5Value ¶
func (e *StringPropValidationModel) FromTerraform5Value(val tftypes.Value) error
type UpsertEntityMethodModel ¶ added in v2.0.8
type UpsertEntityMethodModel struct {
	Title               types.String  `tfsdk:"title"`
	BlueprintIdentifier types.String  `tfsdk:"blueprint_identifier"`
	Mapping             *MappingModel `tfsdk:"mapping"`
}
    type UserPropertiesModel ¶
type UserPropertiesModel struct {
	StringProps  map[string]StringPropModel  `tfsdk:"string_props"`
	NumberProps  map[string]NumberPropModel  `tfsdk:"number_props"`
	BooleanProps map[string]BooleanPropModel `tfsdk:"boolean_props"`
	ArrayProps   map[string]ArrayPropModel   `tfsdk:"array_props"`
	ObjectProps  map[string]ObjectPropModel  `tfsdk:"object_props"`
}
     Click to show internal directories. 
   Click to hide internal directories.