UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

430 lines (429 loc) 14.4 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages a CFW firewall resource within HuaweiCloud. * * ## Example Usage * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const test = new huaweicloud.Cfw.Firewall("test", { * flavor: { * version: "Professional", * }, * tags: { * foo: "bar", * key: "value", * }, * }); * ``` * ### PrePaid firewall * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const test = new huaweicloud.Cfw.Firewall("test", { * autoRenew: "false", * chargingMode: "prePaid", * flavor: { * version: "Professional", * }, * period: 1, * periodUnit: "month", * tags: { * foo: "bar", * key: "value", * }, * }); * ``` * ### firewall with east-west firewall * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const test = new huaweicloud.cfw.Firewall("test", { * eastWestFirewallInspectionCidr: "172.16.1.0/24", * eastWestFirewallErId: huaweicloud_er_instance.test.id, * eastWestFirewallMode: "er", * flavor: { * version: "Professional", * }, * tags: { * key: "value", * foo: "bar", * }, * }); * ``` * ### firewall with IPS switch and IPS protection mode * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const test = new huaweicloud.Cfw.Firewall("test", { * autoRenew: "false", * chargingMode: "prePaid", * flavor: { * version: "Professional", * }, * ipsProtectionMode: 1, * ipsSwitchStatus: 1, * period: 1, * periodUnit: "month", * tags: { * foo: "bar", * key: "value", * }, * }); * ``` * * ## Import * * The firewall can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Cfw/firewall:Firewall test 6cb1ce47-9990-447e-b071-d167c5393871 * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`period_unit`, `period` and `auto_renew`. It is generally recommended running `terraform plan` after importing an CFW firewall. You can then decide if changes should be applied to the firewall, or the resource definition should be updated to align with the firewall. Also you can ignore changes as below. hcl resource "huaweicloud_cfw_firewall" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * period_unit, period, auto_renew * * ] * * } } */ 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<pulumi.ID>, 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; /** * Specifies whether auto renew is enabled. * Valid values are **true** and **false**. Defaults to **false**. */ readonly autoRenew: pulumi.Output<string | undefined>; /** * Specifies the charging mode of the firewall. * Valid values are **prePaid** and **postPaid**, defaults to **postPaid**. */ readonly chargingMode: pulumi.Output<string | undefined>; /** * Enterprise Router and Firewall Connection ID. */ readonly eastWestFirewallErAttachmentId: pulumi.Output<string>; /** * Specifies the ER ID of the east-west firewall. */ readonly eastWestFirewallErId: pulumi.Output<string>; /** * Specifies the inspection cidr of the east-west firewall. */ readonly eastWestFirewallInspectionCidr: pulumi.Output<string>; /** * The east-west firewall inspection VPC ID. */ readonly eastWestFirewallInspectionVpcId: pulumi.Output<string>; /** * Specifies the mode of the east-west firewall. * The value can be: **er**. */ readonly eastWestFirewallMode: pulumi.Output<string>; /** * Specifies the protection statue of the east-west firewall. * The value can be: `0`(enabled) and `1`(disabled). Defaults to `0`. */ readonly eastWestFirewallStatus: pulumi.Output<number | undefined>; /** * The engine type */ readonly engineType: pulumi.Output<number>; /** * Specifies the enterprise project ID of the firewall. */ readonly enterpriseProjectId: pulumi.Output<string>; /** * Specifies the flavor of the firewall. * Changing this parameter will create a new resource. * The flavor structure is documented below. */ readonly flavor: pulumi.Output<outputs.Cfw.FirewallFlavor>; /** * The HA type. */ readonly haType: pulumi.Output<number>; /** * Specifies the IPS protection mode of the firewall. Defaults to `0`. */ readonly ipsProtectionMode: pulumi.Output<number | undefined>; /** * Specifies the IPS patch switch status of the firewall. * The value can be `0`(disabled) and `1`(enabled). Defaults to `0`. */ readonly ipsSwitchStatus: pulumi.Output<number | undefined>; /** * Specifies the firewall name. */ readonly name: pulumi.Output<string>; /** * Specifies the charging period. * If `periodUnit` is set to **month**, the value ranges from 1 to 9. * If `periodUnit` is set to **year**, the value ranges from 1 to 3. * This parameter is mandatory if `chargingMode` is set to **prePaid**. */ readonly period: pulumi.Output<number | undefined>; /** * Specifies the charging period unit. * Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**. */ readonly periodUnit: pulumi.Output<string | undefined>; /** * The protect objects list. * The protectObjects structure is documented below. */ readonly protectObjects: pulumi.Output<outputs.Cfw.FirewallProtectObject[]>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ readonly region: pulumi.Output<string>; /** * The service type. */ readonly serviceType: pulumi.Output<number>; /** * The firewall status. */ readonly status: pulumi.Output<number>; /** * Whether IPv6 is supported. */ readonly supportIpv6: pulumi.Output<boolean>; /** * Specifies the key/value pairs to associate with the firewall. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * 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 { /** * Specifies whether auto renew is enabled. * Valid values are **true** and **false**. Defaults to **false**. */ autoRenew?: pulumi.Input<string>; /** * Specifies the charging mode of the firewall. * Valid values are **prePaid** and **postPaid**, defaults to **postPaid**. */ chargingMode?: pulumi.Input<string>; /** * Enterprise Router and Firewall Connection ID. */ eastWestFirewallErAttachmentId?: pulumi.Input<string>; /** * Specifies the ER ID of the east-west firewall. */ eastWestFirewallErId?: pulumi.Input<string>; /** * Specifies the inspection cidr of the east-west firewall. */ eastWestFirewallInspectionCidr?: pulumi.Input<string>; /** * The east-west firewall inspection VPC ID. */ eastWestFirewallInspectionVpcId?: pulumi.Input<string>; /** * Specifies the mode of the east-west firewall. * The value can be: **er**. */ eastWestFirewallMode?: pulumi.Input<string>; /** * Specifies the protection statue of the east-west firewall. * The value can be: `0`(enabled) and `1`(disabled). Defaults to `0`. */ eastWestFirewallStatus?: pulumi.Input<number>; /** * The engine type */ engineType?: pulumi.Input<number>; /** * Specifies the enterprise project ID of the firewall. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the flavor of the firewall. * Changing this parameter will create a new resource. * The flavor structure is documented below. */ flavor?: pulumi.Input<inputs.Cfw.FirewallFlavor>; /** * The HA type. */ haType?: pulumi.Input<number>; /** * Specifies the IPS protection mode of the firewall. Defaults to `0`. */ ipsProtectionMode?: pulumi.Input<number>; /** * Specifies the IPS patch switch status of the firewall. * The value can be `0`(disabled) and `1`(enabled). Defaults to `0`. */ ipsSwitchStatus?: pulumi.Input<number>; /** * Specifies the firewall name. */ name?: pulumi.Input<string>; /** * Specifies the charging period. * If `periodUnit` is set to **month**, the value ranges from 1 to 9. * If `periodUnit` is set to **year**, the value ranges from 1 to 3. * This parameter is mandatory if `chargingMode` is set to **prePaid**. */ period?: pulumi.Input<number>; /** * Specifies the charging period unit. * Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**. */ periodUnit?: pulumi.Input<string>; /** * The protect objects list. * The protectObjects structure is documented below. */ protectObjects?: pulumi.Input<pulumi.Input<inputs.Cfw.FirewallProtectObject>[]>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * The service type. */ serviceType?: pulumi.Input<number>; /** * The firewall status. */ status?: pulumi.Input<number>; /** * Whether IPv6 is supported. */ supportIpv6?: pulumi.Input<boolean>; /** * Specifies the key/value pairs to associate with the firewall. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; } /** * The set of arguments for constructing a Firewall resource. */ export interface FirewallArgs { /** * Specifies whether auto renew is enabled. * Valid values are **true** and **false**. Defaults to **false**. */ autoRenew?: pulumi.Input<string>; /** * Specifies the charging mode of the firewall. * Valid values are **prePaid** and **postPaid**, defaults to **postPaid**. */ chargingMode?: pulumi.Input<string>; /** * Specifies the ER ID of the east-west firewall. */ eastWestFirewallErId?: pulumi.Input<string>; /** * Specifies the inspection cidr of the east-west firewall. */ eastWestFirewallInspectionCidr?: pulumi.Input<string>; /** * Specifies the mode of the east-west firewall. * The value can be: **er**. */ eastWestFirewallMode?: pulumi.Input<string>; /** * Specifies the protection statue of the east-west firewall. * The value can be: `0`(enabled) and `1`(disabled). Defaults to `0`. */ eastWestFirewallStatus?: pulumi.Input<number>; /** * Specifies the enterprise project ID of the firewall. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the flavor of the firewall. * Changing this parameter will create a new resource. * The flavor structure is documented below. */ flavor: pulumi.Input<inputs.Cfw.FirewallFlavor>; /** * Specifies the IPS protection mode of the firewall. Defaults to `0`. */ ipsProtectionMode?: pulumi.Input<number>; /** * Specifies the IPS patch switch status of the firewall. * The value can be `0`(disabled) and `1`(enabled). Defaults to `0`. */ ipsSwitchStatus?: pulumi.Input<number>; /** * Specifies the firewall name. */ name?: pulumi.Input<string>; /** * Specifies the charging period. * If `periodUnit` is set to **month**, the value ranges from 1 to 9. * If `periodUnit` is set to **year**, the value ranges from 1 to 3. * This parameter is mandatory if `chargingMode` is set to **prePaid**. */ period?: pulumi.Input<number>; /** * Specifies the charging period unit. * Valid values are **month** and **year**. This parameter is mandatory if `chargingMode` is set to **prePaid**. */ periodUnit?: pulumi.Input<string>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Specifies the key/value pairs to associate with the firewall. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; }