UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

94 lines 4.14 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.AlbVirtualHost = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Creates a virtual host that belongs to specified HTTP router and adds the specified routes to it. For more information, * see [the official documentation](https://cloud.yandex.com/en/docs/application-load-balancer/concepts/http-router). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const my_virtual_host = new yandex.AlbVirtualHost("my-virtual-host", { * httpRouterId: yandex_alb_http_router["my-router"].id, * routes: [{ * name: "my-route", * httpRoute: { * httpRouteAction: { * backendGroupId: yandex_alb_backend_group["my-bg"].id, * timeout: "3s", * }, * }, * }], * }); * ``` * * ## Import * * A virtual host can be imported using the `id` of the resource, e.g. * * ```sh * $ pulumi import yandex:index/albVirtualHost:AlbVirtualHost default virtual_host_id * ``` */ class AlbVirtualHost extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authorities"] = state ? state.authorities : undefined; resourceInputs["httpRouterId"] = state ? state.httpRouterId : undefined; resourceInputs["modifyRequestHeaders"] = state ? state.modifyRequestHeaders : undefined; resourceInputs["modifyResponseHeaders"] = state ? state.modifyResponseHeaders : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["routes"] = state ? state.routes : undefined; } else { const args = argsOrState; if ((!args || args.httpRouterId === undefined) && !opts.urn) { throw new Error("Missing required property 'httpRouterId'"); } resourceInputs["authorities"] = args ? args.authorities : undefined; resourceInputs["httpRouterId"] = args ? args.httpRouterId : undefined; resourceInputs["modifyRequestHeaders"] = args ? args.modifyRequestHeaders : undefined; resourceInputs["modifyResponseHeaders"] = args ? args.modifyResponseHeaders : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["routes"] = args ? args.routes : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AlbVirtualHost.__pulumiType, name, resourceInputs, opts); } /** * Get an existing AlbVirtualHost 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 AlbVirtualHost(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of AlbVirtualHost. 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'] === AlbVirtualHost.__pulumiType; } } exports.AlbVirtualHost = AlbVirtualHost; /** @internal */ AlbVirtualHost.__pulumiType = 'yandex:index/albVirtualHost:AlbVirtualHost'; //# sourceMappingURL=albVirtualHost.js.map