@pulumi/f5bigip
Version:
A Pulumi package for creating and managing F5 BigIP resources.
214 lines • 8.55 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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PoolAttachment = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* `f5bigip.ltm.PoolAttachment` Manages nodes membership in pools
*
* ## Example Usage
*
* There are two ways to use `f5bigip.ltm.PoolAttachment` resource for `node` attribute
*
* * It can be reference from `f5bigip.ltm.Node` (or)
* * It can be specify directly with `ipv4:port`/`fqdn:port`/`ipv6.port` which will also create node and attach member to pool.
*
* > For adding IPv6 node/member to pool it should be specific in `node` attribute in format like `ipv6_address.port`.
* IPv4 should be specified as `ipv4_address:port`
*
* ### Usage Pool attachment with node/member directly attaching to pool.
*
* node can be specified in format `ipv4:port` / `fqdn:port` / `ipv6.port`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as f5bigip from "@pulumi/f5bigip";
*
* const monitor = new f5bigip.ltm.Monitor("monitor", {
* name: "/Common/terraform_monitor",
* parent: "/Common/http",
* send: "GET /some/path\x0d\n",
* timeout: 999,
* interval: 998,
* });
* const pool = new f5bigip.ltm.Pool("pool", {
* name: "/Common/terraform-pool",
* loadBalancingMode: "round-robin",
* monitors: [monitor.name],
* allowSnat: "yes",
* allowNat: "yes",
* });
* // attaching ipv4 address with service port
* const ipv4NodeAttach = new f5bigip.ltm.PoolAttachment("ipv4_node_attach", {
* pool: pool.name,
* node: "1.1.1.1:80",
* });
* // attaching ipv6 address with service port
* const ipv6NodeAttach = new f5bigip.ltm.PoolAttachment("ipv6_node_attach", {
* pool: pool.name,
* node: "2003::4.80",
* });
* ```
*
* ### Usage Pool attachment with node referenced from `f5bigip.ltm.Node`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as f5bigip from "@pulumi/f5bigip";
*
* const monitor = new f5bigip.ltm.Monitor("monitor", {
* name: "/Common/terraform_monitor",
* parent: "/Common/http",
* send: "GET /some/path\x0d\n",
* timeout: 999,
* interval: 998,
* });
* const pool = new f5bigip.ltm.Pool("pool", {
* name: "/Common/terraform-pool",
* loadBalancingMode: "round-robin",
* monitors: [monitor.name],
* allowSnat: "yes",
* allowNat: "yes",
* });
* const node = new f5bigip.ltm.Node("node", {
* name: "/Common/terraform_node",
* address: "192.168.30.2",
* });
* const attachNode = new f5bigip.ltm.PoolAttachment("attach_node", {
* pool: pool.name,
* node: pulumi.interpolate`${node.name}:80`,
* });
* ```
*
* ### Pool attachment resource with attaching multiple nodes in same pool using `forEach`
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as f5bigip from "@pulumi/f5bigip";
* import * as std from "@pulumi/std";
*
* export = async () => {
* const node1 = new f5bigip.ltm.Node("node1", {
* name: "/Common/terraform_node1",
* address: "192.168.30.1",
* });
* const node2 = new f5bigip.ltm.Node("node2", {
* name: "/Common/terraform_node2",
* address: "192.168.30.2",
* });
* const k8sProd = new f5bigip.ltm.Pool("k8s_prod", {name: "/Common/k8prod_Pool"});
* const k8sprod: f5bigip.ltm.PoolAttachment[] = [];
* for (const range of std.toset({
* input: [
* node1.name,
* node2.name,
* ],
* }).result.map((v, k) => ({key: k, value: v}))) {
* k8sprod.push(new f5bigip.ltm.PoolAttachment(`k8sprod-${range.key}`, {
* pool: k8sProd.name,
* node: `${range.key}:80`,
* }));
* }
* }
* ```
*
* ## Importing
*
* An existing pool attachment (i.e. pool membership) can be imported into this resource by supplying both the pool full path, and the node full path with the relevant port. If the pool or node membership is not found, an error will be returned. An example is below:
*
* ```sh
* $ terraform import bigip_ltm_pool_attachment.node-pool-attach \
* '{"pool": "/Common/terraform-pool", "node": "/Common/node1:80"}'
* ```
*/
class PoolAttachment extends pulumi.CustomResource {
/**
* Get an existing PoolAttachment 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 PoolAttachment(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'f5bigip:ltm/poolAttachment:PoolAttachment';
/**
* Returns true if the given object is an instance of PoolAttachment. 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'] === PoolAttachment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["connectionLimit"] = state?.connectionLimit;
resourceInputs["connectionRateLimit"] = state?.connectionRateLimit;
resourceInputs["dynamicRatio"] = state?.dynamicRatio;
resourceInputs["fqdnAutopopulate"] = state?.fqdnAutopopulate;
resourceInputs["monitor"] = state?.monitor;
resourceInputs["node"] = state?.node;
resourceInputs["pool"] = state?.pool;
resourceInputs["priorityGroup"] = state?.priorityGroup;
resourceInputs["ratio"] = state?.ratio;
resourceInputs["state"] = state?.state;
}
else {
const args = argsOrState;
if (args?.node === undefined && !opts.urn) {
throw new Error("Missing required property 'node'");
}
if (args?.pool === undefined && !opts.urn) {
throw new Error("Missing required property 'pool'");
}
resourceInputs["connectionLimit"] = args?.connectionLimit;
resourceInputs["connectionRateLimit"] = args?.connectionRateLimit;
resourceInputs["dynamicRatio"] = args?.dynamicRatio;
resourceInputs["fqdnAutopopulate"] = args?.fqdnAutopopulate;
resourceInputs["monitor"] = args?.monitor;
resourceInputs["node"] = args?.node;
resourceInputs["pool"] = args?.pool;
resourceInputs["priorityGroup"] = args?.priorityGroup;
resourceInputs["ratio"] = args?.ratio;
resourceInputs["state"] = args?.state;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PoolAttachment.__pulumiType, name, resourceInputs, opts);
}
}
exports.PoolAttachment = PoolAttachment;
//# sourceMappingURL=poolAttachment.js.map