@pulumiverse/fortios
Version:
A Pulumi package for creating and managing Fortios resources. Based on terraform-provider-fortios: version v1.16.0
108 lines • 4.76 kB
JavaScript
// *** 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.RouteStatic = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to configure static route of FortiOS.
*
* !> **Warning:** The resource will be deprecated and replaced by new resource `fortios.router.Static`, we recommend that you use the new resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fortios from "@pulumiverse/fortios";
*
* const subnet = new fortios.networking.RouteStatic("subnet", {
* blackhole: "disable",
* comment: "Terraform test",
* device: "port2",
* distance: "22",
* dst: "110.2.2.122/32",
* gateway: "2.2.2.2",
* priority: "3",
* status: "enable",
* weight: "3",
* });
* const internetService = new fortios.networking.RouteStatic("internetService", {
* blackhole: "disable",
* comment: "Terraform Test",
* device: "port2",
* distance: "22",
* gateway: "2.2.2.2",
* internetService: 5242881,
* priority: "3",
* status: "enable",
* weight: "3",
* });
* ```
*/
class RouteStatic extends pulumi.CustomResource {
/**
* Get an existing RouteStatic 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 RouteStatic(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RouteStatic. 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'] === RouteStatic.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["blackhole"] = state ? state.blackhole : undefined;
resourceInputs["comment"] = state ? state.comment : undefined;
resourceInputs["device"] = state ? state.device : undefined;
resourceInputs["distance"] = state ? state.distance : undefined;
resourceInputs["dst"] = state ? state.dst : undefined;
resourceInputs["gateway"] = state ? state.gateway : undefined;
resourceInputs["internetService"] = state ? state.internetService : undefined;
resourceInputs["priority"] = state ? state.priority : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["weight"] = state ? state.weight : undefined;
}
else {
const args = argsOrState;
if ((!args || args.device === undefined) && !opts.urn) {
throw new Error("Missing required property 'device'");
}
if ((!args || args.gateway === undefined) && !opts.urn) {
throw new Error("Missing required property 'gateway'");
}
resourceInputs["blackhole"] = args ? args.blackhole : undefined;
resourceInputs["comment"] = args ? args.comment : undefined;
resourceInputs["device"] = args ? args.device : undefined;
resourceInputs["distance"] = args ? args.distance : undefined;
resourceInputs["dst"] = args ? args.dst : undefined;
resourceInputs["gateway"] = args ? args.gateway : undefined;
resourceInputs["internetService"] = args ? args.internetService : undefined;
resourceInputs["priority"] = args ? args.priority : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["weight"] = args ? args.weight : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RouteStatic.__pulumiType, name, resourceInputs, opts);
}
}
exports.RouteStatic = RouteStatic;
/** @internal */
RouteStatic.__pulumiType = 'fortios:networking/routeStatic:RouteStatic';
//# sourceMappingURL=routeStatic.js.map
;