@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
212 lines (211 loc) • 7.26 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a CFW black white list resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const listType = config.requireObject("listType");
* const direction = config.requireObject("direction");
* const addressType = config.requireObject("addressType");
* const address = config.requireObject("address");
* const protocol = config.requireObject("protocol");
* const port = config.requireObject("port");
* const testFirewalls = huaweicloud.Cfw.getFirewalls({});
* const testBlackWhiteList = new huaweicloud.cfw.BlackWhiteList("testBlackWhiteList", {
* objectId: testFirewalls.then(testFirewalls => testFirewalls.records?[0]?.protectObjects?[0]?.objectId),
* listType: listType,
* direction: direction,
* addressType: addressType,
* address: address,
* protocol: protocol,
* port: port,
* });
* ```
*
* ## Import
*
* The black whitelist can be imported using `object_id`, `list_type`, `address`, separated by slashes, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Cfw/blackWhiteList:BlackWhiteList test <object_id>/<list_type>/<address>
* ```
*/
export declare class BlackWhiteList extends pulumi.CustomResource {
/**
* Get an existing BlackWhiteList 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?: BlackWhiteListState, opts?: pulumi.CustomResourceOptions): BlackWhiteList;
/**
* Returns true if the given object is an instance of BlackWhiteList. 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 BlackWhiteList;
/**
* Specifies the address.
*/
readonly address: pulumi.Output<string>;
/**
* Specifies the IP address type.
* The options are `0` (ipv4), `1` (ipv6) and `2` (domain).
*/
readonly addressType: pulumi.Output<number>;
/**
* Specifies the description of the list.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Specifies the address direction.
* The options are `0` (source address) and `1` (destination address).
*/
readonly direction: pulumi.Output<number>;
/**
* Specifies the list type.
* The options are `4` (blacklist) and `5` (whitelist).
*/
readonly listType: pulumi.Output<number>;
/**
* Specifies the protected object ID.
*/
readonly objectId: pulumi.Output<string>;
/**
* Specifies the destination port.
* Required and only available if protocol is **TCP** or **UDP**.
*/
readonly port: pulumi.Output<string>;
/**
* Specifies the protocol type. The value can be:
* + **6**: indicates TCP;
* + **17**: indicates UDP;
* + **1**: indicates ICMP;
* + **58**: indicates ICMPv6;
* + **-1**: indicates any protocol;
*/
readonly protocol: pulumi.Output<number>;
/**
* 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>;
/**
* Create a BlackWhiteList 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: BlackWhiteListArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering BlackWhiteList resources.
*/
export interface BlackWhiteListState {
/**
* Specifies the address.
*/
address?: pulumi.Input<string>;
/**
* Specifies the IP address type.
* The options are `0` (ipv4), `1` (ipv6) and `2` (domain).
*/
addressType?: pulumi.Input<number>;
/**
* Specifies the description of the list.
*/
description?: pulumi.Input<string>;
/**
* Specifies the address direction.
* The options are `0` (source address) and `1` (destination address).
*/
direction?: pulumi.Input<number>;
/**
* Specifies the list type.
* The options are `4` (blacklist) and `5` (whitelist).
*/
listType?: pulumi.Input<number>;
/**
* Specifies the protected object ID.
*/
objectId?: pulumi.Input<string>;
/**
* Specifies the destination port.
* Required and only available if protocol is **TCP** or **UDP**.
*/
port?: pulumi.Input<string>;
/**
* Specifies the protocol type. The value can be:
* + **6**: indicates TCP;
* + **17**: indicates UDP;
* + **1**: indicates ICMP;
* + **58**: indicates ICMPv6;
* + **-1**: indicates any protocol;
*/
protocol?: pulumi.Input<number>;
/**
* 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 set of arguments for constructing a BlackWhiteList resource.
*/
export interface BlackWhiteListArgs {
/**
* Specifies the address.
*/
address: pulumi.Input<string>;
/**
* Specifies the IP address type.
* The options are `0` (ipv4), `1` (ipv6) and `2` (domain).
*/
addressType: pulumi.Input<number>;
/**
* Specifies the description of the list.
*/
description?: pulumi.Input<string>;
/**
* Specifies the address direction.
* The options are `0` (source address) and `1` (destination address).
*/
direction: pulumi.Input<number>;
/**
* Specifies the list type.
* The options are `4` (blacklist) and `5` (whitelist).
*/
listType: pulumi.Input<number>;
/**
* Specifies the protected object ID.
*/
objectId: pulumi.Input<string>;
/**
* Specifies the destination port.
* Required and only available if protocol is **TCP** or **UDP**.
*/
port?: pulumi.Input<string>;
/**
* Specifies the protocol type. The value can be:
* + **6**: indicates TCP;
* + **17**: indicates UDP;
* + **1**: indicates ICMP;
* + **58**: indicates ICMPv6;
* + **-1**: indicates any protocol;
*/
protocol: pulumi.Input<number>;
/**
* 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>;
}