1. Packages
  2. Outscale Provider
  3. API Docs
  4. getSecurityGroups
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

outscale.getSecurityGroups

Explore with Pulumi AI

Provides information about security groups.

For more information on this resource, see the User Guide.
For more information on this resource actions, see the API documentation.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const securityGroups01 = outscale.getSecurityGroups({
    filters: [
        {
            name: "net_ids",
            values: [
                "sg-12345678",
                "sg-87654321",
            ],
        },
        {
            name: "inbound_rule_ip_ranges",
            values: ["111.11.111.1/32"],
        },
    ],
});
Copy
import pulumi
import pulumi_outscale as outscale

security_groups01 = outscale.get_security_groups(filters=[
    {
        "name": "net_ids",
        "values": [
            "sg-12345678",
            "sg-87654321",
        ],
    },
    {
        "name": "inbound_rule_ip_ranges",
        "values": ["111.11.111.1/32"],
    },
])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.GetSecurityGroups(ctx, &outscale.GetSecurityGroupsArgs{
			Filters: []outscale.GetSecurityGroupsFilter{
				{
					Name: "net_ids",
					Values: []string{
						"sg-12345678",
						"sg-87654321",
					},
				},
				{
					Name: "inbound_rule_ip_ranges",
					Values: []string{
						"111.11.111.1/32",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var securityGroups01 = Outscale.GetSecurityGroups.Invoke(new()
    {
        Filters = new[]
        {
            new Outscale.Inputs.GetSecurityGroupsFilterInputArgs
            {
                Name = "net_ids",
                Values = new[]
                {
                    "sg-12345678",
                    "sg-87654321",
                },
            },
            new Outscale.Inputs.GetSecurityGroupsFilterInputArgs
            {
                Name = "inbound_rule_ip_ranges",
                Values = new[]
                {
                    "111.11.111.1/32",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.OutscaleFunctions;
import com.pulumi.outscale.inputs.GetSecurityGroupsArgs;
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 securityGroups01 = OutscaleFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
            .filters(            
                GetSecurityGroupsFilterArgs.builder()
                    .name("net_ids")
                    .values(                    
                        "sg-12345678",
                        "sg-87654321")
                    .build(),
                GetSecurityGroupsFilterArgs.builder()
                    .name("inbound_rule_ip_ranges")
                    .values("111.11.111.1/32")
                    .build())
            .build());

    }
}
Copy
variables:
  securityGroups01:
    fn::invoke:
      function: outscale:getSecurityGroups
      arguments:
        filters:
          - name: net_ids
            values:
              - sg-12345678
              - sg-87654321
          - name: inbound_rule_ip_ranges
            values:
              - 111.11.111.1/32
Copy

Using getSecurityGroups

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 getSecurityGroups(args: GetSecurityGroupsArgs, opts?: InvokeOptions): Promise<GetSecurityGroupsResult>
function getSecurityGroupsOutput(args: GetSecurityGroupsOutputArgs, opts?: InvokeOptions): Output<GetSecurityGroupsResult>
Copy
def get_security_groups(filters: Optional[Sequence[GetSecurityGroupsFilter]] = None,
                        id: Optional[str] = None,
                        security_group_ids: Optional[Sequence[str]] = None,
                        security_group_names: Optional[Sequence[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> GetSecurityGroupsResult
def get_security_groups_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSecurityGroupsFilterArgs]]]] = None,
                        id: Optional[pulumi.Input[str]] = None,
                        security_group_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                        security_group_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetSecurityGroupsResult]
Copy
func GetSecurityGroups(ctx *Context, args *GetSecurityGroupsArgs, opts ...InvokeOption) (*GetSecurityGroupsResult, error)
func GetSecurityGroupsOutput(ctx *Context, args *GetSecurityGroupsOutputArgs, opts ...InvokeOption) GetSecurityGroupsResultOutput
Copy

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

public static class GetSecurityGroups 
{
    public static Task<GetSecurityGroupsResult> InvokeAsync(GetSecurityGroupsArgs args, InvokeOptions? opts = null)
    public static Output<GetSecurityGroupsResult> Invoke(GetSecurityGroupsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOptions options)
public static Output<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: outscale:index/getSecurityGroups:getSecurityGroups
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters List<GetSecurityGroupsFilter>
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
Id string
SecurityGroupIds List<string>
SecurityGroupNames List<string>
Filters []GetSecurityGroupsFilter
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
Id string
SecurityGroupIds []string
SecurityGroupNames []string
filters List<GetSecurityGroupsFilter>
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id String
securityGroupIds List<String>
securityGroupNames List<String>
filters GetSecurityGroupsFilter[]
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id string
securityGroupIds string[]
securityGroupNames string[]
filters Sequence[GetSecurityGroupsFilter]
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id str
security_group_ids Sequence[str]
security_group_names Sequence[str]
filters List<Property Map>
A combination of a filter name and one or more filter values. You can specify this argument for as many filter names as you need. The filter name can be any of the following:
id String
securityGroupIds List<String>
securityGroupNames List<String>

getSecurityGroups Result

The following output properties are available:

Id string
RequestId string
SecurityGroups List<GetSecurityGroupsSecurityGroup>
Information about one or more security groups.
Filters List<GetSecurityGroupsFilter>
SecurityGroupIds List<string>
SecurityGroupNames List<string>
id String
requestId String
securityGroups List<GetSecurityGroupsSecurityGroup>
Information about one or more security groups.
filters List<GetSecurityGroupsFilter>
securityGroupIds List<String>
securityGroupNames List<String>
id String
requestId String
securityGroups List<Property Map>
Information about one or more security groups.
filters List<Property Map>
securityGroupIds List<String>
securityGroupNames List<String>

Supporting Types

GetSecurityGroupsFilter

Name This property is required. string
Values This property is required. List<string>
Name This property is required. string
Values This property is required. []string
name This property is required. String
values This property is required. List<String>
name This property is required. string
values This property is required. string[]
name This property is required. str
values This property is required. Sequence[str]
name This property is required. String
values This property is required. List<String>

GetSecurityGroupsSecurityGroup

AccountId This property is required. string
The account ID that owns the source or destination security group.
Description This property is required. string
The description of the security group.
InboundRules This property is required. List<GetSecurityGroupsSecurityGroupInboundRule>
The inbound rules associated with the security group.
NetId This property is required. string
The ID of the Net for the security group.
OutboundRules This property is required. List<GetSecurityGroupsSecurityGroupOutboundRule>
The outbound rules associated with the security group.
SecurityGroupId This property is required. string
The ID of the security group.
SecurityGroupName This property is required. string
The name of the security group.
Tags This property is required. List<GetSecurityGroupsSecurityGroupTag>
One or more tags associated with the security group.
AccountId This property is required. string
The account ID that owns the source or destination security group.
Description This property is required. string
The description of the security group.
InboundRules This property is required. []GetSecurityGroupsSecurityGroupInboundRule
The inbound rules associated with the security group.
NetId This property is required. string
The ID of the Net for the security group.
OutboundRules This property is required. []GetSecurityGroupsSecurityGroupOutboundRule
The outbound rules associated with the security group.
SecurityGroupId This property is required. string
The ID of the security group.
SecurityGroupName This property is required. string
The name of the security group.
Tags This property is required. []GetSecurityGroupsSecurityGroupTag
One or more tags associated with the security group.
accountId This property is required. String
The account ID that owns the source or destination security group.
description This property is required. String
The description of the security group.
inboundRules This property is required. List<GetSecurityGroupsSecurityGroupInboundRule>
The inbound rules associated with the security group.
netId This property is required. String
The ID of the Net for the security group.
outboundRules This property is required. List<GetSecurityGroupsSecurityGroupOutboundRule>
The outbound rules associated with the security group.
securityGroupId This property is required. String
The ID of the security group.
securityGroupName This property is required. String
The name of the security group.
tags This property is required. List<GetSecurityGroupsSecurityGroupTag>
One or more tags associated with the security group.
accountId This property is required. string
The account ID that owns the source or destination security group.
description This property is required. string
The description of the security group.
inboundRules This property is required. GetSecurityGroupsSecurityGroupInboundRule[]
The inbound rules associated with the security group.
netId This property is required. string
The ID of the Net for the security group.
outboundRules This property is required. GetSecurityGroupsSecurityGroupOutboundRule[]
The outbound rules associated with the security group.
securityGroupId This property is required. string
The ID of the security group.
securityGroupName This property is required. string
The name of the security group.
tags This property is required. GetSecurityGroupsSecurityGroupTag[]
One or more tags associated with the security group.
account_id This property is required. str
The account ID that owns the source or destination security group.
description This property is required. str
The description of the security group.
inbound_rules This property is required. Sequence[GetSecurityGroupsSecurityGroupInboundRule]
The inbound rules associated with the security group.
net_id This property is required. str
The ID of the Net for the security group.
outbound_rules This property is required. Sequence[GetSecurityGroupsSecurityGroupOutboundRule]
The outbound rules associated with the security group.
security_group_id This property is required. str
The ID of the security group.
security_group_name This property is required. str
The name of the security group.
tags This property is required. Sequence[GetSecurityGroupsSecurityGroupTag]
One or more tags associated with the security group.
accountId This property is required. String
The account ID that owns the source or destination security group.
description This property is required. String
The description of the security group.
inboundRules This property is required. List<Property Map>
The inbound rules associated with the security group.
netId This property is required. String
The ID of the Net for the security group.
outboundRules This property is required. List<Property Map>
The outbound rules associated with the security group.
securityGroupId This property is required. String
The ID of the security group.
securityGroupName This property is required. String
The name of the security group.
tags This property is required. List<Property Map>
One or more tags associated with the security group.

GetSecurityGroupsSecurityGroupInboundRule

FromPortRange This property is required. double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
IpProtocol This property is required. string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
IpRanges This property is required. List<string>
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
PrefixListIds This property is required. List<string>
SecurityGroupsMembers This property is required. List<GetSecurityGroupsSecurityGroupInboundRuleSecurityGroupsMember>
Information about one or more source or destination security groups.
ToPortRange This property is required. double
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
FromPortRange This property is required. float64
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
IpProtocol This property is required. string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
IpRanges This property is required. []string
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
PrefixListIds This property is required. []string
SecurityGroupsMembers This property is required. []GetSecurityGroupsSecurityGroupInboundRuleSecurityGroupsMember
Information about one or more source or destination security groups.
ToPortRange This property is required. float64
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
fromPortRange This property is required. Double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ipProtocol This property is required. String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ipRanges This property is required. List<String>
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
prefixListIds This property is required. List<String>
securityGroupsMembers This property is required. List<GetSecurityGroupsSecurityGroupInboundRuleSecurityGroupsMember>
Information about one or more source or destination security groups.
toPortRange This property is required. Double
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
fromPortRange This property is required. number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ipProtocol This property is required. string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ipRanges This property is required. string[]
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
prefixListIds This property is required. string[]
securityGroupsMembers This property is required. GetSecurityGroupsSecurityGroupInboundRuleSecurityGroupsMember[]
Information about one or more source or destination security groups.
toPortRange This property is required. number
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
from_port_range This property is required. float
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ip_protocol This property is required. str
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ip_ranges This property is required. Sequence[str]
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
prefix_list_ids This property is required. Sequence[str]
security_groups_members This property is required. Sequence[GetSecurityGroupsSecurityGroupInboundRuleSecurityGroupsMember]
Information about one or more source or destination security groups.
to_port_range This property is required. float
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
fromPortRange This property is required. Number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ipProtocol This property is required. String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ipRanges This property is required. List<String>
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
prefixListIds This property is required. List<String>
securityGroupsMembers This property is required. List<Property Map>
Information about one or more source or destination security groups.
toPortRange This property is required. Number
The end of the port range for the TCP and UDP protocols, or an ICMP code number.

GetSecurityGroupsSecurityGroupInboundRuleSecurityGroupsMember

AccountId This property is required. string
The account ID that owns the source or destination security group.
SecurityGroupId This property is required. string
The ID of the security group.
SecurityGroupName This property is required. string
The name of the security group.
AccountId This property is required. string
The account ID that owns the source or destination security group.
SecurityGroupId This property is required. string
The ID of the security group.
SecurityGroupName This property is required. string
The name of the security group.
accountId This property is required. String
The account ID that owns the source or destination security group.
securityGroupId This property is required. String
The ID of the security group.
securityGroupName This property is required. String
The name of the security group.
accountId This property is required. string
The account ID that owns the source or destination security group.
securityGroupId This property is required. string
The ID of the security group.
securityGroupName This property is required. string
The name of the security group.
account_id This property is required. str
The account ID that owns the source or destination security group.
security_group_id This property is required. str
The ID of the security group.
security_group_name This property is required. str
The name of the security group.
accountId This property is required. String
The account ID that owns the source or destination security group.
securityGroupId This property is required. String
The ID of the security group.
securityGroupName This property is required. String
The name of the security group.

GetSecurityGroupsSecurityGroupOutboundRule

FromPortRange This property is required. double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
IpProtocol This property is required. string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
IpRanges This property is required. List<string>
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
PrefixListIds This property is required. List<string>
SecurityGroupsMembers This property is required. List<GetSecurityGroupsSecurityGroupOutboundRuleSecurityGroupsMember>
Information about one or more source or destination security groups.
ToPortRange This property is required. double
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
FromPortRange This property is required. float64
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
IpProtocol This property is required. string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
IpRanges This property is required. []string
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
PrefixListIds This property is required. []string
SecurityGroupsMembers This property is required. []GetSecurityGroupsSecurityGroupOutboundRuleSecurityGroupsMember
Information about one or more source or destination security groups.
ToPortRange This property is required. float64
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
fromPortRange This property is required. Double
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ipProtocol This property is required. String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ipRanges This property is required. List<String>
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
prefixListIds This property is required. List<String>
securityGroupsMembers This property is required. List<GetSecurityGroupsSecurityGroupOutboundRuleSecurityGroupsMember>
Information about one or more source or destination security groups.
toPortRange This property is required. Double
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
fromPortRange This property is required. number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ipProtocol This property is required. string
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ipRanges This property is required. string[]
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
prefixListIds This property is required. string[]
securityGroupsMembers This property is required. GetSecurityGroupsSecurityGroupOutboundRuleSecurityGroupsMember[]
Information about one or more source or destination security groups.
toPortRange This property is required. number
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
from_port_range This property is required. float
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ip_protocol This property is required. str
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ip_ranges This property is required. Sequence[str]
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
prefix_list_ids This property is required. Sequence[str]
security_groups_members This property is required. Sequence[GetSecurityGroupsSecurityGroupOutboundRuleSecurityGroupsMember]
Information about one or more source or destination security groups.
to_port_range This property is required. float
The end of the port range for the TCP and UDP protocols, or an ICMP code number.
fromPortRange This property is required. Number
The beginning of the port range for the TCP and UDP protocols, or an ICMP type number.
ipProtocol This property is required. String
The IP protocol name (tcp, udp, icmp, or -1 for all protocols). By default, -1. In a Net, this can also be an IP protocol number. For more information, see the IANA.org website.
ipRanges This property is required. List<String>
One or more IP ranges for the security group rules, in CIDR notation (for example, 10.0.0.0/16).
prefixListIds This property is required. List<String>
securityGroupsMembers This property is required. List<Property Map>
Information about one or more source or destination security groups.
toPortRange This property is required. Number
The end of the port range for the TCP and UDP protocols, or an ICMP code number.

GetSecurityGroupsSecurityGroupOutboundRuleSecurityGroupsMember

AccountId This property is required. string
The account ID that owns the source or destination security group.
SecurityGroupId This property is required. string
The ID of the security group.
SecurityGroupName This property is required. string
The name of the security group.
AccountId This property is required. string
The account ID that owns the source or destination security group.
SecurityGroupId This property is required. string
The ID of the security group.
SecurityGroupName This property is required. string
The name of the security group.
accountId This property is required. String
The account ID that owns the source or destination security group.
securityGroupId This property is required. String
The ID of the security group.
securityGroupName This property is required. String
The name of the security group.
accountId This property is required. string
The account ID that owns the source or destination security group.
securityGroupId This property is required. string
The ID of the security group.
securityGroupName This property is required. string
The name of the security group.
account_id This property is required. str
The account ID that owns the source or destination security group.
security_group_id This property is required. str
The ID of the security group.
security_group_name This property is required. str
The name of the security group.
accountId This property is required. String
The account ID that owns the source or destination security group.
securityGroupId This property is required. String
The ID of the security group.
securityGroupName This property is required. String
The name of the security group.

GetSecurityGroupsSecurityGroupTag

Key This property is required. string
The key of the tag, with a minimum of 1 character.
Value This property is required. string
The value of the tag, between 0 and 255 characters.
Key This property is required. string
The key of the tag, with a minimum of 1 character.
Value This property is required. string
The value of the tag, between 0 and 255 characters.
key This property is required. String
The key of the tag, with a minimum of 1 character.
value This property is required. String
The value of the tag, between 0 and 255 characters.
key This property is required. string
The key of the tag, with a minimum of 1 character.
value This property is required. string
The value of the tag, between 0 and 255 characters.
key This property is required. str
The key of the tag, with a minimum of 1 character.
value This property is required. str
The value of the tag, between 0 and 255 characters.
key This property is required. String
The key of the tag, with a minimum of 1 character.
value This property is required. String
The value of the tag, between 0 and 255 characters.

Package Details

Repository
outscale outscale/terraform-provider-outscale
License
Notes
This Pulumi package is based on the outscale Terraform Provider.