harness.platform.Triggers
Resource for craeting triggers in Harness.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Harness = Lbrlabs.PulumiPackage.Harness;
return await Deployment.RunAsync(() =>
{
var example = new Harness.Platform.Triggers("example", new()
{
Identifier = "identifier",
OrgId = "orgIdentifer",
ProjectId = "projectIdentifier",
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 main
import (
"fmt"
"github.com/lbrlabs/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"),
TargetId: pulumi.String("pipelineIdentifier"),
Yaml: pulumi.String(fmt.Sprintf(` 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
})
}
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")
.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());
}
}
import pulumi
import lbrlabs_pulumi_harness as harness
example = harness.platform.Triggers("example",
identifier="identifier",
org_id="orgIdentifer",
project_id="projectIdentifier",
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"
""")
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",
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"
`,
});
resources:
example:
type: harness:platform:Triggers
properties:
identifier: identifier
orgId: orgIdentifer
projectId: projectIdentifier
targetId: pipelineIdentifier
yaml: |2+
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
new Triggers(name: string, args: TriggersArgs, opts?: CustomResourceOptions);
@overload
def Triggers(resource_name: 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)
@overload
def Triggers(resource_name: str,
args: TriggersArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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.
- Org
Id string Unique identifier of the Organization.
- Project
Id string Unique identifier of the Project.
- Target
Id string Identifier of the target pipeline
- Yaml string
trigger yaml
- Description string
Description of the resource.
- If
Match string if-Match
- Ignore
Error bool ignore error default false
- Name string
Name of the resource.
- List<string>
Tags to associate with the resource. Tags should be in the form
name:value
.
- Identifier string
Unique identifier of the resource.
- Org
Id string Unique identifier of the Organization.
- Project
Id string Unique identifier of the Project.
- Target
Id string Identifier of the target pipeline
- Yaml string
trigger yaml
- Description string
Description of the resource.
- If
Match string if-Match
- Ignore
Error bool ignore error default false
- Name string
Name of the resource.
- []string
Tags to associate with the resource. Tags should be in the form
name:value
.
- identifier String
Unique identifier of the resource.
- org
Id String Unique identifier of the Organization.
- project
Id String Unique identifier of the Project.
- target
Id String Identifier of the target pipeline
- yaml String
trigger yaml
- description String
Description of the resource.
- if
Match String if-Match
- ignore
Error Boolean ignore error default false
- name String
Name of the resource.
- List<String>
Tags to associate with the resource. Tags should be in the form
name:value
.
- identifier string
Unique identifier of the resource.
- org
Id string Unique identifier of the Organization.
- project
Id string Unique identifier of the Project.
- target
Id string Identifier of the target pipeline
- yaml string
trigger yaml
- description string
Description of the resource.
- if
Match string if-Match
- ignore
Error boolean ignore error default false
- name string
Name of the resource.
- string[]
Tags to associate with the resource. Tags should be in the form
name:value
.
- 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
- description str
Description of the resource.
- if_
match str if-Match
- ignore_
error bool ignore error default false
- name str
Name of the resource.
- Sequence[str]
Tags to associate with the resource. Tags should be in the form
name:value
.
- identifier String
Unique identifier of the resource.
- org
Id String Unique identifier of the Organization.
- project
Id String Unique identifier of the Project.
- target
Id String Identifier of the target pipeline
- yaml String
trigger yaml
- description String
Description of the resource.
- if
Match String if-Match
- ignore
Error Boolean ignore error default false
- name String
Name of the resource.
- List<String>
Tags to associate with the resource. Tags should be in the form
name:value
.
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.
- Description string
Description of the resource.
- Identifier string
Unique identifier of the resource.
- If
Match string if-Match
- Ignore
Error bool ignore error default false
- Name string
Name of the resource.
- Org
Id string Unique identifier of the Organization.
- Project
Id string Unique identifier of the Project.
- List<string>
Tags to associate with the resource. Tags should be in the form
name:value
.- Target
Id string Identifier of the target pipeline
- Yaml string
trigger yaml
- Description string
Description of the resource.
- Identifier string
Unique identifier of the resource.
- If
Match string if-Match
- Ignore
Error bool ignore error default false
- Name string
Name of the resource.
- Org
Id string Unique identifier of the Organization.
- Project
Id string Unique identifier of the Project.
- []string
Tags to associate with the resource. Tags should be in the form
name:value
.- Target
Id string Identifier of the target pipeline
- Yaml string
trigger yaml
- description String
Description of the resource.
- identifier String
Unique identifier of the resource.
- if
Match String if-Match
- ignore
Error Boolean ignore error default false
- name String
Name of the resource.
- org
Id String Unique identifier of the Organization.
- project
Id String Unique identifier of the Project.
- List<String>
Tags to associate with the resource. Tags should be in the form
name:value
.- target
Id String Identifier of the target pipeline
- yaml String
trigger yaml
- description string
Description of the resource.
- identifier string
Unique identifier of the resource.
- if
Match string if-Match
- ignore
Error boolean ignore error default false
- name string
Name of the resource.
- org
Id string Unique identifier of the Organization.
- project
Id string Unique identifier of the Project.
- string[]
Tags to associate with the resource. Tags should be in the form
name:value
.- target
Id string Identifier of the target pipeline
- yaml string
trigger yaml
- 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.
- Sequence[str]
Tags to associate with the resource. Tags should be in the form
name:value
.- target_
id str Identifier of the target pipeline
- yaml str
trigger yaml
- description String
Description of the resource.
- identifier String
Unique identifier of the resource.
- if
Match String if-Match
- ignore
Error Boolean ignore error default false
- name String
Name of the resource.
- org
Id String Unique identifier of the Organization.
- project
Id String Unique identifier of the Project.
- List<String>
Tags to associate with the resource. Tags should be in the form
name:value
.- target
Id String Identifier of the target pipeline
- yaml String
trigger yaml
Import
Import using trigger id
$ pulumi import harness:platform/triggers:Triggers example <triggers_id>
Package Details
- Repository
- harness lbrlabs/pulumi-harness
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
harness
Terraform Provider.