UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

150 lines 6.55 kB
"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.SecurityGroupRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage security group rule * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@volcengine/pulumi"; * * const g1test3 = new volcengine.vpc.SecurityGroupRule("g1test3", { * cidrIp: "10.0.0.0/8", * description: "tft1234", * direction: "egress", * portEnd: 9003, * portStart: 8000, * protocol: "tcp", * securityGroupId: "sg-2d6722jpp55og58ozfd1sqtdb", * }); * const g1test2 = new volcengine.vpc.SecurityGroupRule("g1test2", { * cidrIp: "10.0.0.0/24", * direction: "egress", * portEnd: 9003, * portStart: 8000, * protocol: "tcp", * securityGroupId: "sg-2d6722jpp55og58ozfd1sqtdb", * }); * const g1test1 = new volcengine.vpc.SecurityGroupRule("g1test1", { * cidrIp: "10.0.0.0/24", * direction: "egress", * portEnd: 9003, * portStart: 8000, * priority: 2, * protocol: "tcp", * securityGroupId: "sg-2d6722jpp55og58ozfd1sqtdb", * }); * const g1test0 = new volcengine.vpc.SecurityGroupRule("g1test0", { * cidrIp: "10.0.0.0/24", * description: "tft", * direction: "ingress", * policy: "drop", * portEnd: 80, * portStart: 80, * priority: 2, * protocol: "tcp", * securityGroupId: "sg-2d6722jpp55og58ozfd1sqtdb", * }); * const g1test06 = new volcengine.vpc.SecurityGroupRule("g1test06", { * description: "tft", * direction: "ingress", * policy: "drop", * portEnd: 9003, * portStart: 8000, * priority: 2, * protocol: "tcp", * securityGroupId: "sg-2d6722jpp55og58ozfd1sqtdb", * sourceGroupId: "sg-3rfe5j4xdnklc5zsk2hcw5c6q", * }); * ``` * * ## Import * * SecurityGroupRule can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:vpc/securityGroupRule:SecurityGroupRule default ID is a string concatenated with colons(SecurityGroupId:Protocol:PortStart:PortEnd:CidrIp:SourceGroupId:Direction:Policy:Priority) * ``` */ class SecurityGroupRule extends pulumi.CustomResource { /** * Get an existing SecurityGroupRule 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 SecurityGroupRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SecurityGroupRule. 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'] === SecurityGroupRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cidrIp"] = state ? state.cidrIp : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["direction"] = state ? state.direction : undefined; resourceInputs["policy"] = state ? state.policy : undefined; resourceInputs["portEnd"] = state ? state.portEnd : undefined; resourceInputs["portStart"] = state ? state.portStart : undefined; resourceInputs["priority"] = state ? state.priority : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined; resourceInputs["sourceGroupId"] = state ? state.sourceGroupId : undefined; resourceInputs["status"] = state ? state.status : undefined; } else { const args = argsOrState; if ((!args || args.direction === undefined) && !opts.urn) { throw new Error("Missing required property 'direction'"); } if ((!args || args.portEnd === undefined) && !opts.urn) { throw new Error("Missing required property 'portEnd'"); } if ((!args || args.portStart === undefined) && !opts.urn) { throw new Error("Missing required property 'portStart'"); } if ((!args || args.protocol === undefined) && !opts.urn) { throw new Error("Missing required property 'protocol'"); } if ((!args || args.securityGroupId === undefined) && !opts.urn) { throw new Error("Missing required property 'securityGroupId'"); } resourceInputs["cidrIp"] = args ? args.cidrIp : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["direction"] = args ? args.direction : undefined; resourceInputs["policy"] = args ? args.policy : undefined; resourceInputs["portEnd"] = args ? args.portEnd : undefined; resourceInputs["portStart"] = args ? args.portStart : undefined; resourceInputs["priority"] = args ? args.priority : undefined; resourceInputs["protocol"] = args ? args.protocol : undefined; resourceInputs["securityGroupId"] = args ? args.securityGroupId : undefined; resourceInputs["sourceGroupId"] = args ? args.sourceGroupId : undefined; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SecurityGroupRule.__pulumiType, name, resourceInputs, opts); } } exports.SecurityGroupRule = SecurityGroupRule; /** @internal */ SecurityGroupRule.__pulumiType = 'volcengine:vpc/securityGroupRule:SecurityGroupRule'; //# sourceMappingURL=securityGroupRule.js.map