import * as pulumi from "@pulumi/pulumi"; /** * Manages a single Secuirity Group Rule within the Yandex.Cloud. For more information, see the official documentation * of [security groups](https://cloud.yandex.com/docs/vpc/concepts/security-groups) * and [security group rules](https://cloud.yandex.com/docs/vpc/concepts/security-groups#rules). * * > **NOTE:** There is another way to manage security group rules by `ingress` and `egress` arguments in yandex_vpc_security_group. Both ways are equivalent but not compatible now. Using in-line rules of yandex.VpcSecurityGroup with Security Group Rule resource at the same time will cause a conflict of rules configuration. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const lab_net = new yandex.VpcNetwork("lab-net", {}); * const group1 = new yandex.VpcSecurityGroup("group1", { * description: "description for my security group", * networkId: lab_net.id, * labels: { * "my-label": "my-label-value", * }, * }); * const rule1 = new yandex.VpcSecurityGroupRule("rule1", { * securityGroupBinding: group1.id, * direction: "ingress", * description: "rule1 description", * v4CidrBlocks: [ * "10.0.1.0/24", * "10.0.2.0/24", * ], * port: 8080, * protocol: "TCP", * }); * const rule2 = new yandex.VpcSecurityGroupRule("rule2", { * securityGroupBinding: group1.id, * direction: "egress", * description: "rule2 description", * v4CidrBlocks: ["10.0.1.0/24"], * fromPort: 8090, * toPort: 8099, * protocol: "UDP", * }); * ``` */ export declare class VpcSecurityGroupRule extends pulumi.CustomResource { /** * Get an existing VpcSecurityGroupRule 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, state?: VpcSecurityGroupRuleState, opts?: pulumi.CustomResourceOptions): VpcSecurityGroupRule; /** * Returns true if the given object is an instance of VpcSecurityGroupRule. 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 VpcSecurityGroupRule; /** * Description of the rule. */ readonly description: pulumi.Output; /** * direction of the rule. Can be `ingress` (inbound) or `egress` (outbound). */ readonly direction: pulumi.Output; /** * Minimum port number. */ readonly fromPort: pulumi.Output; /** * Labels to assign to this rule. */ readonly labels: pulumi.Output<{ [key: string]: string; }>; /** * Port number (if applied to a single port). */ readonly port: pulumi.Output; /** * Special-purpose targets such as "selfSecurityGroup". [See docs](https://cloud.yandex.com/docs/vpc/concepts/security-groups) for possible options. */ readonly predefinedTarget: pulumi.Output; /** * One of `ANY`, `TCP`, `UDP`, `ICMP`, `IPV6_ICMP`. */ readonly protocol: pulumi.Output; /** * ID of the security group this rule belongs to. */ readonly securityGroupBinding: pulumi.Output; /** * Target security group ID for this rule. */ readonly securityGroupId: pulumi.Output; /** * Maximum port number. */ readonly toPort: pulumi.Output; /** * The blocks of IPv4 addresses for this rule. */ readonly v4CidrBlocks: pulumi.Output; /** * The blocks of IPv6 addresses for this rule. `v6CidrBlocks` argument is currently not supported. It will be available in the future. */ readonly v6CidrBlocks: pulumi.Output; /** * Create a VpcSecurityGroupRule 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: VpcSecurityGroupRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering VpcSecurityGroupRule resources. */ export interface VpcSecurityGroupRuleState { /** * Description of the rule. */ description?: pulumi.Input; /** * direction of the rule. Can be `ingress` (inbound) or `egress` (outbound). */ direction?: pulumi.Input; /** * Minimum port number. */ fromPort?: pulumi.Input; /** * Labels to assign to this rule. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Port number (if applied to a single port). */ port?: pulumi.Input; /** * Special-purpose targets such as "selfSecurityGroup". [See docs](https://cloud.yandex.com/docs/vpc/concepts/security-groups) for possible options. */ predefinedTarget?: pulumi.Input; /** * One of `ANY`, `TCP`, `UDP`, `ICMP`, `IPV6_ICMP`. */ protocol?: pulumi.Input; /** * ID of the security group this rule belongs to. */ securityGroupBinding?: pulumi.Input; /** * Target security group ID for this rule. */ securityGroupId?: pulumi.Input; /** * Maximum port number. */ toPort?: pulumi.Input; /** * The blocks of IPv4 addresses for this rule. */ v4CidrBlocks?: pulumi.Input[]>; /** * The blocks of IPv6 addresses for this rule. `v6CidrBlocks` argument is currently not supported. It will be available in the future. */ v6CidrBlocks?: pulumi.Input[]>; } /** * The set of arguments for constructing a VpcSecurityGroupRule resource. */ export interface VpcSecurityGroupRuleArgs { /** * Description of the rule. */ description?: pulumi.Input; /** * direction of the rule. Can be `ingress` (inbound) or `egress` (outbound). */ direction: pulumi.Input; /** * Minimum port number. */ fromPort?: pulumi.Input; /** * Labels to assign to this rule. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Port number (if applied to a single port). */ port?: pulumi.Input; /** * Special-purpose targets such as "selfSecurityGroup". [See docs](https://cloud.yandex.com/docs/vpc/concepts/security-groups) for possible options. */ predefinedTarget?: pulumi.Input; /** * One of `ANY`, `TCP`, `UDP`, `ICMP`, `IPV6_ICMP`. */ protocol?: pulumi.Input; /** * ID of the security group this rule belongs to. */ securityGroupBinding: pulumi.Input; /** * Target security group ID for this rule. */ securityGroupId?: pulumi.Input; /** * Maximum port number. */ toPort?: pulumi.Input; /** * The blocks of IPv4 addresses for this rule. */ v4CidrBlocks?: pulumi.Input[]>; /** * The blocks of IPv6 addresses for this rule. `v6CidrBlocks` argument is currently not supported. It will be available in the future. */ v6CidrBlocks?: pulumi.Input[]>; }