@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
345 lines (344 loc) • 13.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Resource for creating a Harness pipeline.
*
* ## Example Usage
*
* ```typescript
* 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",
* name: "name",
* gitDetails: {
* branchName: "branchName",
* commitMessage: "commitMessage",
* filePath: "filePath",
* connectorRef: "connectorRef",
* storeType: "REMOTE",
* repoName: "repoName",
* },
* tags: {},
* 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
* `,
* });
* //## Importing Pipeline from Git
* const test = new harness.platform.Organization("test", {
* identifier: "identifier",
* name: "name",
* });
* const testPipeline = new harness.platform.Pipeline("test", {
* identifier: "gitx",
* orgId: "default",
* projectId: "V",
* name: "gitx",
* importFromGit: true,
* gitImportInfo: {
* branchName: "main",
* filePath: ".harness/gitx.yaml",
* connectorRef: "account.DoNotDeleteGithub",
* repoName: "open-repo",
* },
* pipelineImportRequest: {
* pipelineName: "gitx",
* pipelineDescription: "Pipeline Description",
* },
* });
* ```
*
* ## Import
*
* The `pulumi import` command can be used, for example:
*
* Import pipeline from default branch
*
* ```sh
* $ pulumi import harness:platform/pipeline:Pipeline example <org_id>/<project_id>/<pipeline_id>
* ```
*
* Import pipeline from non default branch
*
* ```sh
* $ pulumi import harness:platform/pipeline:Pipeline example <org_id>/<project_id>/<pipeline_id>/<branch>
* ```
*/
export declare class Pipeline extends pulumi.CustomResource {
/**
* Get an existing Pipeline 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?: PipelineState, opts?: pulumi.CustomResourceOptions): Pipeline;
/**
* Returns true if the given object is an instance of Pipeline. 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 Pipeline;
/**
* Description of the resource.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Contains parameters related to creating an Entity for Git Experience.
*/
readonly gitDetails: pulumi.Output<outputs.platform.PipelineGitDetails>;
/**
* Contains Git Information for importing entities from Git
*/
readonly gitImportInfo: pulumi.Output<outputs.platform.PipelineGitImportInfo | undefined>;
/**
* Unique identifier of the resource.
*/
readonly identifier: pulumi.Output<string>;
/**
* Flag to set if importing from Git
*/
readonly importFromGit: pulumi.Output<boolean | undefined>;
/**
* Name of the resource.
*/
readonly name: pulumi.Output<string>;
/**
* Unique identifier of the organization.
*/
readonly orgId: pulumi.Output<string>;
/**
* Contains parameters for importing a pipeline
*/
readonly pipelineImportRequest: pulumi.Output<outputs.platform.PipelinePipelineImportRequest | undefined>;
/**
* Unique identifier of the project.
*/
readonly projectId: pulumi.Output<string>;
/**
* Tags to associate with the resource. These should match the tag value passed in the YAML; if this parameter is null or not passed, the tags specified in YAML should also be null.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* If true, returns Pipeline YAML with Templates applied on it.
*/
readonly templateApplied: pulumi.Output<boolean | undefined>;
/**
* Pipeline YAML after resolving Templates (returned as a String).
*/
readonly templateAppliedPipelineYaml: pulumi.Output<string | undefined>;
/**
* YAML of the pipeline. 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.
*/
readonly yaml: pulumi.Output<string>;
/**
* Create a Pipeline 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: PipelineArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Pipeline resources.
*/
export interface PipelineState {
/**
* Description of the resource.
*/
description?: pulumi.Input<string>;
/**
* Contains parameters related to creating an Entity for Git Experience.
*/
gitDetails?: pulumi.Input<inputs.platform.PipelineGitDetails>;
/**
* Contains Git Information for importing entities from Git
*/
gitImportInfo?: pulumi.Input<inputs.platform.PipelineGitImportInfo>;
/**
* Unique identifier of the resource.
*/
identifier?: pulumi.Input<string>;
/**
* Flag to set if importing from Git
*/
importFromGit?: pulumi.Input<boolean>;
/**
* Name of the resource.
*/
name?: pulumi.Input<string>;
/**
* Unique identifier of the organization.
*/
orgId?: pulumi.Input<string>;
/**
* Contains parameters for importing a pipeline
*/
pipelineImportRequest?: pulumi.Input<inputs.platform.PipelinePipelineImportRequest>;
/**
* Unique identifier of the project.
*/
projectId?: pulumi.Input<string>;
/**
* Tags to associate with the resource. These should match the tag value passed in the YAML; if this parameter is null or not passed, the tags specified in YAML should also be null.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* If true, returns Pipeline YAML with Templates applied on it.
*/
templateApplied?: pulumi.Input<boolean>;
/**
* Pipeline YAML after resolving Templates (returned as a String).
*/
templateAppliedPipelineYaml?: pulumi.Input<string>;
/**
* YAML of the pipeline. 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.
*/
yaml?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Pipeline resource.
*/
export interface PipelineArgs {
/**
* Description of the resource.
*/
description?: pulumi.Input<string>;
/**
* Contains parameters related to creating an Entity for Git Experience.
*/
gitDetails?: pulumi.Input<inputs.platform.PipelineGitDetails>;
/**
* Contains Git Information for importing entities from Git
*/
gitImportInfo?: pulumi.Input<inputs.platform.PipelineGitImportInfo>;
/**
* Unique identifier of the resource.
*/
identifier: pulumi.Input<string>;
/**
* Flag to set if importing from Git
*/
importFromGit?: pulumi.Input<boolean>;
/**
* Name of the resource.
*/
name?: pulumi.Input<string>;
/**
* Unique identifier of the organization.
*/
orgId: pulumi.Input<string>;
/**
* Contains parameters for importing a pipeline
*/
pipelineImportRequest?: pulumi.Input<inputs.platform.PipelinePipelineImportRequest>;
/**
* Unique identifier of the project.
*/
projectId: pulumi.Input<string>;
/**
* Tags to associate with the resource. These should match the tag value passed in the YAML; if this parameter is null or not passed, the tags specified in YAML should also be null.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* If true, returns Pipeline YAML with Templates applied on it.
*/
templateApplied?: pulumi.Input<boolean>;
/**
* Pipeline YAML after resolving Templates (returned as a String).
*/
templateAppliedPipelineYaml?: pulumi.Input<string>;
/**
* YAML of the pipeline. 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.
*/
yaml?: pulumi.Input<string>;
}