"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.TrafficMirrorFilterRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage traffic mirror filter rule
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const foo = new volcengine.vpc.TrafficMirrorFilter("foo", {
 *     trafficMirrorFilterName: "acc-test-traffic-mirror-filter",
 *     description: "acc-test",
 *     projectName: "default",
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 * });
 * const foo_ingress = new volcengine.vpc.TrafficMirrorFilterRule("foo-ingress", {
 *     trafficMirrorFilterId: foo.id,
 *     trafficDirection: "ingress",
 *     description: "acc-test",
 *     priority: 1,
 *     policy: "reject",
 *     protocol: "all",
 *     sourceCidrBlock: "10.0.1.0/24",
 *     sourcePortRange: "-1/-1",
 *     destinationCidrBlock: "10.0.0.0/24",
 *     destinationPortRange: "-1/-1",
 * });
 * const foo_egress = new volcengine.vpc.TrafficMirrorFilterRule("foo-egress", {
 *     trafficMirrorFilterId: foo.id,
 *     trafficDirection: "egress",
 *     description: "acc-test",
 *     priority: 2,
 *     policy: "reject",
 *     protocol: "tcp",
 *     sourceCidrBlock: "10.0.1.0/24",
 *     sourcePortRange: "80/80",
 *     destinationCidrBlock: "10.0.0.0/24",
 *     destinationPortRange: "88/90",
 * });
 * ```
 *
 * ## Import
 *
 * TrafficMirrorFilterRule can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:vpc/trafficMirrorFilterRule:TrafficMirrorFilterRule default resource_id
 * ```
 */
class TrafficMirrorFilterRule extends pulumi.CustomResource {
    /**
     * Get an existing TrafficMirrorFilterRule 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, id, state, opts) {
        return new TrafficMirrorFilterRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of TrafficMirrorFilterRule.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === TrafficMirrorFilterRule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createdAt"] = state ? state.createdAt : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["destinationCidrBlock"] = state ? state.destinationCidrBlock : undefined;
            resourceInputs["destinationPortRange"] = state ? state.destinationPortRange : undefined;
            resourceInputs["policy"] = state ? state.policy : undefined;
            resourceInputs["priority"] = state ? state.priority : undefined;
            resourceInputs["protocol"] = state ? state.protocol : undefined;
            resourceInputs["sourceCidrBlock"] = state ? state.sourceCidrBlock : undefined;
            resourceInputs["sourcePortRange"] = state ? state.sourcePortRange : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
            resourceInputs["trafficDirection"] = state ? state.trafficDirection : undefined;
            resourceInputs["trafficMirrorFilterId"] = state ? state.trafficMirrorFilterId : undefined;
            resourceInputs["trafficMirrorFilterRuleId"] = state ? state.trafficMirrorFilterRuleId : undefined;
            resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.destinationCidrBlock === undefined) && !opts.urn) {
                throw new Error("Missing required property 'destinationCidrBlock'");
            }
            if ((!args || args.policy === undefined) && !opts.urn) {
                throw new Error("Missing required property 'policy'");
            }
            if ((!args || args.protocol === undefined) && !opts.urn) {
                throw new Error("Missing required property 'protocol'");
            }
            if ((!args || args.sourceCidrBlock === undefined) && !opts.urn) {
                throw new Error("Missing required property 'sourceCidrBlock'");
            }
            if ((!args || args.trafficDirection === undefined) && !opts.urn) {
                throw new Error("Missing required property 'trafficDirection'");
            }
            if ((!args || args.trafficMirrorFilterId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'trafficMirrorFilterId'");
            }
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["destinationCidrBlock"] = args ? args.destinationCidrBlock : undefined;
            resourceInputs["destinationPortRange"] = args ? args.destinationPortRange : undefined;
            resourceInputs["policy"] = args ? args.policy : undefined;
            resourceInputs["priority"] = args ? args.priority : undefined;
            resourceInputs["protocol"] = args ? args.protocol : undefined;
            resourceInputs["sourceCidrBlock"] = args ? args.sourceCidrBlock : undefined;
            resourceInputs["sourcePortRange"] = args ? args.sourcePortRange : undefined;
            resourceInputs["trafficDirection"] = args ? args.trafficDirection : undefined;
            resourceInputs["trafficMirrorFilterId"] = args ? args.trafficMirrorFilterId : undefined;
            resourceInputs["createdAt"] = undefined /*out*/;
            resourceInputs["status"] = undefined /*out*/;
            resourceInputs["trafficMirrorFilterRuleId"] = undefined /*out*/;
            resourceInputs["updatedAt"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(TrafficMirrorFilterRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.TrafficMirrorFilterRule = TrafficMirrorFilterRule;
/** @internal */
TrafficMirrorFilterRule.__pulumiType = 'volcengine:vpc/trafficMirrorFilterRule:TrafficMirrorFilterRule';
//# sourceMappingURL=trafficMirrorFilterRule.js.map