@port-labs/port
Version:
A Pulumi package for creating and managing Port resources.
378 lines (377 loc) • 12.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Docs for the Action resource can be found [here](https://docs.getport.io/create-self-service-experiences/).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as port from "@pulumi/port";
*
* const createMicroservice = new port.index.Port_action("createMicroservice", {
* title: "Create Microservice",
* identifier: "create-microservice",
* icon: "Terraform",
* selfServiceTrigger: {
* operation: "CREATE",
* blueprintIdentifier: port_blueprint.microservice.identifier,
* userProperties: {
* stringProps: {
* myStringIdentifier: {
* title: "My String Identifier",
* required: true,
* format: "entity",
* blueprint: port_blueprint.parent.identifier,
* dataset: {
* combinator: "and",
* rules: [{
* property: "$title",
* operator: "contains",
* value: {
* jqQuery: "\"specificValue\"",
* },
* }],
* },
* sort: {
* property: "$updatedAt",
* order: "DESC",
* },
* },
* },
* numberProps: {
* myNumberIdentifier: {
* title: "My Number Identifier",
* required: true,
* maximum: 100,
* minimum: 0,
* },
* },
* booleanProps: {
* myBooleanIdentifier: {
* title: "My Boolean Identifier",
* required: true,
* },
* },
* objectProps: {
* myObjectIdentifier: {
* title: "My Object Identifier",
* required: true,
* },
* },
* arrayProps: {
* myArrayIdentifier: {
* title: "My Array Identifier",
* required: true,
* stringItems: {
* format: "entity",
* blueprint: port_blueprint.parent.identifier,
* dataset: JSON.stringify({
* combinator: "and",
* rules: [{
* property: "$title",
* operator: "contains",
* value: "specificValue",
* }],
* }),
* },
* sort: {
* property: "$updatedAt",
* order: "DESC",
* },
* },
* },
* },
* },
* kafkaMethod: {
* payload: JSON.stringify({
* runId: "{{.run.id}}",
* }),
* },
* });
* ```
*
* ### 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.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as port from "@pulumi/port";
*
* const deleteTemporaryMicroservice = new port.index.Port_action("deleteTemporaryMicroservice", {
* title: "Delete Temporary Microservice",
* identifier: "delete-temp-microservice",
* icon: "Terraform",
* automationTrigger: {
* timerPropertyExpiredEvent: {
* blueprintIdentifier: port_blueprint.microservice.identifier,
* propertyIdentifier: "ttl",
* },
* },
* kafkaMethod: {
* payload: JSON.stringify({
* runId: "{{.run.id}}",
* }),
* },
* });
* ```
*/
export declare class Action extends pulumi.CustomResource {
/**
* Get an existing Action resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ActionState, opts?: pulumi.CustomResourceOptions): Action;
/**
* Returns true if the given object is an instance of Action. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Action;
/**
* Whether members can view the runs of this action
*/
readonly allowAnyoneToViewRuns: pulumi.Output<boolean | undefined>;
/**
* The email notification of the approval
*/
readonly approvalEmailNotification: pulumi.Output<outputs.ActionApprovalEmailNotification | undefined>;
/**
* The webhook notification of the approval
*/
readonly approvalWebhookNotification: pulumi.Output<outputs.ActionApprovalWebhookNotification | undefined>;
/**
* Automation trigger for the action
*/
readonly automationTrigger: pulumi.Output<outputs.ActionAutomationTrigger | undefined>;
/**
* Azure DevOps invocation method
*/
readonly azureMethod: pulumi.Output<outputs.ActionAzureMethod | undefined>;
/**
* The blueprint identifier the action relates to
*
* @deprecated Action is not attached to blueprint anymore. This value is ignored
*/
readonly blueprint: pulumi.Output<string | undefined>;
/**
* Description
*/
readonly description: pulumi.Output<string | undefined>;
/**
* GitHub invocation method
*/
readonly githubMethod: pulumi.Output<outputs.ActionGithubMethod | undefined>;
/**
* Gitlab invocation method
*/
readonly gitlabMethod: pulumi.Output<outputs.ActionGitlabMethod | undefined>;
/**
* Icon
*/
readonly icon: pulumi.Output<string | undefined>;
/**
* Identifier
*/
readonly identifier: pulumi.Output<string>;
/**
* Kafka invocation method
*/
readonly kafkaMethod: pulumi.Output<outputs.ActionKafkaMethod | undefined>;
/**
* Publish action
*/
readonly publish: pulumi.Output<boolean>;
/**
* Require approval before invoking the action. Can be one of "true", "false", "ANY" or "ALL"
*/
readonly requiredApproval: pulumi.Output<string | undefined>;
/**
* Self service trigger for the action. Note: you can define only one of `orderProperties` and `steps`
*/
readonly selfServiceTrigger: pulumi.Output<outputs.ActionSelfServiceTrigger | undefined>;
/**
* Title
*/
readonly title: pulumi.Output<string | undefined>;
/**
* Upsert Entity invocation method
*/
readonly upsertEntityMethod: pulumi.Output<outputs.ActionUpsertEntityMethod | undefined>;
/**
* Webhook invocation method
*/
readonly webhookMethod: pulumi.Output<outputs.ActionWebhookMethod | undefined>;
/**
* Create a Action resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ActionArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Action resources.
*/
export interface ActionState {
/**
* Whether members can view the runs of this action
*/
allowAnyoneToViewRuns?: pulumi.Input<boolean>;
/**
* The email notification of the approval
*/
approvalEmailNotification?: pulumi.Input<inputs.ActionApprovalEmailNotification>;
/**
* The webhook notification of the approval
*/
approvalWebhookNotification?: pulumi.Input<inputs.ActionApprovalWebhookNotification>;
/**
* Automation trigger for the action
*/
automationTrigger?: pulumi.Input<inputs.ActionAutomationTrigger>;
/**
* Azure DevOps invocation method
*/
azureMethod?: pulumi.Input<inputs.ActionAzureMethod>;
/**
* The blueprint identifier the action relates to
*
* @deprecated Action is not attached to blueprint anymore. This value is ignored
*/
blueprint?: pulumi.Input<string>;
/**
* Description
*/
description?: pulumi.Input<string>;
/**
* GitHub invocation method
*/
githubMethod?: pulumi.Input<inputs.ActionGithubMethod>;
/**
* Gitlab invocation method
*/
gitlabMethod?: pulumi.Input<inputs.ActionGitlabMethod>;
/**
* Icon
*/
icon?: pulumi.Input<string>;
/**
* Identifier
*/
identifier?: pulumi.Input<string>;
/**
* Kafka invocation method
*/
kafkaMethod?: pulumi.Input<inputs.ActionKafkaMethod>;
/**
* Publish action
*/
publish?: pulumi.Input<boolean>;
/**
* Require approval before invoking the action. Can be one of "true", "false", "ANY" or "ALL"
*/
requiredApproval?: pulumi.Input<string>;
/**
* Self service trigger for the action. Note: you can define only one of `orderProperties` and `steps`
*/
selfServiceTrigger?: pulumi.Input<inputs.ActionSelfServiceTrigger>;
/**
* Title
*/
title?: pulumi.Input<string>;
/**
* Upsert Entity invocation method
*/
upsertEntityMethod?: pulumi.Input<inputs.ActionUpsertEntityMethod>;
/**
* Webhook invocation method
*/
webhookMethod?: pulumi.Input<inputs.ActionWebhookMethod>;
}
/**
* The set of arguments for constructing a Action resource.
*/
export interface ActionArgs {
/**
* Whether members can view the runs of this action
*/
allowAnyoneToViewRuns?: pulumi.Input<boolean>;
/**
* The email notification of the approval
*/
approvalEmailNotification?: pulumi.Input<inputs.ActionApprovalEmailNotification>;
/**
* The webhook notification of the approval
*/
approvalWebhookNotification?: pulumi.Input<inputs.ActionApprovalWebhookNotification>;
/**
* Automation trigger for the action
*/
automationTrigger?: pulumi.Input<inputs.ActionAutomationTrigger>;
/**
* Azure DevOps invocation method
*/
azureMethod?: pulumi.Input<inputs.ActionAzureMethod>;
/**
* The blueprint identifier the action relates to
*
* @deprecated Action is not attached to blueprint anymore. This value is ignored
*/
blueprint?: pulumi.Input<string>;
/**
* Description
*/
description?: pulumi.Input<string>;
/**
* GitHub invocation method
*/
githubMethod?: pulumi.Input<inputs.ActionGithubMethod>;
/**
* Gitlab invocation method
*/
gitlabMethod?: pulumi.Input<inputs.ActionGitlabMethod>;
/**
* Icon
*/
icon?: pulumi.Input<string>;
/**
* Identifier
*/
identifier: pulumi.Input<string>;
/**
* Kafka invocation method
*/
kafkaMethod?: pulumi.Input<inputs.ActionKafkaMethod>;
/**
* Publish action
*/
publish?: pulumi.Input<boolean>;
/**
* Require approval before invoking the action. Can be one of "true", "false", "ANY" or "ALL"
*/
requiredApproval?: pulumi.Input<string>;
/**
* Self service trigger for the action. Note: you can define only one of `orderProperties` and `steps`
*/
selfServiceTrigger?: pulumi.Input<inputs.ActionSelfServiceTrigger>;
/**
* Title
*/
title?: pulumi.Input<string>;
/**
* Upsert Entity invocation method
*/
upsertEntityMethod?: pulumi.Input<inputs.ActionUpsertEntityMethod>;
/**
* Webhook invocation method
*/
webhookMethod?: pulumi.Input<inputs.ActionWebhookMethod>;
}