1. Packages
  2. Harness
  3. API Docs
  4. platform
  5. Triggers
Harness v0.2.0 published on Wednesday, Jul 24, 2024 by Pulumi

harness.platform.Triggers

Explore with Pulumi AI

harness logo
Harness v0.2.0 published on Wednesday, Jul 24, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const example = new harness.platform.Triggers("example", {
        identifier: "identifier",
        orgId: "orgIdentifer",
        projectId: "projectIdentifier",
        name: "name",
        targetId: "pipelineIdentifier",
        yaml: `trigger:
      name: name
      identifier: identifier
      enabled: true
      description: ""
      tags: {}
      projectIdentifier: projectIdentifier
      orgIdentifier: orgIdentifer
      pipelineIdentifier: pipelineIdentifier
      source:
        type: Webhook
        spec:
          type: Github
          spec:
            type: Push
            spec:
              connectorRef: account.TestAccResourceConnectorGithub_Ssh_IZBeG
              autoAbortPreviousExecutions: false
              payloadConditions:
              - key: changedFiles
                operator: Equals
                value: value
              - key: targetBranch
                operator: Equals
                value: value
              headerConditions: []
              repoName: repoName
              actions: []
      inputYaml: |
        pipeline: {}\\n
    `,
    });
    
    import pulumi
    import pulumi_harness as harness
    
    example = harness.platform.Triggers("example",
        identifier="identifier",
        org_id="orgIdentifer",
        project_id="projectIdentifier",
        name="name",
        target_id="pipelineIdentifier",
        yaml="""trigger:
      name: name
      identifier: identifier
      enabled: true
      description: ""
      tags: {}
      projectIdentifier: projectIdentifier
      orgIdentifier: orgIdentifer
      pipelineIdentifier: pipelineIdentifier
      source:
        type: Webhook
        spec:
          type: Github
          spec:
            type: Push
            spec:
              connectorRef: account.TestAccResourceConnectorGithub_Ssh_IZBeG
              autoAbortPreviousExecutions: false
              payloadConditions:
              - key: changedFiles
                operator: Equals
                value: value
              - key: targetBranch
                operator: Equals
                value: value
              headerConditions: []
              repoName: repoName
              actions: []
      inputYaml: |
        pipeline: {}\n
    """)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := platform.NewTriggers(ctx, "example", &platform.TriggersArgs{
    			Identifier: pulumi.String("identifier"),
    			OrgId:      pulumi.String("orgIdentifer"),
    			ProjectId:  pulumi.String("projectIdentifier"),
    			Name:       pulumi.String("name"),
    			TargetId:   pulumi.String("pipelineIdentifier"),
    			Yaml: pulumi.String(`trigger:
      name: name
      identifier: identifier
      enabled: true
      description: ""
      tags: {}
      projectIdentifier: projectIdentifier
      orgIdentifier: orgIdentifer
      pipelineIdentifier: pipelineIdentifier
      source:
        type: Webhook
        spec:
          type: Github
          spec:
            type: Push
            spec:
              connectorRef: account.TestAccResourceConnectorGithub_Ssh_IZBeG
              autoAbortPreviousExecutions: false
              payloadConditions:
              - key: changedFiles
                operator: Equals
                value: value
              - key: targetBranch
                operator: Equals
                value: value
              headerConditions: []
              repoName: repoName
              actions: []
      inputYaml: |
        pipeline: {}\n
    `),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Harness = Pulumi.Harness;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Harness.Platform.Triggers("example", new()
        {
            Identifier = "identifier",
            OrgId = "orgIdentifer",
            ProjectId = "projectIdentifier",
            Name = "name",
            TargetId = "pipelineIdentifier",
            Yaml = @"trigger:
      name: name
      identifier: identifier
      enabled: true
      description: """"
      tags: {}
      projectIdentifier: projectIdentifier
      orgIdentifier: orgIdentifer
      pipelineIdentifier: pipelineIdentifier
      source:
        type: Webhook
        spec:
          type: Github
          spec:
            type: Push
            spec:
              connectorRef: account.TestAccResourceConnectorGithub_Ssh_IZBeG
              autoAbortPreviousExecutions: false
              payloadConditions:
              - key: changedFiles
                operator: Equals
                value: value
              - key: targetBranch
                operator: Equals
                value: value
              headerConditions: []
              repoName: repoName
              actions: []
      inputYaml: |
        pipeline: {}\n
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.Triggers;
    import com.pulumi.harness.platform.TriggersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Triggers("example", TriggersArgs.builder()
                .identifier("identifier")
                .orgId("orgIdentifer")
                .projectId("projectIdentifier")
                .name("name")
                .targetId("pipelineIdentifier")
                .yaml("""
    trigger:
      name: name
      identifier: identifier
      enabled: true
      description: ""
      tags: {}
      projectIdentifier: projectIdentifier
      orgIdentifier: orgIdentifer
      pipelineIdentifier: pipelineIdentifier
      source:
        type: Webhook
        spec:
          type: Github
          spec:
            type: Push
            spec:
              connectorRef: account.TestAccResourceConnectorGithub_Ssh_IZBeG
              autoAbortPreviousExecutions: false
              payloadConditions:
              - key: changedFiles
                operator: Equals
                value: value
              - key: targetBranch
                operator: Equals
                value: value
              headerConditions: []
              repoName: repoName
              actions: []
      inputYaml: |
        pipeline: {}\n
                """)
                .build());
    
        }
    }
    
    resources:
      example:
        type: harness:platform:Triggers
        properties:
          identifier: identifier
          orgId: orgIdentifer
          projectId: projectIdentifier
          name: name
          targetId: pipelineIdentifier
          yaml: |
            trigger:
              name: name
              identifier: identifier
              enabled: true
              description: ""
              tags: {}
              projectIdentifier: projectIdentifier
              orgIdentifier: orgIdentifer
              pipelineIdentifier: pipelineIdentifier
              source:
                type: Webhook
                spec:
                  type: Github
                  spec:
                    type: Push
                    spec:
                      connectorRef: account.TestAccResourceConnectorGithub_Ssh_IZBeG
                      autoAbortPreviousExecutions: false
                      payloadConditions:
                      - key: changedFiles
                        operator: Equals
                        value: value
                      - key: targetBranch
                        operator: Equals
                        value: value
                      headerConditions: []
                      repoName: repoName
                      actions: []
              inputYaml: |
                pipeline: {}\n        
    

    Create Triggers Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Triggers(name: string, args: TriggersArgs, opts?: CustomResourceOptions);
    @overload
    def Triggers(resource_name: str,
                 args: TriggersArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Triggers(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 identifier: Optional[str] = None,
                 org_id: Optional[str] = None,
                 project_id: Optional[str] = None,
                 target_id: Optional[str] = None,
                 yaml: Optional[str] = None,
                 description: Optional[str] = None,
                 if_match: Optional[str] = None,
                 ignore_error: Optional[bool] = None,
                 name: Optional[str] = None,
                 tags: Optional[Sequence[str]] = None)
    func NewTriggers(ctx *Context, name string, args TriggersArgs, opts ...ResourceOption) (*Triggers, error)
    public Triggers(string name, TriggersArgs args, CustomResourceOptions? opts = null)
    public Triggers(String name, TriggersArgs args)
    public Triggers(String name, TriggersArgs args, CustomResourceOptions options)
    
    type: harness:platform:Triggers
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args TriggersArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args TriggersArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args TriggersArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TriggersArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TriggersArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var triggersResource = new Harness.Platform.Triggers("triggersResource", new()
    {
        Identifier = "string",
        OrgId = "string",
        ProjectId = "string",
        TargetId = "string",
        Yaml = "string",
        Description = "string",
        IfMatch = "string",
        IgnoreError = false,
        Name = "string",
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := platform.NewTriggers(ctx, "triggersResource", &platform.TriggersArgs{
    	Identifier:  pulumi.String("string"),
    	OrgId:       pulumi.String("string"),
    	ProjectId:   pulumi.String("string"),
    	TargetId:    pulumi.String("string"),
    	Yaml:        pulumi.String("string"),
    	Description: pulumi.String("string"),
    	IfMatch:     pulumi.String("string"),
    	IgnoreError: pulumi.Bool(false),
    	Name:        pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var triggersResource = new Triggers("triggersResource", TriggersArgs.builder()
        .identifier("string")
        .orgId("string")
        .projectId("string")
        .targetId("string")
        .yaml("string")
        .description("string")
        .ifMatch("string")
        .ignoreError(false)
        .name("string")
        .tags("string")
        .build());
    
    triggers_resource = harness.platform.Triggers("triggersResource",
        identifier="string",
        org_id="string",
        project_id="string",
        target_id="string",
        yaml="string",
        description="string",
        if_match="string",
        ignore_error=False,
        name="string",
        tags=["string"])
    
    const triggersResource = new harness.platform.Triggers("triggersResource", {
        identifier: "string",
        orgId: "string",
        projectId: "string",
        targetId: "string",
        yaml: "string",
        description: "string",
        ifMatch: "string",
        ignoreError: false,
        name: "string",
        tags: ["string"],
    });
    
    type: harness:platform:Triggers
    properties:
        description: string
        identifier: string
        ifMatch: string
        ignoreError: false
        name: string
        orgId: string
        projectId: string
        tags:
            - string
        targetId: string
        yaml: string
    

    Triggers Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Triggers resource accepts the following input properties:

    Identifier string
    Unique identifier of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    TargetId string
    Identifier of the target pipeline
    Yaml string
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    Description string
    Description of the resource.
    IfMatch string
    if-Match
    IgnoreError bool
    ignore error default false
    Name string
    Name of the resource.
    Tags List<string>
    Tags to associate with the resource.
    Identifier string
    Unique identifier of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    TargetId string
    Identifier of the target pipeline
    Yaml string
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    Description string
    Description of the resource.
    IfMatch string
    if-Match
    IgnoreError bool
    ignore error default false
    Name string
    Name of the resource.
    Tags []string
    Tags to associate with the resource.
    identifier String
    Unique identifier of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    targetId String
    Identifier of the target pipeline
    yaml String
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    description String
    Description of the resource.
    ifMatch String
    if-Match
    ignoreError Boolean
    ignore error default false
    name String
    Name of the resource.
    tags List<String>
    Tags to associate with the resource.
    identifier string
    Unique identifier of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    targetId string
    Identifier of the target pipeline
    yaml string
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    description string
    Description of the resource.
    ifMatch string
    if-Match
    ignoreError boolean
    ignore error default false
    name string
    Name of the resource.
    tags string[]
    Tags to associate with the resource.
    identifier str
    Unique identifier of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    target_id str
    Identifier of the target pipeline
    yaml str
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    description str
    Description of the resource.
    if_match str
    if-Match
    ignore_error bool
    ignore error default false
    name str
    Name of the resource.
    tags Sequence[str]
    Tags to associate with the resource.
    identifier String
    Unique identifier of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    targetId String
    Identifier of the target pipeline
    yaml String
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    description String
    Description of the resource.
    ifMatch String
    if-Match
    ignoreError Boolean
    ignore error default false
    name String
    Name of the resource.
    tags List<String>
    Tags to associate with the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Triggers resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Triggers Resource

    Get an existing Triggers resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: TriggersState, opts?: CustomResourceOptions): Triggers
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            identifier: Optional[str] = None,
            if_match: Optional[str] = None,
            ignore_error: Optional[bool] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            project_id: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            target_id: Optional[str] = None,
            yaml: Optional[str] = None) -> Triggers
    func GetTriggers(ctx *Context, name string, id IDInput, state *TriggersState, opts ...ResourceOption) (*Triggers, error)
    public static Triggers Get(string name, Input<string> id, TriggersState? state, CustomResourceOptions? opts = null)
    public static Triggers get(String name, Output<String> id, TriggersState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string
    Description of the resource.
    Identifier string
    Unique identifier of the resource.
    IfMatch string
    if-Match
    IgnoreError bool
    ignore error default false
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags List<string>
    Tags to associate with the resource.
    TargetId string
    Identifier of the target pipeline
    Yaml string
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    Description string
    Description of the resource.
    Identifier string
    Unique identifier of the resource.
    IfMatch string
    if-Match
    IgnoreError bool
    ignore error default false
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags []string
    Tags to associate with the resource.
    TargetId string
    Identifier of the target pipeline
    Yaml string
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    description String
    Description of the resource.
    identifier String
    Unique identifier of the resource.
    ifMatch String
    if-Match
    ignoreError Boolean
    ignore error default false
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    targetId String
    Identifier of the target pipeline
    yaml String
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    description string
    Description of the resource.
    identifier string
    Unique identifier of the resource.
    ifMatch string
    if-Match
    ignoreError boolean
    ignore error default false
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    tags string[]
    Tags to associate with the resource.
    targetId string
    Identifier of the target pipeline
    yaml string
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    description str
    Description of the resource.
    identifier str
    Unique identifier of the resource.
    if_match str
    if-Match
    ignore_error bool
    ignore error default false
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    tags Sequence[str]
    Tags to associate with the resource.
    target_id str
    Identifier of the target pipeline
    yaml str
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
    description String
    Description of the resource.
    identifier String
    Unique identifier of the resource.
    ifMatch String
    if-Match
    ignoreError Boolean
    ignore error default false
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    targetId String
    Identifier of the target pipeline
    yaml String
    trigger yaml. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.

    Import

    Import trigger

    $ pulumi import harness:platform/triggers:Triggers example <org_id>/<project_id>/<target_id>/<triggers_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.2.0 published on Wednesday, Jul 24, 2024 by Pulumi