@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
257 lines (256 loc) • 8.54 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages a CFW capture task resource within HuaweiCloud.
*
* > **NOTE:** For the Cloud Firewall service, you can only initiate up to 20 packet capture tasks per day.
* Beyond this limit, no additional packet capture tasks can be initiated. Furthermore, only one packet capture task can be
* in progress at any given time.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const fwInstanceId = config.requireObject("fwInstanceId");
* const name = config.requireObject("name");
* const duration = config.requireObject("duration");
* const maxPackets = config.requireObject("maxPackets");
* const test = new huaweicloud.cfw.CaptureTask("test", {
* fwInstanceId: fwInstanceId,
* duration: duration,
* maxPackets: maxPackets,
* destination: {
* address: "1.1.1.1",
* addressType: 0,
* },
* source: {
* address: "2.2.2.2",
* addressType: 0,
* },
* service: {
* protocol: -1,
* },
* });
* ```
*
* ## Import
*
* The capture task can be imported using `fw_instance_id`, `name`, separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Cfw/captureTask:CaptureTask test <fw_instance_id>/<name>
* ```
*
* 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 is `stop_capture`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the capture task, or the resource definition should be updated to align with the capture task. Also you can ignore changes as below. hcl resource "huaweicloud_cfw_capture_task" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* stop_capture,
*
* ]
*
* } }
*/
export declare class CaptureTask extends pulumi.CustomResource {
/**
* Get an existing CaptureTask 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?: CaptureTaskState, opts?: pulumi.CustomResourceOptions): CaptureTask;
/**
* Returns true if the given object is an instance of CaptureTask. 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 CaptureTask;
/**
* The creation time of the capture task.
*/
readonly createdAt: pulumi.Output<string>;
/**
* Specifies the destination configuration.
* The destination structure is documented below.
*/
readonly destination: pulumi.Output<outputs.Cfw.CaptureTaskDestination>;
/**
* Specifies the capture task duration.
*/
readonly duration: pulumi.Output<number>;
readonly enableForceNew: pulumi.Output<string | undefined>;
/**
* Specifies the ID of the firewall instance.
*/
readonly fwInstanceId: pulumi.Output<string>;
/**
* Specifies the maximum number of packets captured.
* The Maximum value is `1,000,000`.
*/
readonly maxPackets: pulumi.Output<number>;
/**
* Specifies the capture task name.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the region in which to create the resource.
* If omitted, the provider-level region will be used.
* Changing this creates a new resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the service configuration.
* The service structure is documented below.
*/
readonly service: pulumi.Output<outputs.Cfw.CaptureTaskService>;
/**
* Specifies the source configuration.
* The source structure is documented below.
*/
readonly source: pulumi.Output<outputs.Cfw.CaptureTaskSource>;
/**
* The status of the capture task.
*/
readonly status: pulumi.Output<number>;
/**
* Specifies whether to stop the capture task.
*/
readonly stopCapture: pulumi.Output<boolean | undefined>;
/**
* The ID of the capture task.
*/
readonly taskId: pulumi.Output<string>;
/**
* The update time of the capture task.
*/
readonly updatedAt: pulumi.Output<string>;
/**
* Create a CaptureTask 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: CaptureTaskArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering CaptureTask resources.
*/
export interface CaptureTaskState {
/**
* The creation time of the capture task.
*/
createdAt?: pulumi.Input<string>;
/**
* Specifies the destination configuration.
* The destination structure is documented below.
*/
destination?: pulumi.Input<inputs.Cfw.CaptureTaskDestination>;
/**
* Specifies the capture task duration.
*/
duration?: pulumi.Input<number>;
enableForceNew?: pulumi.Input<string>;
/**
* Specifies the ID of the firewall instance.
*/
fwInstanceId?: pulumi.Input<string>;
/**
* Specifies the maximum number of packets captured.
* The Maximum value is `1,000,000`.
*/
maxPackets?: pulumi.Input<number>;
/**
* Specifies the capture task name.
*/
name?: pulumi.Input<string>;
/**
* Specifies the region in which to create the resource.
* If omitted, the provider-level region will be used.
* Changing this creates a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the service configuration.
* The service structure is documented below.
*/
service?: pulumi.Input<inputs.Cfw.CaptureTaskService>;
/**
* Specifies the source configuration.
* The source structure is documented below.
*/
source?: pulumi.Input<inputs.Cfw.CaptureTaskSource>;
/**
* The status of the capture task.
*/
status?: pulumi.Input<number>;
/**
* Specifies whether to stop the capture task.
*/
stopCapture?: pulumi.Input<boolean>;
/**
* The ID of the capture task.
*/
taskId?: pulumi.Input<string>;
/**
* The update time of the capture task.
*/
updatedAt?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a CaptureTask resource.
*/
export interface CaptureTaskArgs {
/**
* Specifies the destination configuration.
* The destination structure is documented below.
*/
destination: pulumi.Input<inputs.Cfw.CaptureTaskDestination>;
/**
* Specifies the capture task duration.
*/
duration: pulumi.Input<number>;
enableForceNew?: pulumi.Input<string>;
/**
* Specifies the ID of the firewall instance.
*/
fwInstanceId: pulumi.Input<string>;
/**
* Specifies the maximum number of packets captured.
* The Maximum value is `1,000,000`.
*/
maxPackets: pulumi.Input<number>;
/**
* Specifies the capture task name.
*/
name?: pulumi.Input<string>;
/**
* Specifies the region in which to create the resource.
* If omitted, the provider-level region will be used.
* Changing this creates a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the service configuration.
* The service structure is documented below.
*/
service: pulumi.Input<inputs.Cfw.CaptureTaskService>;
/**
* Specifies the source configuration.
* The source structure is documented below.
*/
source: pulumi.Input<inputs.Cfw.CaptureTaskSource>;
/**
* Specifies whether to stop the capture task.
*/
stopCapture?: pulumi.Input<boolean>;
}