UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

137 lines 6.74 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.SiteConnection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a V2 Neutron IPSec site connection resource within OpenStack. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const conn1 = new openstack.vpnaas.SiteConnection("conn_1", { * name: "connection_1", * ikepolicyId: policy2.id, * ipsecpolicyId: policy1.id, * vpnserviceId: service1.id, * psk: "secret", * peerAddress: "192.168.10.1", * localEpGroupId: group2.id, * peerEpGroupId: group1.id, * dpds: [{ * action: "restart", * timeout: 42, * interval: 21, * }], * }); * ``` * * ## Import * * Site Connections can be imported using the `id`, e.g. * * ```sh * $ pulumi import openstack:vpnaas/siteConnection:SiteConnection conn_1 832cb7f3-59fe-40cf-8f64-8350ffc03272 * ``` */ class SiteConnection extends pulumi.CustomResource { /** * Get an existing SiteConnection 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 SiteConnection(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SiteConnection. 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'] === SiteConnection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["dpds"] = state ? state.dpds : undefined; resourceInputs["ikepolicyId"] = state ? state.ikepolicyId : undefined; resourceInputs["initiator"] = state ? state.initiator : undefined; resourceInputs["ipsecpolicyId"] = state ? state.ipsecpolicyId : undefined; resourceInputs["localEpGroupId"] = state ? state.localEpGroupId : undefined; resourceInputs["localId"] = state ? state.localId : undefined; resourceInputs["mtu"] = state ? state.mtu : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["peerAddress"] = state ? state.peerAddress : undefined; resourceInputs["peerCidrs"] = state ? state.peerCidrs : undefined; resourceInputs["peerEpGroupId"] = state ? state.peerEpGroupId : undefined; resourceInputs["peerId"] = state ? state.peerId : undefined; resourceInputs["psk"] = state ? state.psk : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tenantId"] = state ? state.tenantId : undefined; resourceInputs["valueSpecs"] = state ? state.valueSpecs : undefined; resourceInputs["vpnserviceId"] = state ? state.vpnserviceId : undefined; } else { const args = argsOrState; if ((!args || args.ikepolicyId === undefined) && !opts.urn) { throw new Error("Missing required property 'ikepolicyId'"); } if ((!args || args.ipsecpolicyId === undefined) && !opts.urn) { throw new Error("Missing required property 'ipsecpolicyId'"); } if ((!args || args.peerAddress === undefined) && !opts.urn) { throw new Error("Missing required property 'peerAddress'"); } if ((!args || args.peerId === undefined) && !opts.urn) { throw new Error("Missing required property 'peerId'"); } if ((!args || args.psk === undefined) && !opts.urn) { throw new Error("Missing required property 'psk'"); } if ((!args || args.vpnserviceId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpnserviceId'"); } resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["dpds"] = args ? args.dpds : undefined; resourceInputs["ikepolicyId"] = args ? args.ikepolicyId : undefined; resourceInputs["initiator"] = args ? args.initiator : undefined; resourceInputs["ipsecpolicyId"] = args ? args.ipsecpolicyId : undefined; resourceInputs["localEpGroupId"] = args ? args.localEpGroupId : undefined; resourceInputs["localId"] = args ? args.localId : undefined; resourceInputs["mtu"] = args ? args.mtu : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["peerAddress"] = args ? args.peerAddress : undefined; resourceInputs["peerCidrs"] = args ? args.peerCidrs : undefined; resourceInputs["peerEpGroupId"] = args ? args.peerEpGroupId : undefined; resourceInputs["peerId"] = args ? args.peerId : undefined; resourceInputs["psk"] = args ? args.psk : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tenantId"] = args ? args.tenantId : undefined; resourceInputs["valueSpecs"] = args ? args.valueSpecs : undefined; resourceInputs["vpnserviceId"] = args ? args.vpnserviceId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SiteConnection.__pulumiType, name, resourceInputs, opts); } } exports.SiteConnection = SiteConnection; /** @internal */ SiteConnection.__pulumiType = 'openstack:vpnaas/siteConnection:SiteConnection'; //# sourceMappingURL=siteConnection.js.map