UNPKG

@pulumi/f5bigip

Version:

A Pulumi package for creating and managing F5 BigIP resources.

236 lines • 8.58 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.sys.Ifile` This resource uploads and manages system iFiles on F5 BIG-IP devices. * System iFiles store file content on the BIG-IP that can be referenced by iRules, LTM policies, and other BIG-IP configurations for traffic processing and decision making. * * ## Example Usage * * ### System iFile with Sub-path * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as f5bigip from "@pulumi/f5bigip"; * * const templateFile = new f5bigip.sys.Ifile("template_file", { * name: "error-template", * partition: "Common", * subPath: "templates", * content: `<html> * <head><title>Service Unavailable</title></head> * <body> * <h1>503 - Service Temporarily Unavailable</h1> * <p>Please try again later.</p> * </body> * </html> * `, * }); * ``` * * ### JSON Configuration File * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as f5bigip from "@pulumi/f5bigip"; * * const serverList = JSON.stringify({ * servers: [ * { * name: "web1", * ip: "10.1.1.10", * port: 80, * }, * { * name: "web2", * ip: "10.1.1.11", * port: 80, * }, * { * name: "web3", * ip: "10.1.1.12", * port: 80, * }, * ], * }); * const serverConfig = new f5bigip.sys.Ifile("server_config", { * name: "server-list", * partition: "MyApp", * content: serverList, * }); * ``` * * ### Using System iFile with LTM iFile * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as f5bigip from "@pulumi/f5bigip"; * * // Create system iFile with content * const lookupTable = new f5bigip.sys.Ifile("lookup_table", { * name: "url-rewrite-map", * partition: "Common", * content: `/old-api/v1/ /api/v2/ * /legacy/ /new/ * /deprecated/ /current/ * `, * }); * // Create LTM iFile that references the system iFile * const ltmLookup = new f5bigip.ltm.Ifile("ltm_lookup", { * name: "ltm-url-rewrite-map", * partition: "Common", * fileName: "/Common/url-rewrite-map", * }); * // Use in an iRule * const urlRewriter = new f5bigip.ltm.IRule("url_rewriter", { * name: "url-rewrite-rule", * irule: `when HTTP_REQUEST { * set uri [HTTP::uri] * set mapping [ifile get ltm-url-rewrite-map] * foreach line [split mapping \\"\\ * \\"] { * set parts [split line \\" \\"] * if {[string match [lindex parts 0]* uri]} { * HTTP::uri [string map [list [lindex parts 0] [lindex parts 1]] uri] * break * } * } * } * `, * }); * ``` * * ## Notes * * * The `content` field is marked as sensitive and will not be displayed in Terraform logs or state output. * * Changes to `name` will force recreation of the resource since iFile names cannot be changed after creation. * * The `checksum` and `size` attributes are automatically computed by the BIG-IP system. * * iFile content is uploaded to the BIG-IP system and stored there permanently until the resource is destroyed. * * Use `file()` function to load content from local files or `templatefile()` for dynamic content generation. * * System iFiles can be referenced by `f5bigip.ltm.Ifile` resources for use in LTM configurations. * * ## Path Structure * * The full path of an iFile follows this pattern: * - Without sub-path: `/{partition}/{name}` * - With sub-path: `/{partition}/{sub_path}/{name}` * * Examples: * - `/Common/config-file` * - `/Production/templates/error-page` * - `/MyApp/configs/database-settings` * * ## Related Resources * * * `f5bigip.ltm.Ifile` - Creates LTM iFiles that reference system iFiles * * `f5bigip.ltm.IRule` - Creates iRules that can access iFile content * * `f5bigip.ltm.Policy` - Creates LTM policies that can use iFile content * * ## Security Considerations * * * iFile content is stored on the BIG-IP system and may contain sensitive information * * Use appropriate BIG-IP access controls to limit who can view or modify iFiles * * Consider using Terraform's sensitive variable handling for confidential content * * The `content` field is marked as sensitive in Terraform state to prevent accidental exposure * * ## Import * * System iFiles can be imported using their full path: * * ```sh * $ pulumi import f5bigip:sys/ifile:Ifile example /Common/my-ifile * ``` * * For iFiles with sub-paths: * * ```sh * $ pulumi import f5bigip:sys/ifile:Ifile example /Common/templates/my-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:sys/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["checksum"] = state?.checksum; resourceInputs["content"] = state?.content; resourceInputs["name"] = state?.name; resourceInputs["partition"] = state?.partition; resourceInputs["size"] = state?.size; resourceInputs["subPath"] = state?.subPath; } else { const args = argsOrState; if (args?.content === undefined && !opts.urn) { throw new Error("Missing required property 'content'"); } if (args?.name === undefined && !opts.urn) { throw new Error("Missing required property 'name'"); } resourceInputs["content"] = args?.content ? pulumi.secret(args.content) : undefined; resourceInputs["name"] = args?.name; resourceInputs["partition"] = args?.partition; resourceInputs["subPath"] = args?.subPath; resourceInputs["checksum"] = undefined /*out*/; resourceInputs["size"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["content"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Ifile.__pulumiType, name, resourceInputs, opts); } } exports.Ifile = Ifile; //# sourceMappingURL=ifile.js.map