@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
179 lines • 9.24 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.CfwNatFirewallControlPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage cfw nat firewall 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 fooCfwNatFirewallControlPolicy = new volcengine.cloud_firewall.CfwNatFirewallControlPolicy("fooCfwNatFirewallControlPolicy", {
* direction: "in",
* natFirewallId: "nfw-ydmkayvjsw2vsavx****",
* 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,
* 4,
* ],
* startTime: 1736092800,
* endTime: 1738339140,
* priority: 1,
* status: true,
* });
* ```
*
* ## Import
*
* NatFirewallControlPolicy can be imported using the direction_nat_firewall_id:rule_id, e.g.
*
* ```sh
* $ pulumi import volcengine:cloud_firewall/cfwNatFirewallControlPolicy:CfwNatFirewallControlPolicy default resource_id
* ```
*/
class CfwNatFirewallControlPolicy extends pulumi.CustomResource {
/**
* Get an existing CfwNatFirewallControlPolicy 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 CfwNatFirewallControlPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CfwNatFirewallControlPolicy. 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'] === CfwNatFirewallControlPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state ? state.accountId : undefined;
resourceInputs["action"] = state ? state.action : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["destPort"] = state ? state.destPort : undefined;
resourceInputs["destPortType"] = state ? state.destPortType : undefined;
resourceInputs["destination"] = state ? state.destination : undefined;
resourceInputs["destinationType"] = state ? state.destinationType : undefined;
resourceInputs["direction"] = state ? state.direction : undefined;
resourceInputs["effectStatus"] = state ? state.effectStatus : undefined;
resourceInputs["endTime"] = state ? state.endTime : undefined;
resourceInputs["hitCnt"] = state ? state.hitCnt : undefined;
resourceInputs["isEffected"] = state ? state.isEffected : undefined;
resourceInputs["natFirewallId"] = state ? state.natFirewallId : undefined;
resourceInputs["natFirewallName"] = state ? state.natFirewallName : undefined;
resourceInputs["prio"] = state ? state.prio : undefined;
resourceInputs["priority"] = state ? state.priority : undefined;
resourceInputs["proto"] = state ? state.proto : undefined;
resourceInputs["repeatDays"] = state ? state.repeatDays : undefined;
resourceInputs["repeatEndTime"] = state ? state.repeatEndTime : undefined;
resourceInputs["repeatStartTime"] = state ? state.repeatStartTime : undefined;
resourceInputs["repeatType"] = state ? state.repeatType : undefined;
resourceInputs["ruleId"] = state ? state.ruleId : undefined;
resourceInputs["source"] = state ? state.source : undefined;
resourceInputs["sourceType"] = state ? state.sourceType : undefined;
resourceInputs["startTime"] = state ? state.startTime : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
resourceInputs["useCount"] = state ? state.useCount : undefined;
}
else {
const args = argsOrState;
if ((!args || args.action === undefined) && !opts.urn) {
throw new Error("Missing required property 'action'");
}
if ((!args || args.destination === undefined) && !opts.urn) {
throw new Error("Missing required property 'destination'");
}
if ((!args || args.destinationType === undefined) && !opts.urn) {
throw new Error("Missing required property 'destinationType'");
}
if ((!args || args.direction === undefined) && !opts.urn) {
throw new Error("Missing required property 'direction'");
}
if ((!args || args.natFirewallId === undefined) && !opts.urn) {
throw new Error("Missing required property 'natFirewallId'");
}
if ((!args || args.proto === undefined) && !opts.urn) {
throw new Error("Missing required property 'proto'");
}
if ((!args || args.source === undefined) && !opts.urn) {
throw new Error("Missing required property 'source'");
}
if ((!args || args.sourceType === undefined) && !opts.urn) {
throw new Error("Missing required property 'sourceType'");
}
resourceInputs["action"] = args ? args.action : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["destPort"] = args ? args.destPort : undefined;
resourceInputs["destPortType"] = args ? args.destPortType : undefined;
resourceInputs["destination"] = args ? args.destination : undefined;
resourceInputs["destinationType"] = args ? args.destinationType : undefined;
resourceInputs["direction"] = args ? args.direction : undefined;
resourceInputs["endTime"] = args ? args.endTime : undefined;
resourceInputs["natFirewallId"] = args ? args.natFirewallId : undefined;
resourceInputs["priority"] = args ? args.priority : undefined;
resourceInputs["proto"] = args ? args.proto : undefined;
resourceInputs["repeatDays"] = args ? args.repeatDays : undefined;
resourceInputs["repeatEndTime"] = args ? args.repeatEndTime : undefined;
resourceInputs["repeatStartTime"] = args ? args.repeatStartTime : undefined;
resourceInputs["repeatType"] = args ? args.repeatType : undefined;
resourceInputs["source"] = args ? args.source : undefined;
resourceInputs["sourceType"] = args ? args.sourceType : undefined;
resourceInputs["startTime"] = args ? args.startTime : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["accountId"] = undefined /*out*/;
resourceInputs["effectStatus"] = undefined /*out*/;
resourceInputs["hitCnt"] = undefined /*out*/;
resourceInputs["isEffected"] = undefined /*out*/;
resourceInputs["natFirewallName"] = undefined /*out*/;
resourceInputs["prio"] = undefined /*out*/;
resourceInputs["ruleId"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
resourceInputs["useCount"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CfwNatFirewallControlPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.CfwNatFirewallControlPolicy = CfwNatFirewallControlPolicy;
/** @internal */
CfwNatFirewallControlPolicy.__pulumiType = 'volcengine:cloud_firewall/cfwNatFirewallControlPolicy:CfwNatFirewallControlPolicy';
//# sourceMappingURL=cfwNatFirewallControlPolicy.js.map