# IngressRuleConfig

Configuration for an ingress security group rule.

Extends: [RuleConfig](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.RuleConfig.html)
Returned by: [IPeer.toIngressRuleConfig](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IPeer.html#toingressruleconfig)

- Source: [`aws-ec2/lib/peer.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/peer.ts#L30)
- Type last changed: v2.256.0 · 20 May 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const ingressRuleConfig: ec2.IngressRuleConfig = {
  cidrIp: 'cidrIp',
  cidrIpv6: 'cidrIpv6',
  sourcePrefixListId: 'sourcePrefixListId',
  sourceSecurityGroupId: 'sourceSecurityGroupId',
  sourceSecurityGroupOwnerId: 'sourceSecurityGroupOwnerId',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

ingress_rule_config = ec2.IngressRuleConfig(
    cidr_ip="cidrIp",
    cidr_ipv6="cidrIpv6",
    source_prefix_list_id="sourcePrefixListId",
    source_security_group_id="sourceSecurityGroupId",
    source_security_group_owner_id="sourceSecurityGroupOwnerId"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

IngressRuleConfig ingressRuleConfig = IngressRuleConfig.builder()
        .cidrIp("cidrIp")
        .cidrIpv6("cidrIpv6")
        .sourcePrefixListId("sourcePrefixListId")
        .sourceSecurityGroupId("sourceSecurityGroupId")
        .sourceSecurityGroupOwnerId("sourceSecurityGroupOwnerId")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var ingressRuleConfig = new IngressRuleConfig {
    CidrIp = "cidrIp",
    CidrIpv6 = "cidrIpv6",
    SourcePrefixListId = "sourcePrefixListId",
    SourceSecurityGroupId = "sourceSecurityGroupId",
    SourceSecurityGroupOwnerId = "sourceSecurityGroupOwnerId"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

ingressRuleConfig := &IngressRuleConfig{
	CidrIp: jsii.String("cidrIp"),
	CidrIpv6: jsii.String("cidrIpv6"),
	SourcePrefixListId: jsii.String("sourcePrefixListId"),
	SourceSecurityGroupId: jsii.String("sourceSecurityGroupId"),
	SourceSecurityGroupOwnerId: jsii.String("sourceSecurityGroupOwnerId"),
}
```

## Properties

- `cidrIp`: string — The IPv4 address range, in CIDR format.

  **Default:** No IPv4 CIDR

- `cidrIpv6`: string — The IPv6 address range, in CIDR format.

  **Default:** No IPv6 CIDR

- `sourcePrefixListId`: string — The ID of a source prefix list.

  **Default:** No source prefix list

- `sourceSecurityGroupId`: string — The ID of a source security group.

  **Default:** No source security group

- `sourceSecurityGroupOwnerId`: string — The AWS account ID of the owner of a source security group.

  **Default:** No source security group owner ID
