1. Packages
  2. Gcore Provider
  3. API Docs
  4. getCloudSecurityGroup
Viewing docs for gcore 2.0.0-alpha.3
published on Monday, Mar 30, 2026 by g-core
Viewing docs for gcore 2.0.0-alpha.3
published on Monday, Mar 30, 2026 by g-core

    Security groups act as virtual firewalls controlling inbound and outbound traffic for instances and other resources.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const exampleCloudSecurityGroup = gcore.getCloudSecurityGroup({
        projectId: 1,
        regionId: 1,
        groupId: "024a29e9-b4b7-4c91-9a46-505be123d9f8",
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    example_cloud_security_group = gcore.get_cloud_security_group(project_id=1,
        region_id=1,
        group_id="024a29e9-b4b7-4c91-9a46-505be123d9f8")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/v2/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcore.LookupCloudSecurityGroup(ctx, &gcore.LookupCloudSecurityGroupArgs{
    			ProjectId: pulumi.Float64Ref(1),
    			RegionId:  pulumi.Float64Ref(1),
    			GroupId:   pulumi.StringRef("024a29e9-b4b7-4c91-9a46-505be123d9f8"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleCloudSecurityGroup = Gcore.GetCloudSecurityGroup.Invoke(new()
        {
            ProjectId = 1,
            RegionId = 1,
            GroupId = "024a29e9-b4b7-4c91-9a46-505be123d9f8",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.GcoreFunctions;
    import com.pulumi.gcore.inputs.GetCloudSecurityGroupArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var exampleCloudSecurityGroup = GcoreFunctions.getCloudSecurityGroup(GetCloudSecurityGroupArgs.builder()
                .projectId(1)
                .regionId(1)
                .groupId("024a29e9-b4b7-4c91-9a46-505be123d9f8")
                .build());
    
        }
    }
    
    variables:
      exampleCloudSecurityGroup:
        fn::invoke:
          function: gcore:getCloudSecurityGroup
          arguments:
            projectId: 1
            regionId: 1
            groupId: 024a29e9-b4b7-4c91-9a46-505be123d9f8
    

    Using getCloudSecurityGroup

    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 getCloudSecurityGroup(args: GetCloudSecurityGroupArgs, opts?: InvokeOptions): Promise<GetCloudSecurityGroupResult>
    function getCloudSecurityGroupOutput(args: GetCloudSecurityGroupOutputArgs, opts?: InvokeOptions): Output<GetCloudSecurityGroupResult>
    def get_cloud_security_group(find_one_by: Optional[GetCloudSecurityGroupFindOneBy] = None,
                                 group_id: Optional[str] = None,
                                 project_id: Optional[float] = None,
                                 region_id: Optional[float] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetCloudSecurityGroupResult
    def get_cloud_security_group_output(find_one_by: Optional[pulumi.Input[GetCloudSecurityGroupFindOneByArgs]] = None,
                                 group_id: Optional[pulumi.Input[str]] = None,
                                 project_id: Optional[pulumi.Input[float]] = None,
                                 region_id: Optional[pulumi.Input[float]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetCloudSecurityGroupResult]
    func LookupCloudSecurityGroup(ctx *Context, args *LookupCloudSecurityGroupArgs, opts ...InvokeOption) (*LookupCloudSecurityGroupResult, error)
    func LookupCloudSecurityGroupOutput(ctx *Context, args *LookupCloudSecurityGroupOutputArgs, opts ...InvokeOption) LookupCloudSecurityGroupResultOutput

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

    public static class GetCloudSecurityGroup 
    {
        public static Task<GetCloudSecurityGroupResult> InvokeAsync(GetCloudSecurityGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetCloudSecurityGroupResult> Invoke(GetCloudSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCloudSecurityGroupResult> getCloudSecurityGroup(GetCloudSecurityGroupArgs args, InvokeOptions options)
    public static Output<GetCloudSecurityGroupResult> getCloudSecurityGroup(GetCloudSecurityGroupArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcore:index/getCloudSecurityGroup:getCloudSecurityGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    FindOneBy GetCloudSecurityGroupFindOneBy
    GroupId string
    Group ID
    ProjectId double
    Project ID
    RegionId double
    Region ID
    FindOneBy GetCloudSecurityGroupFindOneBy
    GroupId string
    Group ID
    ProjectId float64
    Project ID
    RegionId float64
    Region ID
    findOneBy GetCloudSecurityGroupFindOneBy
    groupId String
    Group ID
    projectId Double
    Project ID
    regionId Double
    Region ID
    findOneBy GetCloudSecurityGroupFindOneBy
    groupId string
    Group ID
    projectId number
    Project ID
    regionId number
    Region ID
    findOneBy Property Map
    groupId String
    Group ID
    projectId Number
    Project ID
    regionId Number
    Region ID

    getCloudSecurityGroup Result

    The following output properties are available:

    CreatedAt string
    Datetime when the security group was created
    Description string
    Security group description
    Id string
    Group ID
    Name string
    Security group name
    Region string
    Region name
    RevisionNumber double
    The number of revisions
    SecurityGroupRules List<GetCloudSecurityGroupSecurityGroupRule>
    Security group rules
    TagsV2s List<GetCloudSecurityGroupTagsV2>
    List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
    UpdatedAt string
    Datetime when the security group was last updated
    FindOneBy GetCloudSecurityGroupFindOneBy
    GroupId string
    Group ID
    ProjectId double
    Project ID
    RegionId double
    Region ID
    CreatedAt string
    Datetime when the security group was created
    Description string
    Security group description
    Id string
    Group ID
    Name string
    Security group name
    Region string
    Region name
    RevisionNumber float64
    The number of revisions
    SecurityGroupRules []GetCloudSecurityGroupSecurityGroupRule
    Security group rules
    TagsV2s []GetCloudSecurityGroupTagsV2
    List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
    UpdatedAt string
    Datetime when the security group was last updated
    FindOneBy GetCloudSecurityGroupFindOneBy
    GroupId string
    Group ID
    ProjectId float64
    Project ID
    RegionId float64
    Region ID
    createdAt String
    Datetime when the security group was created
    description String
    Security group description
    id String
    Group ID
    name String
    Security group name
    region String
    Region name
    revisionNumber Double
    The number of revisions
    securityGroupRules List<GetCloudSecurityGroupSecurityGroupRule>
    Security group rules
    tagsV2s List<GetCloudSecurityGroupTagsV2>
    List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
    updatedAt String
    Datetime when the security group was last updated
    findOneBy GetCloudSecurityGroupFindOneBy
    groupId String
    Group ID
    projectId Double
    Project ID
    regionId Double
    Region ID
    createdAt string
    Datetime when the security group was created
    description string
    Security group description
    id string
    Group ID
    name string
    Security group name
    region string
    Region name
    revisionNumber number
    The number of revisions
    securityGroupRules GetCloudSecurityGroupSecurityGroupRule[]
    Security group rules
    tagsV2s GetCloudSecurityGroupTagsV2[]
    List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
    updatedAt string
    Datetime when the security group was last updated
    findOneBy GetCloudSecurityGroupFindOneBy
    groupId string
    Group ID
    projectId number
    Project ID
    regionId number
    Region ID
    created_at str
    Datetime when the security group was created
    description str
    Security group description
    id str
    Group ID
    name str
    Security group name
    region str
    Region name
    revision_number float
    The number of revisions
    security_group_rules Sequence[GetCloudSecurityGroupSecurityGroupRule]
    Security group rules
    tags_v2s Sequence[GetCloudSecurityGroupTagsV2]
    List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
    updated_at str
    Datetime when the security group was last updated
    find_one_by GetCloudSecurityGroupFindOneBy
    group_id str
    Group ID
    project_id float
    Project ID
    region_id float
    Region ID
    createdAt String
    Datetime when the security group was created
    description String
    Security group description
    id String
    Group ID
    name String
    Security group name
    region String
    Region name
    revisionNumber Number
    The number of revisions
    securityGroupRules List<Property Map>
    Security group rules
    tagsV2s List<Property Map>
    List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
    updatedAt String
    Datetime when the security group was last updated
    findOneBy Property Map
    groupId String
    Group ID
    projectId Number
    Project ID
    regionId Number
    Region ID

    Supporting Types

    GetCloudSecurityGroupFindOneBy

    Name string
    Optional. Filter by name. Must be specified a full name of the security group.
    TagKeyValue string
    Optional. Filter by tag key-value pairs.
    TagKeys List<string>
    Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
    Name string
    Optional. Filter by name. Must be specified a full name of the security group.
    TagKeyValue string
    Optional. Filter by tag key-value pairs.
    TagKeys []string
    Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
    name String
    Optional. Filter by name. Must be specified a full name of the security group.
    tagKeyValue String
    Optional. Filter by tag key-value pairs.
    tagKeys List<String>
    Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
    name string
    Optional. Filter by name. Must be specified a full name of the security group.
    tagKeyValue string
    Optional. Filter by tag key-value pairs.
    tagKeys string[]
    Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
    name str
    Optional. Filter by name. Must be specified a full name of the security group.
    tag_key_value str
    Optional. Filter by tag key-value pairs.
    tag_keys Sequence[str]
    Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
    name String
    Optional. Filter by name. Must be specified a full name of the security group.
    tagKeyValue String
    Optional. Filter by tag key-value pairs.
    tagKeys List<String>
    Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2

    GetCloudSecurityGroupSecurityGroupRule

    CreatedAt string
    Datetime when the rule was created
    Description string
    Rule description
    Direction string
    Ingress or egress, which is the direction in which the security group rule is applied Available values: "egress", "ingress".
    Ethertype string
    Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules. Available values: "IPv4", "IPv6".
    Id string
    The ID of the security group rule
    PortRangeMax double
    The maximum port number in the range that is matched by the security group rule
    PortRangeMin double
    The minimum port number in the range that is matched by the security group rule
    Protocol string
    Protocol Available values: "ah", "any", "dccp", "egp", "esp", "gre", "icmp", "igmp", "ipencap", "ipip", "ipv6-encap", "ipv6-frag", "ipv6-icmp", "ipv6-nonxt", "ipv6-opts", "ipv6-route", "ospf", "pgm", "rsvp", "sctp", "tcp", "udp", "udplite", "vrrp".
    RemoteGroupId string
    The remote group UUID to associate with this security group rule
    RemoteIpPrefix string
    The remote IP prefix that is matched by this security group rule
    RevisionNumber double
    The revision number of the resource
    SecurityGroupId string
    The security group ID to associate with this security group rule
    UpdatedAt string
    Datetime when the rule was last updated
    CreatedAt string
    Datetime when the rule was created
    Description string
    Rule description
    Direction string
    Ingress or egress, which is the direction in which the security group rule is applied Available values: "egress", "ingress".
    Ethertype string
    Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules. Available values: "IPv4", "IPv6".
    Id string
    The ID of the security group rule
    PortRangeMax float64
    The maximum port number in the range that is matched by the security group rule
    PortRangeMin float64
    The minimum port number in the range that is matched by the security group rule
    Protocol string
    Protocol Available values: "ah", "any", "dccp", "egp", "esp", "gre", "icmp", "igmp", "ipencap", "ipip", "ipv6-encap", "ipv6-frag", "ipv6-icmp", "ipv6-nonxt", "ipv6-opts", "ipv6-route", "ospf", "pgm", "rsvp", "sctp", "tcp", "udp", "udplite", "vrrp".
    RemoteGroupId string
    The remote group UUID to associate with this security group rule
    RemoteIpPrefix string
    The remote IP prefix that is matched by this security group rule
    RevisionNumber float64
    The revision number of the resource
    SecurityGroupId string
    The security group ID to associate with this security group rule
    UpdatedAt string
    Datetime when the rule was last updated
    createdAt String
    Datetime when the rule was created
    description String
    Rule description
    direction String
    Ingress or egress, which is the direction in which the security group rule is applied Available values: "egress", "ingress".
    ethertype String
    Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules. Available values: "IPv4", "IPv6".
    id String
    The ID of the security group rule
    portRangeMax Double
    The maximum port number in the range that is matched by the security group rule
    portRangeMin Double
    The minimum port number in the range that is matched by the security group rule
    protocol String
    Protocol Available values: "ah", "any", "dccp", "egp", "esp", "gre", "icmp", "igmp", "ipencap", "ipip", "ipv6-encap", "ipv6-frag", "ipv6-icmp", "ipv6-nonxt", "ipv6-opts", "ipv6-route", "ospf", "pgm", "rsvp", "sctp", "tcp", "udp", "udplite", "vrrp".
    remoteGroupId String
    The remote group UUID to associate with this security group rule
    remoteIpPrefix String
    The remote IP prefix that is matched by this security group rule
    revisionNumber Double
    The revision number of the resource
    securityGroupId String
    The security group ID to associate with this security group rule
    updatedAt String
    Datetime when the rule was last updated
    createdAt string
    Datetime when the rule was created
    description string
    Rule description
    direction string
    Ingress or egress, which is the direction in which the security group rule is applied Available values: "egress", "ingress".
    ethertype string
    Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules. Available values: "IPv4", "IPv6".
    id string
    The ID of the security group rule
    portRangeMax number
    The maximum port number in the range that is matched by the security group rule
    portRangeMin number
    The minimum port number in the range that is matched by the security group rule
    protocol string
    Protocol Available values: "ah", "any", "dccp", "egp", "esp", "gre", "icmp", "igmp", "ipencap", "ipip", "ipv6-encap", "ipv6-frag", "ipv6-icmp", "ipv6-nonxt", "ipv6-opts", "ipv6-route", "ospf", "pgm", "rsvp", "sctp", "tcp", "udp", "udplite", "vrrp".
    remoteGroupId string
    The remote group UUID to associate with this security group rule
    remoteIpPrefix string
    The remote IP prefix that is matched by this security group rule
    revisionNumber number
    The revision number of the resource
    securityGroupId string
    The security group ID to associate with this security group rule
    updatedAt string
    Datetime when the rule was last updated
    created_at str
    Datetime when the rule was created
    description str
    Rule description
    direction str
    Ingress or egress, which is the direction in which the security group rule is applied Available values: "egress", "ingress".
    ethertype str
    Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules. Available values: "IPv4", "IPv6".
    id str
    The ID of the security group rule
    port_range_max float
    The maximum port number in the range that is matched by the security group rule
    port_range_min float
    The minimum port number in the range that is matched by the security group rule
    protocol str
    Protocol Available values: "ah", "any", "dccp", "egp", "esp", "gre", "icmp", "igmp", "ipencap", "ipip", "ipv6-encap", "ipv6-frag", "ipv6-icmp", "ipv6-nonxt", "ipv6-opts", "ipv6-route", "ospf", "pgm", "rsvp", "sctp", "tcp", "udp", "udplite", "vrrp".
    remote_group_id str
    The remote group UUID to associate with this security group rule
    remote_ip_prefix str
    The remote IP prefix that is matched by this security group rule
    revision_number float
    The revision number of the resource
    security_group_id str
    The security group ID to associate with this security group rule
    updated_at str
    Datetime when the rule was last updated
    createdAt String
    Datetime when the rule was created
    description String
    Rule description
    direction String
    Ingress or egress, which is the direction in which the security group rule is applied Available values: "egress", "ingress".
    ethertype String
    Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules. Available values: "IPv4", "IPv6".
    id String
    The ID of the security group rule
    portRangeMax Number
    The maximum port number in the range that is matched by the security group rule
    portRangeMin Number
    The minimum port number in the range that is matched by the security group rule
    protocol String
    Protocol Available values: "ah", "any", "dccp", "egp", "esp", "gre", "icmp", "igmp", "ipencap", "ipip", "ipv6-encap", "ipv6-frag", "ipv6-icmp", "ipv6-nonxt", "ipv6-opts", "ipv6-route", "ospf", "pgm", "rsvp", "sctp", "tcp", "udp", "udplite", "vrrp".
    remoteGroupId String
    The remote group UUID to associate with this security group rule
    remoteIpPrefix String
    The remote IP prefix that is matched by this security group rule
    revisionNumber Number
    The revision number of the resource
    securityGroupId String
    The security group ID to associate with this security group rule
    updatedAt String
    Datetime when the rule was last updated

    GetCloudSecurityGroupTagsV2

    Key string
    Tag key. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    ReadOnly bool
    If true, the tag is read-only and cannot be modified by the user
    Value string
    Tag value. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    Key string
    Tag key. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    ReadOnly bool
    If true, the tag is read-only and cannot be modified by the user
    Value string
    Tag value. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    key String
    Tag key. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    readOnly Boolean
    If true, the tag is read-only and cannot be modified by the user
    value String
    Tag value. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    key string
    Tag key. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    readOnly boolean
    If true, the tag is read-only and cannot be modified by the user
    value string
    Tag value. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    key str
    Tag key. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    read_only bool
    If true, the tag is read-only and cannot be modified by the user
    value str
    Tag value. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    key String
    Tag key. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.
    readOnly Boolean
    If true, the tag is read-only and cannot be modified by the user
    value String
    Tag value. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    Viewing docs for gcore 2.0.0-alpha.3
    published on Monday, Mar 30, 2026 by g-core
      Try Pulumi Cloud free. Your team will thank you.