1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIsSecurityGroupRule
ibm 1.77.1 published on Monday, Apr 14, 2025 by ibm-cloud

ibm.getIsSecurityGroupRule

Explore with Pulumi AI

Provides a read-only data source for is_security_group_rule. 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.getIsSecurityGroupRule({
    securityGroupRule: ibm_is_security_group_rule.example.rule_id,
    securityGroup: ibm_is_security_group.example.id,
});
Copy
import pulumi
import pulumi_ibm as ibm

example = ibm.get_is_security_group_rule(security_group_rule=ibm_is_security_group_rule["example"]["rule_id"],
    security_group=ibm_is_security_group["example"]["id"])
Copy
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.LookupIsSecurityGroupRule(ctx, &ibm.LookupIsSecurityGroupRuleArgs{
			SecurityGroupRule: ibm_is_security_group_rule.Example.Rule_id,
			SecurityGroup:     ibm_is_security_group.Example.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;

return await Deployment.RunAsync(() => 
{
    var example = Ibm.GetIsSecurityGroupRule.Invoke(new()
    {
        SecurityGroupRule = ibm_is_security_group_rule.Example.Rule_id,
        SecurityGroup = ibm_is_security_group.Example.Id,
    });

});
Copy
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.GetIsSecurityGroupRuleArgs;
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.getIsSecurityGroupRule(GetIsSecurityGroupRuleArgs.builder()
            .securityGroupRule(ibm_is_security_group_rule.example().rule_id())
            .securityGroup(ibm_is_security_group.example().id())
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ibm:getIsSecurityGroupRule
      arguments:
        securityGroupRule: ${ibm_is_security_group_rule.example.rule_id}
        securityGroup: ${ibm_is_security_group.example.id}
Copy

Using getIsSecurityGroupRule

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 getIsSecurityGroupRule(args: GetIsSecurityGroupRuleArgs, opts?: InvokeOptions): Promise<GetIsSecurityGroupRuleResult>
function getIsSecurityGroupRuleOutput(args: GetIsSecurityGroupRuleOutputArgs, opts?: InvokeOptions): Output<GetIsSecurityGroupRuleResult>
Copy
def get_is_security_group_rule(id: Optional[str] = None,
                               security_group: Optional[str] = None,
                               security_group_rule: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetIsSecurityGroupRuleResult
def get_is_security_group_rule_output(id: Optional[pulumi.Input[str]] = None,
                               security_group: Optional[pulumi.Input[str]] = None,
                               security_group_rule: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetIsSecurityGroupRuleResult]
Copy
func LookupIsSecurityGroupRule(ctx *Context, args *LookupIsSecurityGroupRuleArgs, opts ...InvokeOption) (*LookupIsSecurityGroupRuleResult, error)
func LookupIsSecurityGroupRuleOutput(ctx *Context, args *LookupIsSecurityGroupRuleOutputArgs, opts ...InvokeOption) LookupIsSecurityGroupRuleResultOutput
Copy

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

public static class GetIsSecurityGroupRule 
{
    public static Task<GetIsSecurityGroupRuleResult> InvokeAsync(GetIsSecurityGroupRuleArgs args, InvokeOptions? opts = null)
    public static Output<GetIsSecurityGroupRuleResult> Invoke(GetIsSecurityGroupRuleInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetIsSecurityGroupRuleResult> getIsSecurityGroupRule(GetIsSecurityGroupRuleArgs args, InvokeOptions options)
public static Output<GetIsSecurityGroupRuleResult> getIsSecurityGroupRule(GetIsSecurityGroupRuleArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ibm:index/getIsSecurityGroupRule:getIsSecurityGroupRule
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

SecurityGroup This property is required. string
The security group identifier.
SecurityGroupRule This property is required. string
The rule identifier.
Id string
(String) The unique identifier for this security group.
SecurityGroup This property is required. string
The security group identifier.
SecurityGroupRule This property is required. string
The rule identifier.
Id string
(String) The unique identifier for this security group.
securityGroup This property is required. String
The security group identifier.
securityGroupRule This property is required. String
The rule identifier.
id String
(String) The unique identifier for this security group.
securityGroup This property is required. string
The security group identifier.
securityGroupRule This property is required. string
The rule identifier.
id string
(String) The unique identifier for this security group.
security_group This property is required. str
The security group identifier.
security_group_rule This property is required. str
The rule identifier.
id str
(String) The unique identifier for this security group.
securityGroup This property is required. String
The security group identifier.
securityGroupRule This property is required. String
The rule identifier.
id String
(String) The unique identifier for this security group.

getIsSecurityGroupRule Result

The following output properties are available:

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<GetIsSecurityGroupRuleLocal>
(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<GetIsSecurityGroupRuleRemote>
(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:
SecurityGroup string
SecurityGroupRule string
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 []GetIsSecurityGroupRuleLocal
(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 []GetIsSecurityGroupRuleRemote
(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:
SecurityGroup string
SecurityGroupRule string
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<GetIsSecurityGroupRuleLocal>
(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<GetIsSecurityGroupRuleRemote>
(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:
securityGroup String
securityGroupRule String
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 GetIsSecurityGroupRuleLocal[]
(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 GetIsSecurityGroupRuleRemote[]
(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:
securityGroup string
securityGroupRule string
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[GetIsSecurityGroupRuleLocal]
(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[GetIsSecurityGroupRuleRemote]
(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:
security_group str
security_group_rule str
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:
securityGroup String
securityGroupRule String
type Number
(Integer) The ICMP traffic type to allow.

Supporting Types

GetIsSecurityGroupRuleLocal

Address This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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.

GetIsSecurityGroupRuleRemote

Address This property is required. 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 This property is required. 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 This property is required. string
(String) The security group's CRN.
Deleteds This property is required. List<GetIsSecurityGroupRuleRemoteDeleted>
(List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
Href This property is required. string
(String) The security group's canonical URL.
Id This property is required. string
(String) The unique identifier for this security group.
Name This property is required. string
(String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
Address This property is required. 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 This property is required. 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 This property is required. string
(String) The security group's CRN.
Deleteds This property is required. []GetIsSecurityGroupRuleRemoteDeleted
(List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
Href This property is required. string
(String) The security group's canonical URL.
Id This property is required. string
(String) The unique identifier for this security group.
Name This property is required. string
(String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
address This property is required. 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 This property is required. 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 This property is required. String
(String) The security group's CRN.
deleteds This property is required. List<GetIsSecurityGroupRuleRemoteDeleted>
(List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
href This property is required. String
(String) The security group's canonical URL.
id This property is required. String
(String) The unique identifier for this security group.
name This property is required. String
(String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
address This property is required. 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 This property is required. 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 This property is required. string
(String) The security group's CRN.
deleteds This property is required. GetIsSecurityGroupRuleRemoteDeleted[]
(List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
href This property is required. string
(String) The security group's canonical URL.
id This property is required. string
(String) The unique identifier for this security group.
name This property is required. string
(String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
address This property is required. 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 This property is required. 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 This property is required. str
(String) The security group's CRN.
deleteds This property is required. Sequence[GetIsSecurityGroupRuleRemoteDeleted]
(List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
href This property is required. str
(String) The security group's canonical URL.
id This property is required. str
(String) The unique identifier for this security group.
name This property is required. str
(String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.
address This property is required. 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 This property is required. 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 This property is required. String
(String) The security group's CRN.
deleteds This property is required. List<Property Map>
(List) If present, this property indicates the referenced resource has been deleted and providessome supplementary information. Nested scheme for deleted:
href This property is required. String
(String) The security group's canonical URL.
id This property is required. String
(String) The unique identifier for this security group.
name This property is required. String
(String) The user-defined name for this security group. Names must be unique within the VPC the security group resides in.

GetIsSecurityGroupRuleRemoteDeleted

MoreInfo This property is required. string
(String) Link to documentation about deleted resources.
MoreInfo This property is required. string
(String) Link to documentation about deleted resources.
moreInfo This property is required. String
(String) Link to documentation about deleted resources.
moreInfo This property is required. string
(String) Link to documentation about deleted resources.
more_info This property is required. str
(String) Link to documentation about deleted resources.
moreInfo This property is required. 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.