@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
126 lines • 6.35 kB
JavaScript
;
// *** 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");
/**
* Manages a VPC traffic mirror filter rule resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const trafficMirrorFilterId = config.requireObject("trafficMirrorFilterId");
* const test = new huaweicloud.vpc.TrafficMirrorFilterRule("test", {
* trafficMirrorFilterId: trafficMirrorFilterId,
* direction: "ingress",
* protocol: "tcp",
* ethertype: "IPv4",
* action: "accept",
* priority: 1,
* sourceCidrBlock: "10.0.0.0/8",
* sourcePortRange: "80-90",
* destinationCidrBlock: "192.168.1.0/24",
* destinationPortRange: "10-65535",
* });
* ```
*
* ## Import
*
* The traffic mirror filter rule can be imported using `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Vpc/trafficMirrorFilterRule:TrafficMirrorFilterRule test <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["action"] = state ? state.action : undefined;
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["direction"] = state ? state.direction : undefined;
resourceInputs["ethertype"] = state ? state.ethertype : undefined;
resourceInputs["priority"] = state ? state.priority : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["sourceCidrBlock"] = state ? state.sourceCidrBlock : undefined;
resourceInputs["sourcePortRange"] = state ? state.sourcePortRange : undefined;
resourceInputs["trafficMirrorFilterId"] = state ? state.trafficMirrorFilterId : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
if ((!args || args.action === undefined) && !opts.urn) {
throw new Error("Missing required property 'action'");
}
if ((!args || args.direction === undefined) && !opts.urn) {
throw new Error("Missing required property 'direction'");
}
if ((!args || args.ethertype === undefined) && !opts.urn) {
throw new Error("Missing required property 'ethertype'");
}
if ((!args || args.priority === undefined) && !opts.urn) {
throw new Error("Missing required property 'priority'");
}
if ((!args || args.protocol === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
if ((!args || args.trafficMirrorFilterId === undefined) && !opts.urn) {
throw new Error("Missing required property 'trafficMirrorFilterId'");
}
resourceInputs["action"] = args ? args.action : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["destinationCidrBlock"] = args ? args.destinationCidrBlock : undefined;
resourceInputs["destinationPortRange"] = args ? args.destinationPortRange : undefined;
resourceInputs["direction"] = args ? args.direction : undefined;
resourceInputs["ethertype"] = args ? args.ethertype : undefined;
resourceInputs["priority"] = args ? args.priority : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["sourceCidrBlock"] = args ? args.sourceCidrBlock : undefined;
resourceInputs["sourcePortRange"] = args ? args.sourcePortRange : undefined;
resourceInputs["trafficMirrorFilterId"] = args ? args.trafficMirrorFilterId : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TrafficMirrorFilterRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.TrafficMirrorFilterRule = TrafficMirrorFilterRule;
/** @internal */
TrafficMirrorFilterRule.__pulumiType = 'huaweicloud:Vpc/trafficMirrorFilterRule:TrafficMirrorFilterRule';
//# sourceMappingURL=trafficMirrorFilterRule.js.map