ibm 1.78.0 published on Wednesday, Apr 30, 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,
});
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"])
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
})
}
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,
});
});
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());
}
}
variables:
example:
fn::invoke:
function: ibm:getIsSecurityGroupRule
arguments:
securityGroupRule: ${ibm_is_security_group_rule.example.rule_id}
securityGroup: ${ibm_is_security_group.example.id}
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>
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]
func LookupIsSecurityGroupRule(ctx *Context, args *LookupIsSecurityGroupRuleArgs, opts ...InvokeOption) (*LookupIsSecurityGroupRuleResult, error)
func LookupIsSecurityGroupRuleOutput(ctx *Context, args *LookupIsSecurityGroupRuleOutputArgs, opts ...InvokeOption) LookupIsSecurityGroupRuleResultOutput
> 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)
}
public static CompletableFuture<GetIsSecurityGroupRuleResult> getIsSecurityGroupRule(GetIsSecurityGroupRuleArgs args, InvokeOptions options)
public static Output<GetIsSecurityGroupRuleResult> getIsSecurityGroupRule(GetIsSecurityGroupRuleArgs args, InvokeOptions options)
fn::invoke:
function: ibm:index/getIsSecurityGroupRule:getIsSecurityGroupRule
arguments:
# arguments dictionary
The following arguments are supported:
- Security
Group string - The security group identifier.
- Security
Group stringRule - The rule identifier.
- Id string
- (String) The unique identifier for this security group.
- Security
Group string - The security group identifier.
- Security
Group stringRule - The rule identifier.
- Id string
- (String) The unique identifier for this security group.
- security
Group String - The security group identifier.
- security
Group StringRule - The rule identifier.
- id String
- (String) The unique identifier for this security group.
- security
Group string - The security group identifier.
- security
Group stringRule - The rule identifier.
- id string
- (String) The unique identifier for this security group.
- security_
group str - The security group identifier.
- security_
group_ strrule - The rule identifier.
- id str
- (String) The unique identifier for this security group.
- security
Group String - The security group identifier.
- security
Group StringRule - 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
oroutbound
. - Href string
- (String) The security group's canonical URL.
- Id string
- (String) The unique identifier for this security group.
- Ip
Version string - (String) The IP version to enforce. The format of
remote.address
orremote.cidr_block
must match this property, if they are used. Alternatively, ifremote
references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - Locals
List<Get
Is Security Group Rule Local> - (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 double - (Integer) The inclusive upper bound of TCP/UDP port range.
- Port
Min double - (Integer) The inclusive lower bound of TCP/UDP port range.
- Protocol string
- (String) The protocol to enforce.
- Remotes
List<Get
Is Security Group Rule Remote> - (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 forremote
: - Security
Group string - Security
Group stringRule - 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
oroutbound
. - Href string
- (String) The security group's canonical URL.
- Id string
- (String) The unique identifier for this security group.
- Ip
Version string - (String) The IP version to enforce. The format of
remote.address
orremote.cidr_block
must match this property, if they are used. Alternatively, ifremote
references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - Locals
[]Get
Is Security Group Rule Local - (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 float64 - (Integer) The inclusive upper bound of TCP/UDP port range.
- Port
Min float64 - (Integer) The inclusive lower bound of TCP/UDP port range.
- Protocol string
- (String) The protocol to enforce.
- Remotes
[]Get
Is Security Group Rule Remote - (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 forremote
: - Security
Group string - Security
Group stringRule - 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
oroutbound
. - href String
- (String) The security group's canonical URL.
- id String
- (String) The unique identifier for this security group.
- ip
Version String - (String) The IP version to enforce. The format of
remote.address
orremote.cidr_block
must match this property, if they are used. Alternatively, ifremote
references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - locals
List<Get
Is Security Group Rule Local> - (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 Double - (Integer) The inclusive upper bound of TCP/UDP port range.
- port
Min Double - (Integer) The inclusive lower bound of TCP/UDP port range.
- protocol String
- (String) The protocol to enforce.
- remotes
List<Get
Is Security Group Rule Remote> - (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 forremote
: - security
Group String - security
Group StringRule - 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
oroutbound
. - href string
- (String) The security group's canonical URL.
- id string
- (String) The unique identifier for this security group.
- ip
Version string - (String) The IP version to enforce. The format of
remote.address
orremote.cidr_block
must match this property, if they are used. Alternatively, ifremote
references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - locals
Get
Is Security Group Rule Local[] - (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 number - (Integer) The inclusive upper bound of TCP/UDP port range.
- port
Min number - (Integer) The inclusive lower bound of TCP/UDP port range.
- protocol string
- (String) The protocol to enforce.
- remotes
Get
Is Security Group Rule Remote[] - (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 forremote
: - security
Group string - security
Group stringRule - 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
oroutbound
. - 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
orremote.cidr_block
must match this property, if they are used. Alternatively, ifremote
references a security group, then this rule only applies to IP addresses (network interfaces) in that group matching this IP version. - locals
Sequence[Get
Is Security Group Rule Local] - (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[Get
Is Security Group Rule Remote] - (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 forremote
: - security_
group str - security_
group_ strrule - 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
oroutbound
. - href String
- (String) The security group's canonical URL.
- id String
- (String) The unique identifier for this security group.
- ip
Version String - (String) The IP version to enforce. The format of
remote.address
orremote.cidr_block
must match this property, if they are used. Alternatively, ifremote
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).
- port
Max Number - (Integer) The inclusive upper bound of TCP/UDP port range.
- port
Min 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 forremote
: - security
Group String - security
Group StringRule - type Number
- (Integer) The ICMP traffic type to allow.
Supporting Types
GetIsSecurityGroupRuleLocal
- 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.
- Cidr
Block 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.
- Cidr
Block 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.
- cidr
Block 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.
- cidr
Block 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.
- cidr
Block 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 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.
- Cidr
Block 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<Get
Is Security Group Rule Remote Deleted> - (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.
- Cidr
Block 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
[]Get
Is Security Group Rule Remote Deleted - (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.
- cidr
Block 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<Get
Is Security Group Rule Remote Deleted> - (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.
- cidr
Block 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
Get
Is Security Group Rule Remote Deleted[] - (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[Get
Is Security Group Rule Remote Deleted] - (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.
- cidr
Block 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.
GetIsSecurityGroupRuleRemoteDeleted
- More
Info string - (String) Link to documentation about deleted resources.
- More
Info string - (String) Link to documentation about deleted resources.
- more
Info String - (String) Link to documentation about deleted resources.
- more
Info string - (String) Link to documentation about deleted resources.
- more_
info str - (String) Link to documentation about deleted resources.
- more
Info 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.