UNPKG

@lbrlabs/pulumi-harness

Version:

A Pulumi package for creating and managing Harness resources.

198 lines 9.35 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Pipeline = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for creating a Harness pipeline. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@lbrlabs/pulumi-harness"; * * const example = new harness.platform.Pipeline("example", { * gitDetails: { * branchName: "branchName", * commitMessage: "commitMessage", * connectorRef: "connectorRef", * filePath: "filePath", * repoName: "repoName", * storeType: "REMOTE", * }, * 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 * * `, * }); * ``` * * ## Import * * Import pipeline * * ```sh * $ pulumi import harness:platform/pipeline:Pipeline example <org_id>/<project_id>/<pipeline_id> * ``` */ 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, id, state, opts) { return new Pipeline(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Pipeline.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["gitDetails"] = state ? state.gitDetails : undefined; resourceInputs["identifier"] = state ? state.identifier : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["orgId"] = state ? state.orgId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["templateApplied"] = state ? state.templateApplied : undefined; resourceInputs["templateAppliedPipelineYaml"] = state ? state.templateAppliedPipelineYaml : undefined; resourceInputs["yaml"] = state ? state.yaml : undefined; } else { const args = argsOrState; if ((!args || args.identifier === undefined) && !opts.urn) { throw new Error("Missing required property 'identifier'"); } if ((!args || args.orgId === undefined) && !opts.urn) { throw new Error("Missing required property 'orgId'"); } if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if ((!args || args.yaml === undefined) && !opts.urn) { throw new Error("Missing required property 'yaml'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["gitDetails"] = args ? args.gitDetails : undefined; resourceInputs["identifier"] = args ? args.identifier : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["orgId"] = args ? args.orgId : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["templateApplied"] = args ? args.templateApplied : undefined; resourceInputs["templateAppliedPipelineYaml"] = args ? args.templateAppliedPipelineYaml : undefined; resourceInputs["yaml"] = args ? args.yaml : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Pipeline.__pulumiType, name, resourceInputs, opts); } } exports.Pipeline = Pipeline; /** @internal */ Pipeline.__pulumiType = 'harness:platform/pipeline:Pipeline'; //# sourceMappingURL=pipeline.js.map