@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
158 lines • 5.83 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.InfraVariableSet = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing Variable Sets
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@pulumi/harness";
*
* const example = new harness.platform.InfraVariableSet("example", {
* identifier: "example",
* name: "example",
* orgId: test.id,
* projectId: testHarnessPlatformProject.id,
* description: "some description",
* environmentVariables: [
* {
* key: "key1",
* value: "value1",
* valueType: "string",
* },
* {
* key: "key2",
* value: "harness_platform_secret_text.test.id",
* valueType: "secret",
* },
* ],
* terraformVariables: [
* {
* key: "key1",
* value: "1111",
* valueType: "string",
* },
* {
* key: "key2",
* value: "1111u",
* valueType: "string",
* },
* ],
* terraformVariableFiles: [
* {
* repository: "https://github.com/org/repo",
* repositoryBranch: "main",
* repositoryPath: "tf/aws/basic",
* repositoryConnector: "harness_platform_connector_github.test.id",
* },
* {
* repository: "https://github.com/org/repo",
* repositoryBranch: "br2",
* repositoryPath: "tf/aws/basic",
* repositoryConnector: "harness_platform_connector_github.test.id",
* },
* ],
* connectors: [
* {
* connectorRef: "harness_platform_connector_aws.test.id",
* type: "aws",
* },
* {
* connectorRef: "harness_platform_connector_azure.test.id",
* type: "azure",
* },
* ],
* });
* ```
*
* ## Import
*
* The `pulumi import` command can be used, for example:
*
* Import account level variable set
*
* ```sh
* $ pulumi import harness:platform/infraVariableSet:InfraVariableSet example <variable_set_id>
* ```
*
* Import org level variable set
*
* ```sh
* $ pulumi import harness:platform/infraVariableSet:InfraVariableSet example <ord_id>/<variable_set_id>
* ```
*
* Import project level variable set
*
* ```sh
* $ pulumi import harness:platform/infraVariableSet:InfraVariableSet example <org_id>/<project_id>/<variable_set_id>
* ```
*/
class InfraVariableSet extends pulumi.CustomResource {
/**
* Get an existing InfraVariableSet 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 InfraVariableSet(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of InfraVariableSet. 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'] === InfraVariableSet.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["connectors"] = state?.connectors;
resourceInputs["description"] = state?.description;
resourceInputs["environmentVariables"] = state?.environmentVariables;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["name"] = state?.name;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["tags"] = state?.tags;
resourceInputs["terraformVariableFiles"] = state?.terraformVariableFiles;
resourceInputs["terraformVariables"] = state?.terraformVariables;
}
else {
const args = argsOrState;
if (args?.identifier === undefined && !opts.urn) {
throw new Error("Missing required property 'identifier'");
}
resourceInputs["connectors"] = args?.connectors;
resourceInputs["description"] = args?.description;
resourceInputs["environmentVariables"] = args?.environmentVariables;
resourceInputs["identifier"] = args?.identifier;
resourceInputs["name"] = args?.name;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["tags"] = args?.tags;
resourceInputs["terraformVariableFiles"] = args?.terraformVariableFiles;
resourceInputs["terraformVariables"] = args?.terraformVariables;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InfraVariableSet.__pulumiType, name, resourceInputs, opts);
}
}
exports.InfraVariableSet = InfraVariableSet;
/** @internal */
InfraVariableSet.__pulumiType = 'harness:platform/infraVariableSet:InfraVariableSet';
//# sourceMappingURL=infraVariableSet.js.map