@pulumi/harness
Version:
A Pulumi package for creating and managing Harness resources.
125 lines • 5.57 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.AwsProxy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for creating an AWS Autostopping proxy
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as harness from "@pulumi/harness";
*
* const test = new harness.autostopping.AwsProxy("test", {
* name: "name",
* cloudConnectorId: "cloud_connector_id",
* hostName: "host_name",
* region: "region",
* vpc: "vpc",
* securityGroups: [
* "sg1",
* "sg2",
* ],
* route53HostedZoneId: "/hostedzone/zone_id",
* machineType: "t2.medium",
* apiKey: "",
* allocateStaticIp: true,
* deleteCloudResourcesOnDestroy: true,
* });
* ```
*/
class AwsProxy extends pulumi.CustomResource {
/**
* Get an existing AwsProxy 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 AwsProxy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of AwsProxy. 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'] === AwsProxy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allocateStaticIp"] = state?.allocateStaticIp;
resourceInputs["apiKey"] = state?.apiKey;
resourceInputs["certificates"] = state?.certificates;
resourceInputs["cloudConnectorId"] = state?.cloudConnectorId;
resourceInputs["deleteCloudResourcesOnDestroy"] = state?.deleteCloudResourcesOnDestroy;
resourceInputs["hostName"] = state?.hostName;
resourceInputs["identifier"] = state?.identifier;
resourceInputs["keypair"] = state?.keypair;
resourceInputs["machineType"] = state?.machineType;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["route53HostedZoneId"] = state?.route53HostedZoneId;
resourceInputs["securityGroups"] = state?.securityGroups;
resourceInputs["vpc"] = state?.vpc;
}
else {
const args = argsOrState;
if (args?.apiKey === undefined && !opts.urn) {
throw new Error("Missing required property 'apiKey'");
}
if (args?.cloudConnectorId === undefined && !opts.urn) {
throw new Error("Missing required property 'cloudConnectorId'");
}
if (args?.deleteCloudResourcesOnDestroy === undefined && !opts.urn) {
throw new Error("Missing required property 'deleteCloudResourcesOnDestroy'");
}
if (args?.hostName === undefined && !opts.urn) {
throw new Error("Missing required property 'hostName'");
}
if (args?.machineType === undefined && !opts.urn) {
throw new Error("Missing required property 'machineType'");
}
if (args?.region === undefined && !opts.urn) {
throw new Error("Missing required property 'region'");
}
if (args?.vpc === undefined && !opts.urn) {
throw new Error("Missing required property 'vpc'");
}
resourceInputs["allocateStaticIp"] = args?.allocateStaticIp;
resourceInputs["apiKey"] = args?.apiKey ? pulumi.secret(args.apiKey) : undefined;
resourceInputs["certificates"] = args?.certificates;
resourceInputs["cloudConnectorId"] = args?.cloudConnectorId;
resourceInputs["deleteCloudResourcesOnDestroy"] = args?.deleteCloudResourcesOnDestroy;
resourceInputs["hostName"] = args?.hostName;
resourceInputs["keypair"] = args?.keypair;
resourceInputs["machineType"] = args?.machineType;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["route53HostedZoneId"] = args?.route53HostedZoneId;
resourceInputs["securityGroups"] = args?.securityGroups;
resourceInputs["vpc"] = args?.vpc;
resourceInputs["identifier"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["apiKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(AwsProxy.__pulumiType, name, resourceInputs, opts);
}
}
exports.AwsProxy = AwsProxy;
/** @internal */
AwsProxy.__pulumiType = 'harness:autostopping/awsProxy:AwsProxy';
//# sourceMappingURL=awsProxy.js.map