UNPKG

@pulumi/f5bigip

Version:

A Pulumi package for creating and managing F5 BigIP resources.

154 lines 5.95 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! *** 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.Ifile = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * `f5bigip.ltm.Ifile` This resource creates an LTM iFile on F5 BIG-IP that references an existing system iFile. * LTM iFiles are used in iRules and LTM policies to access file content for traffic processing and decision making. * * ## Example Usage * * ### Using LTM iFile in iRule * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as f5bigip from "@pulumi/f5bigip"; * * const serverList = new f5bigip.sys.Ifile("server_list", { * name: "server-mapping", * partition: "Production", * content: `web1:10.1.1.10 * web2:10.1.1.11 * web3:10.1.1.12 * `, * }); * const ltmServers = new f5bigip.ltm.Ifile("ltm_servers", { * name: "ltm-server-mapping", * partition: "Production", * fileName: "/Production/server-mapping", * }); * const serverSelector = new f5bigip.ltm.IRule("server_selector", { * name: "select-server-rule", * irule: `when HTTP_REQUEST { * set server_map [ifile get ltm-server-mapping] * # Process server mapping logic * foreach line [split server_map \\"\\ * \\"] { * set parts [split line \\":\\"] * # Implement server selection logic * } * } * `, * }); * ``` * * ## Notes * * * The referenced system iFile (specified in `fileName`) must exist before creating the LTM iFile. * * LTM iFiles are primarily used in iRules and LTM policies for traffic processing. * * Changes to `name`, `partition`, or `subPath` will force recreation of the resource. * * The LTM iFile acts as a reference to the system iFile and doesn't store content directly. * * Use `f5bigip.sys.Ifile` to upload file content, then reference it with `f5bigip.ltm.Ifile` for LTM usage. * * ## Related Resources * * * `f5bigip.sys.Ifile` - Creates system iFiles with content * * `f5bigip.ltm.IRule` - Creates iRules that can reference LTM iFiles * * `f5bigip.ltm.Policy` - Creates LTM policies that can use LTM iFiles * * ## Import * * LTM iFiles can be imported using their full path: * * ```sh * $ pulumi import f5bigip:ltm/ifile:Ifile example /Common/my-ltm-ifile * ``` * * For iFiles with sub-paths: * * ```sh * $ pulumi import f5bigip:ltm/ifile:Ifile example /Common/templates/my-ltm-ifile * ``` */ class Ifile extends pulumi.CustomResource { /** * Get an existing Ifile 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 Ifile(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'f5bigip:ltm/ifile:Ifile'; /** * Returns true if the given object is an instance of Ifile. 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'] === Ifile.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["fileName"] = state?.fileName; resourceInputs["fullPath"] = state?.fullPath; resourceInputs["name"] = state?.name; resourceInputs["partition"] = state?.partition; resourceInputs["subPath"] = state?.subPath; } else { const args = argsOrState; if (args?.fileName === undefined && !opts.urn) { throw new Error("Missing required property 'fileName'"); } if (args?.name === undefined && !opts.urn) { throw new Error("Missing required property 'name'"); } resourceInputs["fileName"] = args?.fileName; resourceInputs["name"] = args?.name; resourceInputs["partition"] = args?.partition; resourceInputs["subPath"] = args?.subPath; resourceInputs["fullPath"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Ifile.__pulumiType, name, resourceInputs, opts); } } exports.Ifile = Ifile; //# sourceMappingURL=ifile.js.map