UNPKG

@pulumi/f5bigip

Version:

A Pulumi package for creating and managing F5 BigIP resources.

371 lines 11.8 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.As3 = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * `f5bigip.As3` provides details about bigip as3 resource * * This resource is helpful to configure AS3 declarative JSON on BIG-IP. * * > This Resource also supports **Per-Application** mode of AS3 deployment, more information on **Per-Application** mode can be found [Per-App](https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/per-app-declarations.html) * * > For Supporting AS3 Per-App mode of deployment, AS3 version on BIG-IP should be > **v3.50** * * > For Deploying AS3 JSON in Per-App mode, this resource provided with a attribute tenantName to be passed to add application on specified tenant, else random tenant name will be generated. * * As3 Declaration can be deployed in Traditional way as well as Per-Application Way : * * - Traditional Way - Entire Declaration needs to be passed in during the create and update call along with the tenant details in the declaration. * - Per-Application Way - Only application details needs to be passed in the as3_json. Tenant name needs to be passed else random tenant name will be generated. * * **Note:** : PerApplication needs to be turned `true` as a Prerequisite on the Big-IP (BIG-IP AS3 version >3.50) device. For details : <https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/per-app-declarations.html> * * ### Delete Specific Applications from a Tenant * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as f5bigip from "@pulumi/f5bigip"; * * const as3AppDeletion = new f5bigip.As3("as3_app_deletion", {deleteApps: { * tenantName: "Tenant-2", * apps: [ * "terraform_vs_http", * "legacy_app", * ], * }}); * ``` * * ## Example of controls parameters * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as f5bigip from "@pulumi/f5bigip"; * import * as std from "@pulumi/std"; * * const as3_example1 = new f5bigip.As3("as3-example1", { * as3Json: std.file({ * input: "example1.json", * }).then(invoke => invoke.result), * controls: { * dry_run: "no", * trace: "yes", * trace_response: "yes", * log_level: "debug", * user_agent: "dummy agent", * }, * }); * ``` * * # Per-Application Deployment - Example Usage for json file with tenant name * resource "f5bigip.As3" "as3-example1" { * as3Json = file("perApplication_example.json") * tenantName = "Test" * } * * # Per-Application Deployment - Example Usage for json file without tenant name - Tenant with Random name is generated in this case * resource "f5bigip.As3" "as3-example1" { * as3Json = file("perApplication_example.json") * } * * ## Behavior * * When `deleteApps` is used, Terraform logs “Creating...”, but the underlying logic performs application deletion via REST API calls. * * Each app in the `apps` list is deleted using: * * A synthetic resource ID is assigned to keep Terraform state consistent after successful deletion. * * *** * * ## Outputs * * - `taskId` – AS3 task ID used in BIG-IP. * - `applicationList` – List of deleted applications (if applicable). * - `tenantList` – List of affected tenants. * * *** * * ## Import * * As3 resources can be imported using the partition name, e.g., ( use comma separated partition names if there are multiple partitions in as3 deployments ) * * ```sh * $ pulumi import f5bigip:index/as3:As3 test Sample_http_01 * $ pulumi import f5bigip:index/as3:As3 test Sample_http_01,Sample_non_http_01 * ``` * * #### Import examples ( single and multiple partitions ) * * ```sh * * $ pulumi import f5bigip:index/as3:As3 test Sample_http_01 * bigip_as3.test: Importing from ID "Sample_http_01"... * bigip_as3.test: Import prepared! * Prepared bigip_as3 for import * bigip_as3.test: Refreshing state... [id=Sample_http_01] * * Import successful! * * The resources that were imported are shown above. These resources are now in * your Terraform state and will henceforth be managed by Terraform. * * $ terraform show * ``` * * bigip_as3.test: * resource "f5bigip.As3" "test" { * as3Json = jsonencode( * { * action = "deploy" * class = "AS3" * declaration = { * Sample_http_01 = { * A1 = { * class = "Application" * jsessionid = { * class = "Persist" * cookieMethod = "hash" * cookieName = "JSESSIONID" * persistenceMethod = "cookie" * } * service = { * class = "Service_HTTP" * persistenceMethods = [ * { * use = "jsessionid" * }, * ] * pool = "webPool" * virtualAddresses = [ * "10.0.2.10", * ] * } * webPool = { * class = "Pool" * members = [ * { * serverAddresses = [ * "192.0.2.10", * "192.0.2.11", * ] * servicePort = 80 * }, * ] * monitors = [ * "http", * ] * } * } * class = "Tenant" * } * class = "ADC" * id = "UDP_DNS_Sample" * label = "UDP_DNS_Sample" * remark = "Sample of a UDP DNS Load Balancer Service" * schemaVersion = "3.0.0" * } * persist = true * } * ) * id = "Sample_http_01" * tenantFilter = "Sample_http_01" * tenantList = "Sample_http_01" * } * * ```sh * $ pulumi import f5bigip:index/as3:As3 test Sample_http_01,Sample_non_http_01 * bigip_as3.test: Importing from ID "Sample_http_01,Sample_non_http_01"... * bigip_as3.test: Import prepared! * Prepared bigip_as3 for import * bigip_as3.test: Refreshing state... [id=Sample_http_01,Sample_non_http_01] * * Import successful! * * The resources that were imported are shown above. These resources are now in * your Terraform state and will henceforth be managed by Terraform. * * $ terraform show * ``` * * bigip_as3.test: * resource "f5bigip.As3" "test" { * as3Json = jsonencode( * { * action = "deploy" * class = "AS3" * declaration = { * Sample_http_01 = { * A1 = { * class = "Application" * jsessionid = { * class = "Persist" * cookieMethod = "hash" * cookieName = "JSESSIONID" * persistenceMethod = "cookie" * } * service = { * class = "Service_HTTP" * persistenceMethods = [ * { * use = "jsessionid" * }, * ] * pool = "webPool" * virtualAddresses = [ * "10.0.2.10", * ] * } * webPool = { * class = "Pool" * members = [ * { * serverAddresses = [ * "192.0.2.10", * "192.0.2.11", * ] * servicePort = 80 * }, * ] * monitors = [ * "http", * ] * } * } * class = "Tenant" * } * Sample_non_http_01 = { * DNS_Service = { * Pool1 = { * class = "Pool" * members = [ * { * serverAddresses = [ * "10.1.10.100", * ] * servicePort = 53 * }, * { * serverAddresses = [ * "10.1.10.101", * ] * servicePort = 53 * }, * ] * monitors = [ * "icmp", * ] * } * class = "Application" * service = { * class = "Service_UDP" * pool = "Pool1" * virtualAddresses = [ * "10.1.20.121", * ] * virtualPort = 53 * } * } * class = "Tenant" * } * class = "ADC" * id = "UDP_DNS_Sample" * label = "UDP_DNS_Sample" * remark = "Sample of a UDP DNS Load Balancer Service" * schemaVersion = "3.0.0" * } * persist = true * } * ) * id = "Sample_http_01,Sample_non_http_01" * tenantFilter = "Sample_http_01,Sample_non_http_01" * tenantList = "Sample_http_01,Sample_non_http_01" * } * * * `AS3 documentation` - https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/composing-a-declaration.html */ class As3 extends pulumi.CustomResource { /** * Get an existing As3 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 As3(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'f5bigip:index/as3:As3'; /** * Returns true if the given object is an instance of As3. 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'] === As3.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationList"] = state?.applicationList; resourceInputs["as3Json"] = state?.as3Json; resourceInputs["controls"] = state?.controls; resourceInputs["deleteApps"] = state?.deleteApps; resourceInputs["ignoreMetadata"] = state?.ignoreMetadata; resourceInputs["perAppMode"] = state?.perAppMode; resourceInputs["taskId"] = state?.taskId; resourceInputs["tenantFilter"] = state?.tenantFilter; resourceInputs["tenantList"] = state?.tenantList; resourceInputs["tenantName"] = state?.tenantName; } else { const args = argsOrState; resourceInputs["applicationList"] = args?.applicationList; resourceInputs["as3Json"] = args?.as3Json; resourceInputs["controls"] = args?.controls; resourceInputs["deleteApps"] = args?.deleteApps; resourceInputs["ignoreMetadata"] = args?.ignoreMetadata; resourceInputs["taskId"] = args?.taskId; resourceInputs["tenantFilter"] = args?.tenantFilter; resourceInputs["tenantList"] = args?.tenantList; resourceInputs["tenantName"] = args?.tenantName; resourceInputs["perAppMode"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(As3.__pulumiType, name, resourceInputs, opts); } } exports.As3 = As3; //# sourceMappingURL=as3.js.map