@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
385 lines (384 loc) • 15 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides a resource to manage cfw control policy
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooCfwAddressBook = new volcengine.cloud_firewall.CfwAddressBook("fooCfwAddressBook", {
* groupName: "acc-test-address-book",
* description: "acc-test",
* groupType: "ip",
* addressLists: [
* "192.168.1.1",
* "192.168.2.2",
* ],
* });
* const fooCfwControlPolicy = new volcengine.cloud_firewall.CfwControlPolicy("fooCfwControlPolicy", {
* direction: "in",
* action: "accept",
* destinationType: "group",
* destination: fooCfwAddressBook.id,
* proto: "TCP",
* sourceType: "net",
* source: "0.0.0.0/0",
* description: "acc-test-control-policy",
* destPortType: "port",
* destPort: "300",
* repeatType: "Weekly",
* repeatStartTime: "01:00",
* repeatEndTime: "11:00",
* repeatDays: [
* 2,
* 5,
* ],
* startTime: 1736092800,
* endTime: 1738339140,
* priority: 1,
* status: true,
* });
* ```
*
* ## Import
*
* ControlPolicy can be imported using the direction:rule_id, e.g.
*
* ```sh
* $ pulumi import volcengine:cloud_firewall/cfwControlPolicy:CfwControlPolicy default resource_id
* ```
*/
export declare class CfwControlPolicy extends pulumi.CustomResource {
/**
* Get an existing CfwControlPolicy 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?: CfwControlPolicyState, opts?: pulumi.CustomResourceOptions): CfwControlPolicy;
/**
* Returns true if the given object is an instance of CfwControlPolicy. 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 CfwControlPolicy;
/**
* The account id of the control policy.
*/
readonly accountId: pulumi.Output<string>;
/**
* The action of the control policy. Valid values: `accept`, `deny`, `monitor`.
*/
readonly action: pulumi.Output<string>;
/**
* The description of the control policy.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* The dest port of the control policy.
*/
readonly destPort: pulumi.Output<string>;
/**
* The dest port type of the control policy. Valid values: `port`, `group`.
*/
readonly destPortType: pulumi.Output<string>;
/**
* The destination of the control policy.
*/
readonly destination: pulumi.Output<string>;
/**
* The destination type of the control policy. Valid values: `net`, `group`, `location`, `domain`.
*/
readonly destinationType: pulumi.Output<string>;
/**
* The direction of the control policy. Valid values: `in`, `out`.
*/
readonly direction: pulumi.Output<string>;
/**
* The effect status of the control policy. 1: Not yet effective, 2: Issued in progress, 3: Effective.
*/
readonly effectStatus: pulumi.Output<number>;
/**
* The end time of the control policy. Unix timestamp, fields need to be precise to 23:59:00 of the set date.
* When the value of repeatType is one of `Once`, `Daily`, `Weekly`, `Monthly`, this field is required.
*/
readonly endTime: pulumi.Output<number | undefined>;
/**
* The hit count of the control policy.
*/
readonly hitCnt: pulumi.Output<number>;
/**
* Whether the control policy is effected.
*/
readonly isEffected: pulumi.Output<boolean>;
/**
* The priority of the control policy.
*/
readonly prio: pulumi.Output<number>;
/**
* The priority of the control policy. Default is 0. This field is only effective when creating a control policy.0 means lowest priority, 1 means highest priority. The priority increases in order from 1, with lower priority indicating higher priority.
*/
readonly priority: pulumi.Output<number | undefined>;
/**
* The proto of the control policy. Valid values: `TCP`, `ICMP`, `UDP`, `ANY`. When the destinationType is `domain`, The proto must be `TCP`.
*/
readonly proto: pulumi.Output<string>;
/**
* The repeat days of the control policy. When the value of repeatType is one of `Weekly`, `Monthly`, this field is required.
* When the repeatType is `Weekly`, the valid value range is 0~6.
* When the repeatType is `Monthly`, the valid value range is 1~31.
*/
readonly repeatDays: pulumi.Output<number[] | undefined>;
/**
* The repeat end time of the control policy. Accurate to the minute, in the format of hh: mm. For example: 12:00.
* When the value of repeatType is one of `Daily`, `Weekly`, `Monthly`, this field is required.
*/
readonly repeatEndTime: pulumi.Output<string | undefined>;
/**
* The repeat start time of the control policy. Accurate to the minute, in the format of hh: mm. For example: 12:00.
* When the value of repeatType is one of `Daily`, `Weekly`, `Monthly`, this field is required.
*/
readonly repeatStartTime: pulumi.Output<string | undefined>;
/**
* The repeat type of the control policy. Valid values: `Permanent`, `Once`, `Daily`, `Weekly`, `Monthly`.
*/
readonly repeatType: pulumi.Output<string>;
/**
* The rule id of the control policy.
*/
readonly ruleId: pulumi.Output<string>;
/**
* The source of the control policy.
*/
readonly source: pulumi.Output<string>;
/**
* The source type of the control policy. Valid values: `net`, `group`, `location`.
*/
readonly sourceType: pulumi.Output<string>;
/**
* The start time of the control policy. Unix timestamp, fields need to be precise to 23:59:00 of the set date.
* When the value of repeatType is one of `Once`, `Daily`, `Weekly`, `Monthly`, this field is required.
*/
readonly startTime: pulumi.Output<number | undefined>;
/**
* Whether to enable the control policy. Default is false.
*/
readonly status: pulumi.Output<boolean>;
/**
* The update time of the control policy.
*/
readonly updateTime: pulumi.Output<number>;
/**
* The use count of the control policy.
*/
readonly useCount: pulumi.Output<number>;
/**
* Create a CfwControlPolicy 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: CfwControlPolicyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering CfwControlPolicy resources.
*/
export interface CfwControlPolicyState {
/**
* The account id of the control policy.
*/
accountId?: pulumi.Input<string>;
/**
* The action of the control policy. Valid values: `accept`, `deny`, `monitor`.
*/
action?: pulumi.Input<string>;
/**
* The description of the control policy.
*/
description?: pulumi.Input<string>;
/**
* The dest port of the control policy.
*/
destPort?: pulumi.Input<string>;
/**
* The dest port type of the control policy. Valid values: `port`, `group`.
*/
destPortType?: pulumi.Input<string>;
/**
* The destination of the control policy.
*/
destination?: pulumi.Input<string>;
/**
* The destination type of the control policy. Valid values: `net`, `group`, `location`, `domain`.
*/
destinationType?: pulumi.Input<string>;
/**
* The direction of the control policy. Valid values: `in`, `out`.
*/
direction?: pulumi.Input<string>;
/**
* The effect status of the control policy. 1: Not yet effective, 2: Issued in progress, 3: Effective.
*/
effectStatus?: pulumi.Input<number>;
/**
* The end time of the control policy. Unix timestamp, fields need to be precise to 23:59:00 of the set date.
* When the value of repeatType is one of `Once`, `Daily`, `Weekly`, `Monthly`, this field is required.
*/
endTime?: pulumi.Input<number>;
/**
* The hit count of the control policy.
*/
hitCnt?: pulumi.Input<number>;
/**
* Whether the control policy is effected.
*/
isEffected?: pulumi.Input<boolean>;
/**
* The priority of the control policy.
*/
prio?: pulumi.Input<number>;
/**
* The priority of the control policy. Default is 0. This field is only effective when creating a control policy.0 means lowest priority, 1 means highest priority. The priority increases in order from 1, with lower priority indicating higher priority.
*/
priority?: pulumi.Input<number>;
/**
* The proto of the control policy. Valid values: `TCP`, `ICMP`, `UDP`, `ANY`. When the destinationType is `domain`, The proto must be `TCP`.
*/
proto?: pulumi.Input<string>;
/**
* The repeat days of the control policy. When the value of repeatType is one of `Weekly`, `Monthly`, this field is required.
* When the repeatType is `Weekly`, the valid value range is 0~6.
* When the repeatType is `Monthly`, the valid value range is 1~31.
*/
repeatDays?: pulumi.Input<pulumi.Input<number>[]>;
/**
* The repeat end time of the control policy. Accurate to the minute, in the format of hh: mm. For example: 12:00.
* When the value of repeatType is one of `Daily`, `Weekly`, `Monthly`, this field is required.
*/
repeatEndTime?: pulumi.Input<string>;
/**
* The repeat start time of the control policy. Accurate to the minute, in the format of hh: mm. For example: 12:00.
* When the value of repeatType is one of `Daily`, `Weekly`, `Monthly`, this field is required.
*/
repeatStartTime?: pulumi.Input<string>;
/**
* The repeat type of the control policy. Valid values: `Permanent`, `Once`, `Daily`, `Weekly`, `Monthly`.
*/
repeatType?: pulumi.Input<string>;
/**
* The rule id of the control policy.
*/
ruleId?: pulumi.Input<string>;
/**
* The source of the control policy.
*/
source?: pulumi.Input<string>;
/**
* The source type of the control policy. Valid values: `net`, `group`, `location`.
*/
sourceType?: pulumi.Input<string>;
/**
* The start time of the control policy. Unix timestamp, fields need to be precise to 23:59:00 of the set date.
* When the value of repeatType is one of `Once`, `Daily`, `Weekly`, `Monthly`, this field is required.
*/
startTime?: pulumi.Input<number>;
/**
* Whether to enable the control policy. Default is false.
*/
status?: pulumi.Input<boolean>;
/**
* The update time of the control policy.
*/
updateTime?: pulumi.Input<number>;
/**
* The use count of the control policy.
*/
useCount?: pulumi.Input<number>;
}
/**
* The set of arguments for constructing a CfwControlPolicy resource.
*/
export interface CfwControlPolicyArgs {
/**
* The action of the control policy. Valid values: `accept`, `deny`, `monitor`.
*/
action: pulumi.Input<string>;
/**
* The description of the control policy.
*/
description?: pulumi.Input<string>;
/**
* The dest port of the control policy.
*/
destPort?: pulumi.Input<string>;
/**
* The dest port type of the control policy. Valid values: `port`, `group`.
*/
destPortType?: pulumi.Input<string>;
/**
* The destination of the control policy.
*/
destination: pulumi.Input<string>;
/**
* The destination type of the control policy. Valid values: `net`, `group`, `location`, `domain`.
*/
destinationType: pulumi.Input<string>;
/**
* The direction of the control policy. Valid values: `in`, `out`.
*/
direction: pulumi.Input<string>;
/**
* The end time of the control policy. Unix timestamp, fields need to be precise to 23:59:00 of the set date.
* When the value of repeatType is one of `Once`, `Daily`, `Weekly`, `Monthly`, this field is required.
*/
endTime?: pulumi.Input<number>;
/**
* The priority of the control policy. Default is 0. This field is only effective when creating a control policy.0 means lowest priority, 1 means highest priority. The priority increases in order from 1, with lower priority indicating higher priority.
*/
priority?: pulumi.Input<number>;
/**
* The proto of the control policy. Valid values: `TCP`, `ICMP`, `UDP`, `ANY`. When the destinationType is `domain`, The proto must be `TCP`.
*/
proto: pulumi.Input<string>;
/**
* The repeat days of the control policy. When the value of repeatType is one of `Weekly`, `Monthly`, this field is required.
* When the repeatType is `Weekly`, the valid value range is 0~6.
* When the repeatType is `Monthly`, the valid value range is 1~31.
*/
repeatDays?: pulumi.Input<pulumi.Input<number>[]>;
/**
* The repeat end time of the control policy. Accurate to the minute, in the format of hh: mm. For example: 12:00.
* When the value of repeatType is one of `Daily`, `Weekly`, `Monthly`, this field is required.
*/
repeatEndTime?: pulumi.Input<string>;
/**
* The repeat start time of the control policy. Accurate to the minute, in the format of hh: mm. For example: 12:00.
* When the value of repeatType is one of `Daily`, `Weekly`, `Monthly`, this field is required.
*/
repeatStartTime?: pulumi.Input<string>;
/**
* The repeat type of the control policy. Valid values: `Permanent`, `Once`, `Daily`, `Weekly`, `Monthly`.
*/
repeatType?: pulumi.Input<string>;
/**
* The source of the control policy.
*/
source: pulumi.Input<string>;
/**
* The source type of the control policy. Valid values: `net`, `group`, `location`.
*/
sourceType: pulumi.Input<string>;
/**
* The start time of the control policy. Unix timestamp, fields need to be precise to 23:59:00 of the set date.
* When the value of repeatType is one of `Once`, `Daily`, `Weekly`, `Monthly`, this field is required.
*/
startTime?: pulumi.Input<number>;
/**
* Whether to enable the control policy. Default is false.
*/
status?: pulumi.Input<boolean>;
}