import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Provides a Civo firewall resource. This can be used to create, modify, and delete firewalls. * * ## Example Usage * * * View firewalls after creation on the [CLI](https://www.civo.com/docs/overview/civo-cli): * * View firewalls after creation on the [Dashboard](https://dashboard.civo.com/firewalls) * * View firewall rules on [CLI](https://www.civo.com/docs/overview/civo-cli): * * ### Custom ingress and egress rules firewall * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as civo from "@pulumi/civo"; * * const example = new civo.Network("example", {label: "example-network"}); * const exampleFirewall = new civo.Firewall("example", { * name: "example-firewall", * networkId: example.id, * createDefaultRules: false, * ingressRules: [ * { * label: "http", * protocol: "tcp", * portRange: "80", * cidrs: ["0.0.0.0"], * action: "allow", * }, * { * label: "https", * protocol: "tcp", * portRange: "443", * cidrs: ["0.0.0.0"], * action: "allow", * }, * { * label: "ssh", * protocol: "tcp", * portRange: "22", * cidrs: [ * "192.168.1.1/32", * "192.168.10.4/32", * "192.168.10.10/32", * ], * action: "allow", * }, * ], * egressRules: [{ * label: "all", * protocol: "tcp", * portRange: "1-65535", * cidrs: ["0.0.0.0/0"], * action: "allow", * }], * }); * const debian = civo.getDiskImage({ * filters: [{ * key: "name", * values: ["debian-10"], * }], * }); * // Create a new instance * const exampleInstance = new civo.Instance("example", { * hostname: "example", * notes: "This is an example instance", * firewallId: exampleFirewall.id, * networkId: example.id, * size: "g3.xsmall", * diskImage: debian.then(debian => debian.diskimages?.[0]?.id), * }); * ``` * * ### Simple firewall * * This the minimum amount of code to create a firewall with default rules: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as civo from "@pulumi/civo"; * * // ... * const example = new civo.Firewall("example", { * name: "example-firewall", * networkId: exampleCivoNetwork.id, * }); * ``` * * ## Import * * using ID * * ```sh * $ pulumi import civo:index/firewall:Firewall www b8ecd2ab-2267-4a5e-8692-cbf1d32583e3 * ``` */ export declare class Firewall extends pulumi.CustomResource { /** * Get an existing Firewall 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: string, id: pulumi.Input, state?: FirewallState, opts?: pulumi.CustomResourceOptions): Firewall; /** * Returns true if the given object is an instance of Firewall. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Firewall; /** * The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you * set to false you need to define at least one ingress or egress rule */ readonly createDefaultRules: pulumi.Output; /** * The egress rules, this is a list of rules that will be applied to the firewall */ readonly egressRules: pulumi.Output; /** * The ingress rules, this is a list of rules that will be applied to the firewall */ readonly ingressRules: pulumi.Output; /** * The firewall name */ readonly name: pulumi.Output; /** * The firewall network, if is not defined we use the default network */ readonly networkId: pulumi.Output; /** * The firewall region, if is not defined we use the global defined in the provider */ readonly region: pulumi.Output; /** * Create a Firewall resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: FirewallArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Firewall resources. */ export interface FirewallState { /** * The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you * set to false you need to define at least one ingress or egress rule */ createDefaultRules?: pulumi.Input; /** * The egress rules, this is a list of rules that will be applied to the firewall */ egressRules?: pulumi.Input[]>; /** * The ingress rules, this is a list of rules that will be applied to the firewall */ ingressRules?: pulumi.Input[]>; /** * The firewall name */ name?: pulumi.Input; /** * The firewall network, if is not defined we use the default network */ networkId?: pulumi.Input; /** * The firewall region, if is not defined we use the global defined in the provider */ region?: pulumi.Input; } /** * The set of arguments for constructing a Firewall resource. */ export interface FirewallArgs { /** * The create rules flag is used to create the default firewall rules, if is not defined will be set to true, and if you * set to false you need to define at least one ingress or egress rule */ createDefaultRules?: pulumi.Input; /** * The egress rules, this is a list of rules that will be applied to the firewall */ egressRules?: pulumi.Input[]>; /** * The ingress rules, this is a list of rules that will be applied to the firewall */ ingressRules?: pulumi.Input[]>; /** * The firewall name */ name?: pulumi.Input; /** * The firewall network, if is not defined we use the default network */ networkId?: pulumi.Input; /** * The firewall region, if is not defined we use the global defined in the provider */ region?: pulumi.Input; }