UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

226 lines (225 loc) 9.25 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages a VPC flow log resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const testGroup = new huaweicloud.lts.Group("testGroup", { * groupName: "test_group", * ttlInDays: 7, * }); * const testStream = new huaweicloud.lts.Stream("testStream", { * groupId: testGroup.id, * streamName: "test_stream", * }); * const testFlowlog = new huaweicloud.vpc.FlowLog("testFlowlog", { * resourceType: "network", * resourceId: _var.subnet_id, * trafficType: "all", * logGroupId: testGroup.id, * logStreamId: testStream.id, * }); * ``` * * ## Import * * VPC flow logs can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Vpc/flowLog:FlowLog flowlog1 41b9d73f-eb1c-4795-a100-59a99b062513 * ``` */ export declare class FlowLog extends pulumi.CustomResource { /** * Get an existing FlowLog 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?: FlowLogState, opts?: pulumi.CustomResourceOptions): FlowLog; /** * Returns true if the given object is an instance of FlowLog. 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 FlowLog; /** * Specifies description about the VPC flow log. * The value can contain no more than 255 characters and cannot contain angle brackets (< or >). */ readonly description: pulumi.Output<string>; /** * Specifies whether to enable the flow log function, the default value is *true*. */ readonly enabled: pulumi.Output<boolean | undefined>; /** * Specifies the LTS log group ID. * Changing this creates a new VPC flow log. */ readonly logGroupId: pulumi.Output<string>; /** * Specifies the LTS log stream ID. * Changing this creates a new VPC flow log. */ readonly logStreamId: pulumi.Output<string>; /** * Specifies the VPC flow log name. The value can contain no more than 64 characters, * including letters, digits, underscores (_), hyphens (-), and periods (.). */ 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 VPC flow log. */ readonly region: pulumi.Output<string>; /** * Specifies the resource ID for which that the logs to be collected. * Changing this creates a new VPC flow log. */ readonly resourceId: pulumi.Output<string>; /** * Specifies the resource type for which that the logs to be collected. * The value can be: * + *port*: Select this to record traffic information about a specific NIC. * + *network*: Select this to record traffic information about all NICs in a specific subnet. * + *vpc*: Select this to record traffic information about all NICs in a specific VPC. */ readonly resourceType: pulumi.Output<string>; /** * The status of the flow log. The value can be `ACTIVE`, `DOWN` or `ERROR`. */ readonly status: pulumi.Output<string>; /** * Specifies the type of traffic to log. The value can be: * + *all*: Specifies that both accepted and rejected traffic of the specified resource will be logged. * + *accept*: Specifies that only accepted inbound and outbound traffic of the specified resource will be logged. * + *reject*: Specifies that only rejected inbound and outbound traffic of the specified resource will be logged. */ readonly trafficType: pulumi.Output<string | undefined>; /** * Create a FlowLog 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: FlowLogArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FlowLog resources. */ export interface FlowLogState { /** * Specifies description about the VPC flow log. * The value can contain no more than 255 characters and cannot contain angle brackets (< or >). */ description?: pulumi.Input<string>; /** * Specifies whether to enable the flow log function, the default value is *true*. */ enabled?: pulumi.Input<boolean>; /** * Specifies the LTS log group ID. * Changing this creates a new VPC flow log. */ logGroupId?: pulumi.Input<string>; /** * Specifies the LTS log stream ID. * Changing this creates a new VPC flow log. */ logStreamId?: pulumi.Input<string>; /** * Specifies the VPC flow log name. The value can contain no more than 64 characters, * including letters, digits, underscores (_), hyphens (-), and periods (.). */ 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 VPC flow log. */ region?: pulumi.Input<string>; /** * Specifies the resource ID for which that the logs to be collected. * Changing this creates a new VPC flow log. */ resourceId?: pulumi.Input<string>; /** * Specifies the resource type for which that the logs to be collected. * The value can be: * + *port*: Select this to record traffic information about a specific NIC. * + *network*: Select this to record traffic information about all NICs in a specific subnet. * + *vpc*: Select this to record traffic information about all NICs in a specific VPC. */ resourceType?: pulumi.Input<string>; /** * The status of the flow log. The value can be `ACTIVE`, `DOWN` or `ERROR`. */ status?: pulumi.Input<string>; /** * Specifies the type of traffic to log. The value can be: * + *all*: Specifies that both accepted and rejected traffic of the specified resource will be logged. * + *accept*: Specifies that only accepted inbound and outbound traffic of the specified resource will be logged. * + *reject*: Specifies that only rejected inbound and outbound traffic of the specified resource will be logged. */ trafficType?: pulumi.Input<string>; } /** * The set of arguments for constructing a FlowLog resource. */ export interface FlowLogArgs { /** * Specifies description about the VPC flow log. * The value can contain no more than 255 characters and cannot contain angle brackets (< or >). */ description?: pulumi.Input<string>; /** * Specifies whether to enable the flow log function, the default value is *true*. */ enabled?: pulumi.Input<boolean>; /** * Specifies the LTS log group ID. * Changing this creates a new VPC flow log. */ logGroupId: pulumi.Input<string>; /** * Specifies the LTS log stream ID. * Changing this creates a new VPC flow log. */ logStreamId: pulumi.Input<string>; /** * Specifies the VPC flow log name. The value can contain no more than 64 characters, * including letters, digits, underscores (_), hyphens (-), and periods (.). */ 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 VPC flow log. */ region?: pulumi.Input<string>; /** * Specifies the resource ID for which that the logs to be collected. * Changing this creates a new VPC flow log. */ resourceId: pulumi.Input<string>; /** * Specifies the resource type for which that the logs to be collected. * The value can be: * + *port*: Select this to record traffic information about a specific NIC. * + *network*: Select this to record traffic information about all NICs in a specific subnet. * + *vpc*: Select this to record traffic information about all NICs in a specific VPC. */ resourceType: pulumi.Input<string>; /** * Specifies the type of traffic to log. The value can be: * + *all*: Specifies that both accepted and rejected traffic of the specified resource will be logged. * + *accept*: Specifies that only accepted inbound and outbound traffic of the specified resource will be logged. * + *reject*: Specifies that only rejected inbound and outbound traffic of the specified resource will be logged. */ trafficType?: pulumi.Input<string>; }