UNPKG

@pulumiverse/fortios

Version:

A Pulumi package for creating and managing Fortios resources. Based on terraform-provider-fortios: version v1.16.0

130 lines 5.69 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ObjectService = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to configure firewall service of FortiOS. * * !> **Warning:** The resource will be deprecated and replaced by new resource `fortios.firewall/service.Custom`, we recommend that you use the new resource. * * ## Example Usage * * ### Fqdn Service * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fortios from "@pulumiverse/fortios"; * * const v11 = new fortios.firewall.ObjectService("v11", { * category: "General", * comment: "comment", * fqdn: "abc.com", * protocol: "TCP/UDP/SCTP", * }); * ``` * * ### Iprange Service * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fortios from "@pulumiverse/fortios"; * * const v13 = new fortios.firewall.ObjectService("v13", { * category: "General", * comment: "comment", * iprange: "1.1.1.1-2.2.2.2", * protocol: "TCP/UDP/SCTP", * sctpPortrange: "66-88", * tcpPortrange: "22-33", * udpPortrange: "44-55", * }); * ``` * * ### ICMP Service * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fortios from "@pulumiverse/fortios"; * * const iCMP = new fortios.firewall.ObjectService("iCMP", { * category: "General", * comment: "comment", * icmpcode: "3", * icmptype: "2", * protocol: "ICMP", * protocolNumber: "1", * }); * ``` */ class ObjectService extends pulumi.CustomResource { /** * Get an existing ObjectService 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 ObjectService(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ObjectService. 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'] === ObjectService.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["category"] = state ? state.category : undefined; resourceInputs["comment"] = state ? state.comment : undefined; resourceInputs["fqdn"] = state ? state.fqdn : undefined; resourceInputs["icmpcode"] = state ? state.icmpcode : undefined; resourceInputs["icmptype"] = state ? state.icmptype : undefined; resourceInputs["iprange"] = state ? state.iprange : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["protocolNumber"] = state ? state.protocolNumber : undefined; resourceInputs["sctpPortrange"] = state ? state.sctpPortrange : undefined; resourceInputs["sessionTtl"] = state ? state.sessionTtl : undefined; resourceInputs["tcpPortrange"] = state ? state.tcpPortrange : undefined; resourceInputs["udpPortrange"] = state ? state.udpPortrange : undefined; } else { const args = argsOrState; if ((!args || args.category === undefined) && !opts.urn) { throw new Error("Missing required property 'category'"); } if ((!args || args.protocol === undefined) && !opts.urn) { throw new Error("Missing required property 'protocol'"); } resourceInputs["category"] = args ? args.category : undefined; resourceInputs["comment"] = args ? args.comment : undefined; resourceInputs["fqdn"] = args ? args.fqdn : undefined; resourceInputs["icmpcode"] = args ? args.icmpcode : undefined; resourceInputs["icmptype"] = args ? args.icmptype : undefined; resourceInputs["iprange"] = args ? args.iprange : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["protocol"] = args ? args.protocol : undefined; resourceInputs["protocolNumber"] = args ? args.protocolNumber : undefined; resourceInputs["sctpPortrange"] = args ? args.sctpPortrange : undefined; resourceInputs["sessionTtl"] = args ? args.sessionTtl : undefined; resourceInputs["tcpPortrange"] = args ? args.tcpPortrange : undefined; resourceInputs["udpPortrange"] = args ? args.udpPortrange : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ObjectService.__pulumiType, name, resourceInputs, opts); } } exports.ObjectService = ObjectService; /** @internal */ ObjectService.__pulumiType = 'fortios:firewall/objectService:ObjectService'; //# sourceMappingURL=objectService.js.map