UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

107 lines 4.4 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.FirewallDevice = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a Linode Firewall Device. * For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-firewall-device). * * **NOTICE:** Attaching a Linode Firewall Device to a `linode.Firewall` resource with user-defined `linodes` may cause device conflicts. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const myFirewall = new linode.Firewall("my_firewall", { * label: "my_firewall", * inbounds: [{ * label: "http", * action: "ACCEPT", * protocol: "TCP", * ports: "80", * ipv4s: ["0.0.0.0/0"], * ipv6s: ["::/0"], * }], * inboundPolicy: "DROP", * outboundPolicy: "ACCEPT", * }); * const myInstance = new linode.Instance("my_instance", { * label: "my_instance", * region: "us-southeast", * type: "g6-standard-1", * }); * const myDevice = new linode.FirewallDevice("my_device", { * firewallId: myFirewall.id, * entityId: myInstance.id, * }); * ``` * * ## Import * * Firewall Device can be imported using the `firewall_id` followed by the Firewall Device `id` separated by a comma, e.g. * * ```sh * $ pulumi import linode:index/firewallDevice:FirewallDevice my_device_duplicated 1234567,7654321 * ``` */ class FirewallDevice extends pulumi.CustomResource { /** * Get an existing FirewallDevice 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 FirewallDevice(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FirewallDevice. 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'] === FirewallDevice.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["created"] = state ? state.created : undefined; resourceInputs["entityId"] = state ? state.entityId : undefined; resourceInputs["entityType"] = state ? state.entityType : undefined; resourceInputs["firewallId"] = state ? state.firewallId : undefined; resourceInputs["updated"] = state ? state.updated : undefined; } else { const args = argsOrState; if ((!args || args.entityId === undefined) && !opts.urn) { throw new Error("Missing required property 'entityId'"); } if ((!args || args.firewallId === undefined) && !opts.urn) { throw new Error("Missing required property 'firewallId'"); } resourceInputs["entityId"] = args ? args.entityId : undefined; resourceInputs["entityType"] = args ? args.entityType : undefined; resourceInputs["firewallId"] = args ? args.firewallId : undefined; resourceInputs["created"] = undefined /*out*/; resourceInputs["updated"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FirewallDevice.__pulumiType, name, resourceInputs, opts); } } exports.FirewallDevice = FirewallDevice; /** @internal */ FirewallDevice.__pulumiType = 'linode:index/firewallDevice:FirewallDevice'; //# sourceMappingURL=firewallDevice.js.map