1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIsSecurityGroupRules
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getIsSecurityGroupRules

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Provides a read-only data source for SecurityGroupRuleCollection. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. For more information, about security group rule, see security in your VPC.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const example = ibm.getIsSecurityGroupRules({
        securityGroup: ibm_is_security_group.example.id,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    example = ibm.get_is_security_group_rules(security_group=ibm_is_security_group["example"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetIsSecurityGroupRules(ctx, &ibm.GetIsSecurityGroupRulesArgs{
    			SecurityGroup: ibm_is_security_group.Example.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ibm.GetIsSecurityGroupRules.Invoke(new()
        {
            SecurityGroup = ibm_is_security_group.Example.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetIsSecurityGroupRulesArgs;
    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 example = IbmFunctions.getIsSecurityGroupRules(GetIsSecurityGroupRulesArgs.builder()
                .securityGroup(ibm_is_security_group.example().id())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ibm:getIsSecurityGroupRules
          arguments:
            securityGroup: ${ibm_is_security_group.example.id}
    

    Using getIsSecurityGroupRules

    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 getIsSecurityGroupRules(args: GetIsSecurityGroupRulesArgs, opts?: InvokeOptions): Promise<GetIsSecurityGroupRulesResult>
    function getIsSecurityGroupRulesOutput(args: GetIsSecurityGroupRulesOutputArgs, opts?: InvokeOptions): Output<GetIsSecurityGroupRulesResult>
    def get_is_security_group_rules(id: Optional[str] = None,
                                    security_group: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetIsSecurityGroupRulesResult
    def get_is_security_group_rules_output(id: Optional[pulumi.Input[str]] = None,
                                    security_group: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetIsSecurityGroupRulesResult]
    func GetIsSecurityGroupRules(ctx *Context, args *GetIsSecurityGroupRulesArgs, opts ...InvokeOption) (*GetIsSecurityGroupRulesResult, error)
    func GetIsSecurityGroupRulesOutput(ctx *Context, args *GetIsSecurityGroupRulesOutputArgs, opts ...InvokeOption) GetIsSecurityGroupRulesResultOutput

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

    public static class GetIsSecurityGroupRules 
    {
        public static Task<GetIsSecurityGroupRulesResult> InvokeAsync(GetIsSecurityGroupRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetIsSecurityGroupRulesResult> Invoke(GetIsSecurityGroupRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIsSecurityGroupRulesResult> getIsSecurityGroupRules(GetIsSecurityGroupRulesArgs args, InvokeOptions options)
    public static Output<GetIsSecurityGroupRulesResult> getIsSecurityGroupRules(GetIsSecurityGroupRulesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIsSecurityGroupRules:getIsSecurityGroupRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    SecurityGroup string
    The security group identifier.
    Id string
    (String) The unique identifier for this security group.
    SecurityGroup string
    The security group identifier.
    Id string
    (String) The unique identifier for this security group.
    securityGroup String
    The security group identifier.
    id String
    (String) The unique identifier for this security group.
    securityGroup string
    The security group identifier.
    id string
    (String) The unique identifier for this security group.
    security_group str
    The security group identifier.
    id str
    (String) The unique identifier for this security group.
    securityGroup String
    The security group identifier.
    id String
    (String) The unique identifier for this security group.

    getIsSecurityGroupRules Result

    The following output properties are available:

    Id string
    (String) The unique identifier for this security group.
    Rules List<GetIsSecurityGroupRulesRule>
    (List) Array of rules. Nested scheme for rules:
    SecurityGroup string
    Id string
    (String) The unique identifier for this security group.
    Rules []GetIsSecurityGroupRulesRule
    (List) Array of rules. Nested scheme for rules:
    SecurityGroup string
    id String
    (String) The unique identifier for this security group.
    rules List<GetIsSecurityGroupRulesRule>
    (List) Array of rules. Nested scheme for rules:
    securityGroup String
    id string
    (String) The unique identifier for this security group.
    rules GetIsSecurityGroupRulesRule[]
    (List) Array of rules. Nested scheme for rules:
    securityGroup string
    id str
    (String) The unique identifier for this security group.
    rules Sequence[GetIsSecurityGroupRulesRule]
    (List) Array of rules. Nested scheme for rules:
    security_group str
    id String
    (String) The unique identifier for this security group.
    rules List<Property Map>
    (List) Array of rules. Nested scheme for rules:
    securityGroup String

    Supporting Types

    GetIsSecurityGroupRulesRule

    Code double
    (Integer) The ICMP traffic code to allow.
    Direction string
    (String) The direction of traffic to enforce, either inbound or outbound.
    Href string
    (String) The security group's canonical URL.
    Id string
    (String) The unique identifier for this security group.
    IpVersion string
    (String) The IP version to enforce. The format of remote.address or remote.cidr_block must match this property, if they are used. Alternatively, if remote references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.
    Locals List<GetIsSecurityGroupRulesRuleLocal>
    (List) The local IP address or range of local IP addresses to which this rule will allow inbound traffic (or from which, for outbound traffic). A CIDR block of 0.0.0.0/0 allows traffic to all local IP addresses (or from all local IP addresses, for outbound rules).
    PortMax double
    (Integer) The inclusive upper bound of TCP/UDP port range.
    PortMin double
    (Integer) The inclusive lower bound of TCP/UDP port range.
    Protocol string
    (String) The protocol to enforce.
    Remotes List<GetIsSecurityGroupRulesRuleRemote>
    (List) The IP addresses or security groups from which this rule allows traffic (or to which,for outbound rules). Can be specified as an IP address, a CIDR block, or a securitygroup. A CIDR block of 0.0.0.0/0 allows traffic from any source (or to any source,for outbound rules). Nested scheme for remote:
    Type double
    (Integer) The ICMP traffic type to allow.
    Code float64
    (Integer) The ICMP traffic code to allow.
    Direction string
    (String) The direction of traffic to enforce, either inbound or outbound.
    Href string
    (String) The security group's canonical URL.
    Id string
    (String) The unique identifier for this security group.
    IpVersion string
    (String) The IP version to enforce. The format of remote.address or remote.cidr_block must match this property, if they are used. Alternatively, if remote references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.
    Locals []GetIsSecurityGroupRulesRuleLocal
    (List) The local IP address or range of local IP addresses to which this rule will allow inbound traffic (or from which, for outbound traffic). A CIDR block of 0.0.0.0/0 allows traffic to all local IP addresses (or from all local IP addresses, for outbound rules).
    PortMax float64
    (Integer) The inclusive upper bound of TCP/UDP port range.
    PortMin float64
    (Integer) The inclusive lower bound of TCP/UDP port range.
    Protocol string
    (String) The protocol to enforce.
    Remotes []GetIsSecurityGroupRulesRuleRemote
    (List) The IP addresses or security groups from which this rule allows traffic (or to which,for outbound rules). Can be specified as an IP address, a CIDR block, or a securitygroup. A CIDR block of 0.0.0.0/0 allows traffic from any source (or to any source,for outbound rules). Nested scheme for remote:
    Type float64
    (Integer) The ICMP traffic type to allow.
    code Double
    (Integer) The ICMP traffic code to allow.
    direction String
    (String) The direction of traffic to enforce, either inbound or outbound.
    href String
    (String) The security group's canonical URL.
    id String
    (String) The unique identifier for this security group.
    ipVersion String
    (String) The IP version to enforce. The format of remote.address or remote.cidr_block must match this property, if they are used. Alternatively, if remote references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.
    locals List<GetIsSecurityGroupRulesRuleLocal>
    (List) The local IP address or range of local IP addresses to which this rule will allow inbound traffic (or from which, for outbound traffic). A CIDR block of 0.0.0.0/0 allows traffic to all local IP addresses (or from all local IP addresses, for outbound rules).
    portMax Double
    (Integer) The inclusive upper bound of TCP/UDP port range.
    portMin Double
    (Integer) The inclusive lower bound of TCP/UDP port range.
    protocol String
    (String) The protocol to enforce.
    remotes List<GetIsSecurityGroupRulesRuleRemote>
    (List) The IP addresses or security groups from which this rule allows traffic (or to which,for outbound rules). Can be specified as an IP address, a CIDR block, or a securitygroup. A CIDR block of 0.0.0.0/0 allows traffic from any source (or to any source,for outbound rules). Nested scheme for remote:
    type Double
    (Integer) The ICMP traffic type to allow.
    code number
    (Integer) The ICMP traffic code to allow.
    direction string
    (String) The direction of traffic to enforce, either inbound or outbound.
    href string
    (String) The security group's canonical URL.
    id string
    (String) The unique identifier for this security group.
    ipVersion string
    (String) The IP version to enforce. The format of remote.address or remote.cidr_block must match this property, if they are used. Alternatively, if remote references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.
    locals GetIsSecurityGroupRulesRuleLocal[]
    (List) The local IP address or range of local IP addresses to which this rule will allow inbound traffic (or from which, for outbound traffic). A CIDR block of 0.0.0.0/0 allows traffic to all local IP addresses (or from all local IP addresses, for outbound rules).
    portMax number
    (Integer) The inclusive upper bound of TCP/UDP port range.
    portMin number
    (Integer) The inclusive lower bound of TCP/UDP port range.
    protocol string
    (String) The protocol to enforce.
    remotes GetIsSecurityGroupRulesRuleRemote[]
    (List) The IP addresses or security groups from which this rule allows traffic (or to which,for outbound rules). Can be specified as an IP address, a CIDR block, or a securitygroup. A CIDR block of 0.0.0.0/0 allows traffic from any source (or to any source,for outbound rules). Nested scheme for remote:
    type number
    (Integer) The ICMP traffic type to allow.
    code float
    (Integer) The ICMP traffic code to allow.
    direction str
    (String) The direction of traffic to enforce, either inbound or outbound.
    href str
    (String) The security group's canonical URL.
    id str
    (String) The unique identifier for this security group.
    ip_version str
    (String) The IP version to enforce. The format of remote.address or remote.cidr_block must match this property, if they are used. Alternatively, if remote references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.
    locals Sequence[GetIsSecurityGroupRulesRuleLocal]
    (List) The local IP address or range of local IP addresses to which this rule will allow inbound traffic (or from which, for outbound traffic). A CIDR block of 0.0.0.0/0 allows traffic to all local IP addresses (or from all local IP addresses, for outbound rules).
    port_max float
    (Integer) The inclusive upper bound of TCP/UDP port range.
    port_min float
    (Integer) The inclusive lower bound of TCP/UDP port range.
    protocol str
    (String) The protocol to enforce.
    remotes Sequence[GetIsSecurityGroupRulesRuleRemote]
    (List) The IP addresses or security groups from which this rule allows traffic (or to which,for outbound rules). Can be specified as an IP address, a CIDR block, or a securitygroup. A CIDR block of 0.0.0.0/0 allows traffic from any source (or to any source,for outbound rules). Nested scheme for remote:
    type float
    (Integer) The ICMP traffic type to allow.
    code Number
    (Integer) The ICMP traffic code to allow.
    direction String
    (String) The direction of traffic to enforce, either inbound or outbound.
    href String
    (String) The security group's canonical URL.
    id String
    (String) The unique identifier for this security group.
    ipVersion String
    (String) The IP version to enforce. The format of remote.address or remote.cidr_block must match this property, if they are used. Alternatively, if remote references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version.
    locals List<Property Map>
    (List) The local IP address or range of local IP addresses to which this rule will allow inbound traffic (or from which, for outbound traffic). A CIDR block of 0.0.0.0/0 allows traffic to all local IP addresses (or from all local IP addresses, for outbound rules).
    portMax Number
    (Integer) The inclusive upper bound of TCP/UDP port range.
    portMin Number
    (Integer) The inclusive lower bound of TCP/UDP port range.
    protocol String
    (String) The protocol to enforce.
    remotes List<Property Map>
    (List) The IP addresses or security groups from which this rule allows traffic (or to which,for outbound rules). Can be specified as an IP address, a CIDR block, or a securitygroup. A CIDR block of 0.0.0.0/0 allows traffic from any source (or to any source,for outbound rules). Nested scheme for remote:
    type Number
    (Integer) The ICMP traffic type to allow.

    GetIsSecurityGroupRulesRuleLocal

    Address string
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    CidrBlock string
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    Address string
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    CidrBlock string
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    address String
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    cidrBlock String
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    address string
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    cidrBlock string
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    address str
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    cidr_block str
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    address String
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    cidrBlock String
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.

    GetIsSecurityGroupRulesRuleRemote

    Address string
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    CidrBlock string
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    Crn string
    (String) The security group's CRN.
    Deleteds List<GetIsSecurityGroupRulesRuleRemoteDeleted>
    (List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
    Href string
    (String) The security group's canonical URL.
    Id string
    (String) The unique identifier for this security group.
    Name string
    (String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
    Address string
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    CidrBlock string
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    Crn string
    (String) The security group's CRN.
    Deleteds []GetIsSecurityGroupRulesRuleRemoteDeleted
    (List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
    Href string
    (String) The security group's canonical URL.
    Id string
    (String) The unique identifier for this security group.
    Name string
    (String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
    address String
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    cidrBlock String
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    crn String
    (String) The security group's CRN.
    deleteds List<GetIsSecurityGroupRulesRuleRemoteDeleted>
    (List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
    href String
    (String) The security group's canonical URL.
    id String
    (String) The unique identifier for this security group.
    name String
    (String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
    address string
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    cidrBlock string
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    crn string
    (String) The security group's CRN.
    deleteds GetIsSecurityGroupRulesRuleRemoteDeleted[]
    (List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
    href string
    (String) The security group's canonical URL.
    id string
    (String) The unique identifier for this security group.
    name string
    (String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
    address str
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    cidr_block str
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    crn str
    (String) The security group's CRN.
    deleteds Sequence[GetIsSecurityGroupRulesRuleRemoteDeleted]
    (List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
    href str
    (String) The security group's canonical URL.
    id str
    (String) The unique identifier for this security group.
    name str
    (String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
    address String
    (String) The IP address.This property may add support for IPv6 addresses in the future. When processing a value in this property, verify that the address is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected IP address format was encountered.
    cidrBlock String
    (String) The CIDR block. This property may add support for IPv6 CIDR blocks in the future. When processing a value in this property, verify that the CIDR block is in an expected format. If it is not, log an error. Optionally halt processing and surface the error, or bypass the resource on which the unexpected CIDR block format was encountered.
    crn String
    (String) The security group's CRN.
    deleteds List<Property Map>
    (List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
    href String
    (String) The security group's canonical URL.
    id String
    (String) The unique identifier for this security group.
    name String
    (String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.

    GetIsSecurityGroupRulesRuleRemoteDeleted

    MoreInfo string
    (String) Link to documentation about deleted resources.
    MoreInfo string
    (String) Link to documentation about deleted resources.
    moreInfo String
    (String) Link to documentation about deleted resources.
    moreInfo string
    (String) Link to documentation about deleted resources.
    more_info str
    (String) Link to documentation about deleted resources.
    moreInfo String
    (String) Link to documentation about deleted resources.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud