1. Packages
  2. Yandex
  3. API Docs
  4. getVpcSecurityGroup
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

yandex.getVpcSecurityGroup

Explore with Pulumi AI

yandex logo
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

    Get information about a Yandex VPC Security Group. For more information, see Yandex.Cloud VPC.

    import * as pulumi from "@pulumi/pulumi";
    import * as yandex from "@pulumi/yandex";
    
    const group1 = pulumi.output(yandex.getVpcSecurityGroup({
        securityGroupId: "my-id",
    }));
    
    import pulumi
    import pulumi_yandex as yandex
    
    group1 = yandex.get_vpc_security_group(security_group_id="my-id")
    
    using Pulumi;
    using Yandex = Pulumi.Yandex;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var group1 = Output.Create(Yandex.GetVpcSecurityGroup.InvokeAsync(new Yandex.GetVpcSecurityGroupArgs
            {
                SecurityGroupId = "my-id",
            }));
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		opt0 := "my-id"
    		_, err := yandex.LookupVpcSecurityGroup(ctx, &GetVpcSecurityGroupArgs{
    			SecurityGroupId: &opt0,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as yandex from "@pulumi/yandex";
    
    const group1 = pulumi.output(yandex.getVpcSecurityGroup({
        name: "my-group1",
    }));
    
    import pulumi
    import pulumi_yandex as yandex
    
    group1 = yandex.get_vpc_security_group(name="my-group1")
    
    using Pulumi;
    using Yandex = Pulumi.Yandex;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var group1 = Output.Create(Yandex.GetVpcSecurityGroup.InvokeAsync(new Yandex.GetVpcSecurityGroupArgs
            {
                Name = "my-group1",
            }));
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		opt0 := "my-group1"
    		_, err := yandex.LookupVpcSecurityGroup(ctx, &GetVpcSecurityGroupArgs{
    			Name: &opt0,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    This data source is used to define Security Group that can be used by other resources.

    Using getVpcSecurityGroup

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getVpcSecurityGroup(args: GetVpcSecurityGroupArgs, opts?: InvokeOptions): Promise<GetVpcSecurityGroupResult>
    function getVpcSecurityGroupOutput(args: GetVpcSecurityGroupOutputArgs, opts?: InvokeOptions): Output<GetVpcSecurityGroupResult>
    def get_vpc_security_group(folder_id: Optional[str] = None,
                               name: Optional[str] = None,
                               security_group_id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetVpcSecurityGroupResult
    def get_vpc_security_group_output(folder_id: Optional[pulumi.Input[str]] = None,
                               name: Optional[pulumi.Input[str]] = None,
                               security_group_id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetVpcSecurityGroupResult]
    func LookupVpcSecurityGroup(ctx *Context, args *LookupVpcSecurityGroupArgs, opts ...InvokeOption) (*LookupVpcSecurityGroupResult, error)
    func LookupVpcSecurityGroupOutput(ctx *Context, args *LookupVpcSecurityGroupOutputArgs, opts ...InvokeOption) LookupVpcSecurityGroupResultOutput

    > Note: This function is named LookupVpcSecurityGroup in the Go SDK.

    public static class GetVpcSecurityGroup 
    {
        public static Task<GetVpcSecurityGroupResult> InvokeAsync(GetVpcSecurityGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcSecurityGroupResult> Invoke(GetVpcSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpcSecurityGroupResult> getVpcSecurityGroup(GetVpcSecurityGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: yandex:index/getVpcSecurityGroup:getVpcSecurityGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    FolderId string
    Folder that the resource belongs to. If value is omitted, the default provider folder is used.
    Name string
    • Name of the security group.
    SecurityGroupId string
    Security Group ID.
    FolderId string
    Folder that the resource belongs to. If value is omitted, the default provider folder is used.
    Name string
    • Name of the security group.
    SecurityGroupId string
    Security Group ID.
    folderId String
    Folder that the resource belongs to. If value is omitted, the default provider folder is used.
    name String
    • Name of the security group.
    securityGroupId String
    Security Group ID.
    folderId string
    Folder that the resource belongs to. If value is omitted, the default provider folder is used.
    name string
    • Name of the security group.
    securityGroupId string
    Security Group ID.
    folder_id str
    Folder that the resource belongs to. If value is omitted, the default provider folder is used.
    name str
    • Name of the security group.
    security_group_id str
    Security Group ID.
    folderId String
    Folder that the resource belongs to. If value is omitted, the default provider folder is used.
    name String
    • Name of the security group.
    securityGroupId String
    Security Group ID.

    getVpcSecurityGroup Result

    The following output properties are available:

    CreatedAt string
    Creation timestamp of this security group.
    Description string
    Description of the rule.
    Egresses List<GetVpcSecurityGroupEgress>
    A list of egress rules. The structure is documented below.
    FolderId string
    ID of the folder this security group belongs to.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ingresses List<GetVpcSecurityGroupIngress>
    A list of ingress rules. The structure is documented below.
    Labels Dictionary<string, string>
    Labels to assign to this rule.
    Name string
    Name of the security group.
    NetworkId string
    ID of the network this security group belongs to.
    SecurityGroupId string
    Target security group ID for this rule.
    Status string
    Status of this security group.
    CreatedAt string
    Creation timestamp of this security group.
    Description string
    Description of the rule.
    Egresses []GetVpcSecurityGroupEgress
    A list of egress rules. The structure is documented below.
    FolderId string
    ID of the folder this security group belongs to.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ingresses []GetVpcSecurityGroupIngress
    A list of ingress rules. The structure is documented below.
    Labels map[string]string
    Labels to assign to this rule.
    Name string
    Name of the security group.
    NetworkId string
    ID of the network this security group belongs to.
    SecurityGroupId string
    Target security group ID for this rule.
    Status string
    Status of this security group.
    createdAt String
    Creation timestamp of this security group.
    description String
    Description of the rule.
    egresses List<GetVpcSecurityGroupEgress>
    A list of egress rules. The structure is documented below.
    folderId String
    ID of the folder this security group belongs to.
    id String
    The provider-assigned unique ID for this managed resource.
    ingresses List<GetVpcSecurityGroupIngress>
    A list of ingress rules. The structure is documented below.
    labels Map<String,String>
    Labels to assign to this rule.
    name String
    Name of the security group.
    networkId String
    ID of the network this security group belongs to.
    securityGroupId String
    Target security group ID for this rule.
    status String
    Status of this security group.
    createdAt string
    Creation timestamp of this security group.
    description string
    Description of the rule.
    egresses GetVpcSecurityGroupEgress[]
    A list of egress rules. The structure is documented below.
    folderId string
    ID of the folder this security group belongs to.
    id string
    The provider-assigned unique ID for this managed resource.
    ingresses GetVpcSecurityGroupIngress[]
    A list of ingress rules. The structure is documented below.
    labels {[key: string]: string}
    Labels to assign to this rule.
    name string
    Name of the security group.
    networkId string
    ID of the network this security group belongs to.
    securityGroupId string
    Target security group ID for this rule.
    status string
    Status of this security group.
    created_at str
    Creation timestamp of this security group.
    description str
    Description of the rule.
    egresses Sequence[GetVpcSecurityGroupEgress]
    A list of egress rules. The structure is documented below.
    folder_id str
    ID of the folder this security group belongs to.
    id str
    The provider-assigned unique ID for this managed resource.
    ingresses Sequence[GetVpcSecurityGroupIngress]
    A list of ingress rules. The structure is documented below.
    labels Mapping[str, str]
    Labels to assign to this rule.
    name str
    Name of the security group.
    network_id str
    ID of the network this security group belongs to.
    security_group_id str
    Target security group ID for this rule.
    status str
    Status of this security group.
    createdAt String
    Creation timestamp of this security group.
    description String
    Description of the rule.
    egresses List<Property Map>
    A list of egress rules. The structure is documented below.
    folderId String
    ID of the folder this security group belongs to.
    id String
    The provider-assigned unique ID for this managed resource.
    ingresses List<Property Map>
    A list of ingress rules. The structure is documented below.
    labels Map<String>
    Labels to assign to this rule.
    name String
    Name of the security group.
    networkId String
    ID of the network this security group belongs to.
    securityGroupId String
    Target security group ID for this rule.
    status String
    Status of this security group.

    Supporting Types

    GetVpcSecurityGroupEgress

    Description string
    Description of the rule.
    FromPort int
    Minimum port number.
    Id string
    Id of the rule.
    Labels Dictionary<string, string>
    Labels to assign to this rule.
    Port int
    Port number (if applied to a single port).
    PredefinedTarget string
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    Protocol string
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    SecurityGroupId string
    Security Group ID.
    ToPort int
    Maximum port number.
    V4CidrBlocks List<string>
    The blocks of IPv4 addresses for this rule.
    V6CidrBlocks List<string>
    The blocks of IPv6 addresses for this rule.
    Description string
    Description of the rule.
    FromPort int
    Minimum port number.
    Id string
    Id of the rule.
    Labels map[string]string
    Labels to assign to this rule.
    Port int
    Port number (if applied to a single port).
    PredefinedTarget string
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    Protocol string
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    SecurityGroupId string
    Security Group ID.
    ToPort int
    Maximum port number.
    V4CidrBlocks []string
    The blocks of IPv4 addresses for this rule.
    V6CidrBlocks []string
    The blocks of IPv6 addresses for this rule.
    description String
    Description of the rule.
    fromPort Integer
    Minimum port number.
    id String
    Id of the rule.
    labels Map<String,String>
    Labels to assign to this rule.
    port Integer
    Port number (if applied to a single port).
    predefinedTarget String
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    protocol String
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    securityGroupId String
    Security Group ID.
    toPort Integer
    Maximum port number.
    v4CidrBlocks List<String>
    The blocks of IPv4 addresses for this rule.
    v6CidrBlocks List<String>
    The blocks of IPv6 addresses for this rule.
    description string
    Description of the rule.
    fromPort number
    Minimum port number.
    id string
    Id of the rule.
    labels {[key: string]: string}
    Labels to assign to this rule.
    port number
    Port number (if applied to a single port).
    predefinedTarget string
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    protocol string
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    securityGroupId string
    Security Group ID.
    toPort number
    Maximum port number.
    v4CidrBlocks string[]
    The blocks of IPv4 addresses for this rule.
    v6CidrBlocks string[]
    The blocks of IPv6 addresses for this rule.
    description str
    Description of the rule.
    from_port int
    Minimum port number.
    id str
    Id of the rule.
    labels Mapping[str, str]
    Labels to assign to this rule.
    port int
    Port number (if applied to a single port).
    predefined_target str
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    protocol str
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    security_group_id str
    Security Group ID.
    to_port int
    Maximum port number.
    v4_cidr_blocks Sequence[str]
    The blocks of IPv4 addresses for this rule.
    v6_cidr_blocks Sequence[str]
    The blocks of IPv6 addresses for this rule.
    description String
    Description of the rule.
    fromPort Number
    Minimum port number.
    id String
    Id of the rule.
    labels Map<String>
    Labels to assign to this rule.
    port Number
    Port number (if applied to a single port).
    predefinedTarget String
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    protocol String
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    securityGroupId String
    Security Group ID.
    toPort Number
    Maximum port number.
    v4CidrBlocks List<String>
    The blocks of IPv4 addresses for this rule.
    v6CidrBlocks List<String>
    The blocks of IPv6 addresses for this rule.

    GetVpcSecurityGroupIngress

    Description string
    Description of the rule.
    FromPort int
    Minimum port number.
    Id string
    Id of the rule.
    Labels Dictionary<string, string>
    Labels to assign to this rule.
    Port int
    Port number (if applied to a single port).
    PredefinedTarget string
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    Protocol string
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    SecurityGroupId string
    Security Group ID.
    ToPort int
    Maximum port number.
    V4CidrBlocks List<string>
    The blocks of IPv4 addresses for this rule.
    V6CidrBlocks List<string>
    The blocks of IPv6 addresses for this rule.
    Description string
    Description of the rule.
    FromPort int
    Minimum port number.
    Id string
    Id of the rule.
    Labels map[string]string
    Labels to assign to this rule.
    Port int
    Port number (if applied to a single port).
    PredefinedTarget string
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    Protocol string
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    SecurityGroupId string
    Security Group ID.
    ToPort int
    Maximum port number.
    V4CidrBlocks []string
    The blocks of IPv4 addresses for this rule.
    V6CidrBlocks []string
    The blocks of IPv6 addresses for this rule.
    description String
    Description of the rule.
    fromPort Integer
    Minimum port number.
    id String
    Id of the rule.
    labels Map<String,String>
    Labels to assign to this rule.
    port Integer
    Port number (if applied to a single port).
    predefinedTarget String
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    protocol String
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    securityGroupId String
    Security Group ID.
    toPort Integer
    Maximum port number.
    v4CidrBlocks List<String>
    The blocks of IPv4 addresses for this rule.
    v6CidrBlocks List<String>
    The blocks of IPv6 addresses for this rule.
    description string
    Description of the rule.
    fromPort number
    Minimum port number.
    id string
    Id of the rule.
    labels {[key: string]: string}
    Labels to assign to this rule.
    port number
    Port number (if applied to a single port).
    predefinedTarget string
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    protocol string
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    securityGroupId string
    Security Group ID.
    toPort number
    Maximum port number.
    v4CidrBlocks string[]
    The blocks of IPv4 addresses for this rule.
    v6CidrBlocks string[]
    The blocks of IPv6 addresses for this rule.
    description str
    Description of the rule.
    from_port int
    Minimum port number.
    id str
    Id of the rule.
    labels Mapping[str, str]
    Labels to assign to this rule.
    port int
    Port number (if applied to a single port).
    predefined_target str
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    protocol str
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    security_group_id str
    Security Group ID.
    to_port int
    Maximum port number.
    v4_cidr_blocks Sequence[str]
    The blocks of IPv4 addresses for this rule.
    v6_cidr_blocks Sequence[str]
    The blocks of IPv6 addresses for this rule.
    description String
    Description of the rule.
    fromPort Number
    Minimum port number.
    id String
    Id of the rule.
    labels Map<String>
    Labels to assign to this rule.
    port Number
    Port number (if applied to a single port).
    predefinedTarget String
    Special-purpose targets. self_security_group refers to this particular security group. loadbalancer_healthchecks represents loadbalancer health check nodes.
    protocol String
    One of ANY, TCP, UDP, ICMP, IPV6_ICMP.
    securityGroupId String
    Security Group ID.
    toPort Number
    Maximum port number.
    v4CidrBlocks List<String>
    The blocks of IPv4 addresses for this rule.
    v6CidrBlocks List<String>
    The blocks of IPv6 addresses for this rule.

    Package Details

    Repository
    Yandex pulumi/pulumi-yandex
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the yandex Terraform Provider.
    yandex logo
    Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi