UNPKG

@pulumi/kong

Version:

A Pulumi package for creating and managing Kong resources.

86 lines 3.41 kB
"use strict"; // *** 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.Target = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as kong from "@pulumi/kong"; * * const target = new kong.Target("target", { * target: "sample_target:80", * weight: 10, * upstreamId: upstream.id, * }); * ``` * * ## Import * * To import a target use a combination of the upstream id and the target id as follows: * * ```sh * $ pulumi import kong:index/target:Target <target_identifier> <upstream_id>/<target_id> * ``` */ class Target extends pulumi.CustomResource { /** * Get an existing Target 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 Target(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Target. 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'] === Target.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["target"] = state ? state.target : undefined; resourceInputs["upstreamId"] = state ? state.upstreamId : undefined; resourceInputs["weight"] = state ? state.weight : undefined; } else { const args = argsOrState; if ((!args || args.target === undefined) && !opts.urn) { throw new Error("Missing required property 'target'"); } if ((!args || args.upstreamId === undefined) && !opts.urn) { throw new Error("Missing required property 'upstreamId'"); } if ((!args || args.weight === undefined) && !opts.urn) { throw new Error("Missing required property 'weight'"); } resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["target"] = args ? args.target : undefined; resourceInputs["upstreamId"] = args ? args.upstreamId : undefined; resourceInputs["weight"] = args ? args.weight : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Target.__pulumiType, name, resourceInputs, opts); } } exports.Target = Target; /** @internal */ Target.__pulumiType = 'kong:index/target:Target'; //# sourceMappingURL=target.js.map