@pulumi/ns1
Version: 
A Pulumi package for creating and managing ns1 cloud resources.
127 lines • 4.81 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.Redirect = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
 * Provides a NS1 Redirect resource. This can be used to create, modify, and delete redirects.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as ns1 from "@pulumi/ns1";
 *
 * const example = new ns1.Redirect("example", {
 *     domain: "www.example.com",
 *     path: "/from/path",
 *     target: "https://url.com/target/path",
 * });
 * ```
 *
 * ### Additional Examples
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as ns1 from "@pulumi/ns1";
 *
 * const example = new ns1.RedirectCertificate("example", {domain: "www.example.com"});
 * ```
 *
 * ## NS1 Documentation
 *
 * [Redirect Api Doc](https://ns1.com/api#redirect)
 *
 * # ns1\_redirect\_certificate
 *
 * Provides a NS1 Redirect Certificate resource. This can be used to create, modify, and delete redirect certificates.
 *
 * ## NS1 Documentation
 *
 * [Redirect Api Doc](https://ns1.com/api#redirect)
 *
 * ## Import
 *
 * The resource can be imported via their `id`:
 *
 * ```sh
 * $ pulumi import ns1:index/redirect:Redirect <name> <id>`
 * ```
 *
 * ```sh
 * $ pulumi import ns1:index/redirect:Redirect <name> <id>`
 * ```
 */
class Redirect extends pulumi.CustomResource {
    /**
     * Get an existing Redirect 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 Redirect(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Redirect.  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'] === Redirect.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["certificateId"] = state?.certificateId;
            resourceInputs["domain"] = state?.domain;
            resourceInputs["forwardingMode"] = state?.forwardingMode;
            resourceInputs["forwardingType"] = state?.forwardingType;
            resourceInputs["httpsEnabled"] = state?.httpsEnabled;
            resourceInputs["httpsForced"] = state?.httpsForced;
            resourceInputs["lastUpdated"] = state?.lastUpdated;
            resourceInputs["path"] = state?.path;
            resourceInputs["queryForwarding"] = state?.queryForwarding;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["target"] = state?.target;
        }
        else {
            const args = argsOrState;
            if (args?.domain === undefined && !opts.urn) {
                throw new Error("Missing required property 'domain'");
            }
            if (args?.path === undefined && !opts.urn) {
                throw new Error("Missing required property 'path'");
            }
            if (args?.target === undefined && !opts.urn) {
                throw new Error("Missing required property 'target'");
            }
            resourceInputs["certificateId"] = args?.certificateId;
            resourceInputs["domain"] = args?.domain;
            resourceInputs["forwardingMode"] = args?.forwardingMode;
            resourceInputs["forwardingType"] = args?.forwardingType;
            resourceInputs["httpsForced"] = args?.httpsForced;
            resourceInputs["path"] = args?.path;
            resourceInputs["queryForwarding"] = args?.queryForwarding;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["target"] = args?.target;
            resourceInputs["httpsEnabled"] = undefined /*out*/;
            resourceInputs["lastUpdated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Redirect.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Redirect = Redirect;
/** @internal */
Redirect.__pulumiType = 'ns1:index/redirect:Redirect';
//# sourceMappingURL=redirect.js.map