Yandex

v0.10.0 published on Thursday, Nov 18, 2021 by Pulumi

getVpcSecurityGroup

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)
}

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.
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.

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 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.

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 such as “self_security_group”. See docs for possible options.
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 such as “self_security_group”. See docs for possible options.
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 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 such as “self_security_group”. See docs for possible options.
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 such as “self_security_group”. See docs for possible options.
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.

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 such as “self_security_group”. See docs for possible options.
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 such as “self_security_group”. See docs for possible options.
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 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 such as “self_security_group”. See docs for possible options.
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 such as “self_security_group”. See docs for possible options.
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.

Package Details

Repository
https://github.com/pulumi/pulumi-yandex
License
Apache-2.0
Notes
This Pulumi package is based on the yandex Terraform Provider.