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

outscale.getSecurityGroup

Explore with Pulumi AI

Provides information about a security group.

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 securityGroup01 = outscale.getSecurityGroup({
    filters: [{
        name: "security_group_ids",
        values: ["sg-12345678"],
    }],
});
Copy
import pulumi
import pulumi_outscale as outscale

security_group01 = outscale.get_security_group(filters=[{
    "name": "security_group_ids",
    "values": ["sg-12345678"],
}])
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.LookupSecurityGroup(ctx, &outscale.LookupSecurityGroupArgs{
			Filters: []outscale.GetSecurityGroupFilter{
				{
					Name: "security_group_ids",
					Values: []string{
						"sg-12345678",
					},
				},
			},
		}, 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 securityGroup01 = Outscale.GetSecurityGroup.Invoke(new()
    {
        Filters = new[]
        {
            new Outscale.Inputs.GetSecurityGroupFilterInputArgs
            {
                Name = "security_group_ids",
                Values = new[]
                {
                    "sg-12345678",
                },
            },
        },
    });

});
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.GetSecurityGroupArgs;
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 securityGroup01 = OutscaleFunctions.getSecurityGroup(GetSecurityGroupArgs.builder()
            .filters(GetSecurityGroupFilterArgs.builder()
                .name("security_group_ids")
                .values("sg-12345678")
                .build())
            .build());

    }
}
Copy
variables:
  securityGroup01:
    fn::invoke:
      function: outscale:getSecurityGroup
      arguments:
        filters:
          - name: security_group_ids
            values:
              - sg-12345678
Copy

Using getSecurityGroup

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 getSecurityGroup(args: GetSecurityGroupArgs, opts?: InvokeOptions): Promise<GetSecurityGroupResult>
function getSecurityGroupOutput(args: GetSecurityGroupOutputArgs, opts?: InvokeOptions): Output<GetSecurityGroupResult>
Copy
def get_security_group(filters: Optional[Sequence[GetSecurityGroupFilter]] = None,
                       id: Optional[str] = None,
                       security_group_id: Optional[str] = None,
                       security_group_name: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetSecurityGroupResult
def get_security_group_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSecurityGroupFilterArgs]]]] = None,
                       id: Optional[pulumi.Input[str]] = None,
                       security_group_id: Optional[pulumi.Input[str]] = None,
                       security_group_name: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetSecurityGroupResult]
Copy
func LookupSecurityGroup(ctx *Context, args *LookupSecurityGroupArgs, opts ...InvokeOption) (*LookupSecurityGroupResult, error)
func LookupSecurityGroupOutput(ctx *Context, args *LookupSecurityGroupOutputArgs, opts ...InvokeOption) LookupSecurityGroupResultOutput
Copy

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

public static class GetSecurityGroup 
{
    public static Task<GetSecurityGroupResult> InvokeAsync(GetSecurityGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetSecurityGroupResult> Invoke(GetSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSecurityGroupResult> getSecurityGroup(GetSecurityGroupArgs args, InvokeOptions options)
public static Output<GetSecurityGroupResult> getSecurityGroup(GetSecurityGroupArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: outscale:index/getSecurityGroup:getSecurityGroup
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters List<GetSecurityGroupFilter>
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
SecurityGroupId string
The ID of the security group.
SecurityGroupName string
The name of the security group.
Filters []GetSecurityGroupFilter
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
SecurityGroupId string
The ID of the security group.
SecurityGroupName string
The name of the security group.
filters List<GetSecurityGroupFilter>
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
securityGroupId String
The ID of the security group.
securityGroupName String
The name of the security group.
filters GetSecurityGroupFilter[]
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
securityGroupId string
The ID of the security group.
securityGroupName string
The name of the security group.
filters Sequence[GetSecurityGroupFilter]
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_id str
The ID of the security group.
security_group_name str
The name of the security group.
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
securityGroupId String
The ID of the security group.
securityGroupName String
The name of the security group.

getSecurityGroup Result

The following output properties are available:

AccountId string
The account ID that owns the source or destination security group.
Description string
The description of the security group.
Id string
InboundRules List<GetSecurityGroupInboundRule>
The inbound rules associated with the security group.
NetId string
The ID of the Net for the security group.
OutboundRules List<GetSecurityGroupOutboundRule>
The outbound rules associated with the security group.
RequestId string
SecurityGroupId string
The ID of the security group.
SecurityGroupName string
The name of the security group.
Tags List<GetSecurityGroupTag>
One or more tags associated with the security group.
Filters List<GetSecurityGroupFilter>
AccountId string
The account ID that owns the source or destination security group.
Description string
The description of the security group.
Id string
InboundRules []GetSecurityGroupInboundRule
The inbound rules associated with the security group.
NetId string
The ID of the Net for the security group.
OutboundRules []GetSecurityGroupOutboundRule
The outbound rules associated with the security group.
RequestId string
SecurityGroupId string
The ID of the security group.
SecurityGroupName string
The name of the security group.
Tags []GetSecurityGroupTag
One or more tags associated with the security group.
Filters []GetSecurityGroupFilter
accountId String
The account ID that owns the source or destination security group.
description String
The description of the security group.
id String
inboundRules List<GetSecurityGroupInboundRule>
The inbound rules associated with the security group.
netId String
The ID of the Net for the security group.
outboundRules List<GetSecurityGroupOutboundRule>
The outbound rules associated with the security group.
requestId String
securityGroupId String
The ID of the security group.
securityGroupName String
The name of the security group.
tags List<GetSecurityGroupTag>
One or more tags associated with the security group.
filters List<GetSecurityGroupFilter>
accountId string
The account ID that owns the source or destination security group.
description string
The description of the security group.
id string
inboundRules GetSecurityGroupInboundRule[]
The inbound rules associated with the security group.
netId string
The ID of the Net for the security group.
outboundRules GetSecurityGroupOutboundRule[]
The outbound rules associated with the security group.
requestId string
securityGroupId string
The ID of the security group.
securityGroupName string
The name of the security group.
tags GetSecurityGroupTag[]
One or more tags associated with the security group.
filters GetSecurityGroupFilter[]
account_id str
The account ID that owns the source or destination security group.
description str
The description of the security group.
id str
inbound_rules Sequence[GetSecurityGroupInboundRule]
The inbound rules associated with the security group.
net_id str
The ID of the Net for the security group.
outbound_rules Sequence[GetSecurityGroupOutboundRule]
The outbound rules associated with the security group.
request_id str
security_group_id str
The ID of the security group.
security_group_name str
The name of the security group.
tags Sequence[GetSecurityGroupTag]
One or more tags associated with the security group.
filters Sequence[GetSecurityGroupFilter]
accountId String
The account ID that owns the source or destination security group.
description String
The description of the security group.
id String
inboundRules List<Property Map>
The inbound rules associated with the security group.
netId String
The ID of the Net for the security group.
outboundRules List<Property Map>
The outbound rules associated with the security group.
requestId String
securityGroupId String
The ID of the security group.
securityGroupName String
The name of the security group.
tags List<Property Map>
One or more tags associated with the security group.
filters List<Property Map>

Supporting Types

GetSecurityGroupFilter

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>

GetSecurityGroupInboundRule

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<GetSecurityGroupInboundRuleSecurityGroupsMember>
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. []GetSecurityGroupInboundRuleSecurityGroupsMember
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<GetSecurityGroupInboundRuleSecurityGroupsMember>
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. GetSecurityGroupInboundRuleSecurityGroupsMember[]
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[GetSecurityGroupInboundRuleSecurityGroupsMember]
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.

GetSecurityGroupInboundRuleSecurityGroupsMember

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.

GetSecurityGroupOutboundRule

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<GetSecurityGroupOutboundRuleSecurityGroupsMember>
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. []GetSecurityGroupOutboundRuleSecurityGroupsMember
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<GetSecurityGroupOutboundRuleSecurityGroupsMember>
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. GetSecurityGroupOutboundRuleSecurityGroupsMember[]
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[GetSecurityGroupOutboundRuleSecurityGroupsMember]
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.

GetSecurityGroupOutboundRuleSecurityGroupsMember

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.

GetSecurityGroupTag

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.