harness logo
Harness v0.0.5, Oct 31 22

harness.platform.Pipeline

Resource for creating a Harness pipeline.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Harness = Lbrlabs.PulumiPackage.Harness;

return await Deployment.RunAsync(() => 
{
    var example = new Harness.Platform.Pipeline("example", new()
    {
        Identifier = "identifier",
        OrgId = "orgIdentifier",
        ProjectId = "projectIdentifier",
        Yaml = @"    pipeline:
        name: name
        identifier: identifier
        allowStageExecutions: false
        projectIdentifier: projectIdentifier
        orgIdentifier: orgIdentifier
        tags: {}
        stages:
            - stage:
                name: dep
                identifier: dep
                description: """"
                type: Deployment
                spec:
                    serviceConfig:
                        serviceRef: service
                        serviceDefinition:
                            type: Kubernetes
                            spec:
                                variables: []
                    infrastructure:
                        environmentRef: testenv
                        infrastructureDefinition:
                            type: KubernetesDirect
                            spec:
                                connectorRef: testconf
                                namespace: test
                                releaseName: release-<+INFRA_KEY>
                        allowSimultaneousDeployments: false
                    execution:
                        steps:
                            - stepGroup:
                                    name: Canary Deployment
                                    identifier: canaryDepoyment
                                    steps:
                                        - step:
                                            name: Canary Deployment
                                            identifier: canaryDeployment
                                            type: K8sCanaryDeploy
                                            timeout: 10m
                                            spec:
                                                instanceSelection:
                                                    type: Count
                                                    spec:
                                                        count: 1
                                                skipDryRun: false
                                        - step:
                                            name: Canary Delete
                                            identifier: canaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                                    rollbackSteps:
                                        - step:
                                            name: Canary Delete
                                            identifier: rollbackCanaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                            - stepGroup:
                                    name: Primary Deployment
                                    identifier: primaryDepoyment
                                    steps:
                                        - step:
                                            name: Rolling Deployment
                                            identifier: rollingDeployment
                                            type: K8sRollingDeploy
                                            timeout: 10m
                                            spec:
                                                skipDryRun: false
                                    rollbackSteps:
                                        - step:
                                            name: Rolling Rollback
                                            identifier: rollingRollback
                                            type: K8sRollingRollback
                                            timeout: 10m
                                            spec: {}
                        rollbackSteps: []
                tags: {}
                failureStrategies:
                    - onFailure:
                            errors:
                                - AllErrors
                            action:
                                type: StageRollback

",
    });

});
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.NewPipeline(ctx, "example", &platform.PipelineArgs{
			Identifier: pulumi.String("identifier"),
			OrgId:      pulumi.String("orgIdentifier"),
			ProjectId:  pulumi.String("projectIdentifier"),
			Yaml: pulumi.String(fmt.Sprintf(`    pipeline:
        name: name
        identifier: identifier
        allowStageExecutions: false
        projectIdentifier: projectIdentifier
        orgIdentifier: orgIdentifier
        tags: {}
        stages:
            - stage:
                name: dep
                identifier: dep
                description: ""
                type: Deployment
                spec:
                    serviceConfig:
                        serviceRef: service
                        serviceDefinition:
                            type: Kubernetes
                            spec:
                                variables: []
                    infrastructure:
                        environmentRef: testenv
                        infrastructureDefinition:
                            type: KubernetesDirect
                            spec:
                                connectorRef: testconf
                                namespace: test
                                releaseName: release-<+INFRA_KEY>
                        allowSimultaneousDeployments: false
                    execution:
                        steps:
                            - stepGroup:
                                    name: Canary Deployment
                                    identifier: canaryDepoyment
                                    steps:
                                        - step:
                                            name: Canary Deployment
                                            identifier: canaryDeployment
                                            type: K8sCanaryDeploy
                                            timeout: 10m
                                            spec:
                                                instanceSelection:
                                                    type: Count
                                                    spec:
                                                        count: 1
                                                skipDryRun: false
                                        - step:
                                            name: Canary Delete
                                            identifier: canaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                                    rollbackSteps:
                                        - step:
                                            name: Canary Delete
                                            identifier: rollbackCanaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                            - stepGroup:
                                    name: Primary Deployment
                                    identifier: primaryDepoyment
                                    steps:
                                        - step:
                                            name: Rolling Deployment
                                            identifier: rollingDeployment
                                            type: K8sRollingDeploy
                                            timeout: 10m
                                            spec:
                                                skipDryRun: false
                                    rollbackSteps:
                                        - step:
                                            name: Rolling Rollback
                                            identifier: rollingRollback
                                            type: K8sRollingRollback
                                            timeout: 10m
                                            spec: {}
                        rollbackSteps: []
                tags: {}
                failureStrategies:
                    - onFailure:
                            errors:
                                - AllErrors
                            action:
                                type: StageRollback

`)),
		})
		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.Pipeline;
import com.pulumi.harness.platform.PipelineArgs;
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 Pipeline("example", PipelineArgs.builder()        
            .identifier("identifier")
            .orgId("orgIdentifier")
            .projectId("projectIdentifier")
            .yaml("""
    pipeline:
        name: name
        identifier: identifier
        allowStageExecutions: false
        projectIdentifier: projectIdentifier
        orgIdentifier: orgIdentifier
        tags: {}
        stages:
            - stage:
                name: dep
                identifier: dep
                description: ""
                type: Deployment
                spec:
                    serviceConfig:
                        serviceRef: service
                        serviceDefinition:
                            type: Kubernetes
                            spec:
                                variables: []
                    infrastructure:
                        environmentRef: testenv
                        infrastructureDefinition:
                            type: KubernetesDirect
                            spec:
                                connectorRef: testconf
                                namespace: test
                                releaseName: release-<+INFRA_KEY>
                        allowSimultaneousDeployments: false
                    execution:
                        steps:
                            - stepGroup:
                                    name: Canary Deployment
                                    identifier: canaryDepoyment
                                    steps:
                                        - step:
                                            name: Canary Deployment
                                            identifier: canaryDeployment
                                            type: K8sCanaryDeploy
                                            timeout: 10m
                                            spec:
                                                instanceSelection:
                                                    type: Count
                                                    spec:
                                                        count: 1
                                                skipDryRun: false
                                        - step:
                                            name: Canary Delete
                                            identifier: canaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                                    rollbackSteps:
                                        - step:
                                            name: Canary Delete
                                            identifier: rollbackCanaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                            - stepGroup:
                                    name: Primary Deployment
                                    identifier: primaryDepoyment
                                    steps:
                                        - step:
                                            name: Rolling Deployment
                                            identifier: rollingDeployment
                                            type: K8sRollingDeploy
                                            timeout: 10m
                                            spec:
                                                skipDryRun: false
                                    rollbackSteps:
                                        - step:
                                            name: Rolling Rollback
                                            identifier: rollingRollback
                                            type: K8sRollingRollback
                                            timeout: 10m
                                            spec: {}
                        rollbackSteps: []
                tags: {}
                failureStrategies:
                    - onFailure:
                            errors:
                                - AllErrors
                            action:
                                type: StageRollback

            """)
            .build());

    }
}
import pulumi
import lbrlabs_pulumi_harness as harness

example = harness.platform.Pipeline("example",
    identifier="identifier",
    org_id="orgIdentifier",
    project_id="projectIdentifier",
    yaml="""    pipeline:
        name: name
        identifier: identifier
        allowStageExecutions: false
        projectIdentifier: projectIdentifier
        orgIdentifier: orgIdentifier
        tags: {}
        stages:
            - stage:
                name: dep
                identifier: dep
                description: ""
                type: Deployment
                spec:
                    serviceConfig:
                        serviceRef: service
                        serviceDefinition:
                            type: Kubernetes
                            spec:
                                variables: []
                    infrastructure:
                        environmentRef: testenv
                        infrastructureDefinition:
                            type: KubernetesDirect
                            spec:
                                connectorRef: testconf
                                namespace: test
                                releaseName: release-<+INFRA_KEY>
                        allowSimultaneousDeployments: false
                    execution:
                        steps:
                            - stepGroup:
                                    name: Canary Deployment
                                    identifier: canaryDepoyment
                                    steps:
                                        - step:
                                            name: Canary Deployment
                                            identifier: canaryDeployment
                                            type: K8sCanaryDeploy
                                            timeout: 10m
                                            spec:
                                                instanceSelection:
                                                    type: Count
                                                    spec:
                                                        count: 1
                                                skipDryRun: false
                                        - step:
                                            name: Canary Delete
                                            identifier: canaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                                    rollbackSteps:
                                        - step:
                                            name: Canary Delete
                                            identifier: rollbackCanaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                            - stepGroup:
                                    name: Primary Deployment
                                    identifier: primaryDepoyment
                                    steps:
                                        - step:
                                            name: Rolling Deployment
                                            identifier: rollingDeployment
                                            type: K8sRollingDeploy
                                            timeout: 10m
                                            spec:
                                                skipDryRun: false
                                    rollbackSteps:
                                        - step:
                                            name: Rolling Rollback
                                            identifier: rollingRollback
                                            type: K8sRollingRollback
                                            timeout: 10m
                                            spec: {}
                        rollbackSteps: []
                tags: {}
                failureStrategies:
                    - onFailure:
                            errors:
                                - AllErrors
                            action:
                                type: StageRollback

""")
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";

const example = new harness.platform.Pipeline("example", {
    identifier: "identifier",
    orgId: "orgIdentifier",
    projectId: "projectIdentifier",
    yaml: `    pipeline:
        name: name
        identifier: identifier
        allowStageExecutions: false
        projectIdentifier: projectIdentifier
        orgIdentifier: orgIdentifier
        tags: {}
        stages:
            - stage:
                name: dep
                identifier: dep
                description: ""
                type: Deployment
                spec:
                    serviceConfig:
                        serviceRef: service
                        serviceDefinition:
                            type: Kubernetes
                            spec:
                                variables: []
                    infrastructure:
                        environmentRef: testenv
                        infrastructureDefinition:
                            type: KubernetesDirect
                            spec:
                                connectorRef: testconf
                                namespace: test
                                releaseName: release-<+INFRA_KEY>
                        allowSimultaneousDeployments: false
                    execution:
                        steps:
                            - stepGroup:
                                    name: Canary Deployment
                                    identifier: canaryDepoyment
                                    steps:
                                        - step:
                                            name: Canary Deployment
                                            identifier: canaryDeployment
                                            type: K8sCanaryDeploy
                                            timeout: 10m
                                            spec:
                                                instanceSelection:
                                                    type: Count
                                                    spec:
                                                        count: 1
                                                skipDryRun: false
                                        - step:
                                            name: Canary Delete
                                            identifier: canaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                                    rollbackSteps:
                                        - step:
                                            name: Canary Delete
                                            identifier: rollbackCanaryDelete
                                            type: K8sCanaryDelete
                                            timeout: 10m
                                            spec: {}
                            - stepGroup:
                                    name: Primary Deployment
                                    identifier: primaryDepoyment
                                    steps:
                                        - step:
                                            name: Rolling Deployment
                                            identifier: rollingDeployment
                                            type: K8sRollingDeploy
                                            timeout: 10m
                                            spec:
                                                skipDryRun: false
                                    rollbackSteps:
                                        - step:
                                            name: Rolling Rollback
                                            identifier: rollingRollback
                                            type: K8sRollingRollback
                                            timeout: 10m
                                            spec: {}
                        rollbackSteps: []
                tags: {}
                failureStrategies:
                    - onFailure:
                            errors:
                                - AllErrors
                            action:
                                type: StageRollback
`,
});
resources:
  example:
    type: harness:platform:Pipeline
    properties:
      identifier: identifier
      orgId: orgIdentifier
      projectId: projectIdentifier
      yaml: |2+
            pipeline:
                name: name
                identifier: identifier
                allowStageExecutions: false
                projectIdentifier: projectIdentifier
                orgIdentifier: orgIdentifier
                tags: {}
                stages:
                    - stage:
                        name: dep
                        identifier: dep
                        description: ""
                        type: Deployment
                        spec:
                            serviceConfig:
                                serviceRef: service
                                serviceDefinition:
                                    type: Kubernetes
                                    spec:
                                        variables: []
                            infrastructure:
                                environmentRef: testenv
                                infrastructureDefinition:
                                    type: KubernetesDirect
                                    spec:
                                        connectorRef: testconf
                                        namespace: test
                                        releaseName: release-<+INFRA_KEY>
                                allowSimultaneousDeployments: false
                            execution:
                                steps:
                                    - stepGroup:
                                            name: Canary Deployment
                                            identifier: canaryDepoyment
                                            steps:
                                                - step:
                                                    name: Canary Deployment
                                                    identifier: canaryDeployment
                                                    type: K8sCanaryDeploy
                                                    timeout: 10m
                                                    spec:
                                                        instanceSelection:
                                                            type: Count
                                                            spec:
                                                                count: 1
                                                        skipDryRun: false
                                                - step:
                                                    name: Canary Delete
                                                    identifier: canaryDelete
                                                    type: K8sCanaryDelete
                                                    timeout: 10m
                                                    spec: {}
                                            rollbackSteps:
                                                - step:
                                                    name: Canary Delete
                                                    identifier: rollbackCanaryDelete
                                                    type: K8sCanaryDelete
                                                    timeout: 10m
                                                    spec: {}
                                    - stepGroup:
                                            name: Primary Deployment
                                            identifier: primaryDepoyment
                                            steps:
                                                - step:
                                                    name: Rolling Deployment
                                                    identifier: rollingDeployment
                                                    type: K8sRollingDeploy
                                                    timeout: 10m
                                                    spec:
                                                        skipDryRun: false
                                            rollbackSteps:
                                                - step:
                                                    name: Rolling Rollback
                                                    identifier: rollingRollback
                                                    type: K8sRollingRollback
                                                    timeout: 10m
                                                    spec: {}
                                rollbackSteps: []
                        tags: {}
                        failureStrategies:
                            - onFailure:
                                    errors:
                                        - AllErrors
                                    action:
                                        type: StageRollback

Create Pipeline Resource

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

name string
The unique name of the resource.
args PipelineArgs
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 PipelineArgs
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 PipelineArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PipelineArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args PipelineArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Pipeline 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 Pipeline 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.

Yaml string

YAML of the pipeline.

Description string

Description of the resource.

Name string

Name of the resource.

Tags List<string>

Tags to associate with the resource. Tags should be in the form name:value.

Identifier string

Unique identifier of the resource.

OrgId string

Unique identifier of the Organization.

ProjectId string

Unique identifier of the Project.

Yaml string

YAML of the pipeline.

Description string

Description of the resource.

Name string

Name of the resource.

Tags []string

Tags to associate with the resource. Tags should be in the form name:value.

identifier String

Unique identifier of the resource.

orgId String

Unique identifier of the Organization.

projectId String

Unique identifier of the Project.

yaml String

YAML of the pipeline.

description String

Description of the resource.

name String

Name of the resource.

tags List<String>

Tags to associate with the resource. Tags should be in the form name:value.

identifier string

Unique identifier of the resource.

orgId string

Unique identifier of the Organization.

projectId string

Unique identifier of the Project.

yaml string

YAML of the pipeline.

description string

Description of the resource.

name string

Name of the resource.

tags 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.

yaml str

YAML of the pipeline.

description str

Description of the resource.

name str

Name of the resource.

tags Sequence[str]

Tags to associate with the resource. Tags should be in the form name:value.

identifier String

Unique identifier of the resource.

orgId String

Unique identifier of the Organization.

projectId String

Unique identifier of the Project.

yaml String

YAML of the pipeline.

description String

Description of the resource.

name String

Name of the resource.

tags 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 Pipeline 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 Pipeline Resource

Get an existing Pipeline 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?: PipelineState, opts?: CustomResourceOptions): Pipeline
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        identifier: Optional[str] = None,
        name: Optional[str] = None,
        org_id: Optional[str] = None,
        project_id: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        yaml: Optional[str] = None) -> Pipeline
func GetPipeline(ctx *Context, name string, id IDInput, state *PipelineState, opts ...ResourceOption) (*Pipeline, error)
public static Pipeline Get(string name, Input<string> id, PipelineState? state, CustomResourceOptions? opts = null)
public static Pipeline get(String name, Output<String> id, PipelineState 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.

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. Tags should be in the form name:value.

Yaml string

YAML of the pipeline.

Description string

Description of the resource.

Identifier string

Unique identifier of the resource.

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. Tags should be in the form name:value.

Yaml string

YAML of the pipeline.

description String

Description of the resource.

identifier String

Unique identifier of the resource.

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. Tags should be in the form name:value.

yaml String

YAML of the pipeline.

description string

Description of the resource.

identifier string

Unique identifier of the resource.

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. Tags should be in the form name:value.

yaml string

YAML of the pipeline.

description str

Description of the resource.

identifier str

Unique identifier of the resource.

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. Tags should be in the form name:value.

yaml str

YAML of the pipeline.

description String

Description of the resource.

identifier String

Unique identifier of the resource.

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. Tags should be in the form name:value.

yaml String

YAML of the pipeline.

Import

Import using pipeline id

 $ pulumi import harness:platform/pipeline:Pipeline example <pipeline_id>

Package Details

Repository
harness lbrlabs/pulumi-harness
License
Apache-2.0
Notes

This Pulumi package is based on the harness Terraform Provider.