# IPeer

Interface for classes that provide the peer-specification parts of a security group rule.

Extends: IPeer
Extends: IConnectable
Implemented by: PrefixList, SecurityGroup

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

## Properties

- `canInlineRule`: boolean — Whether the rule can be inlined into a SecurityGroup or not.

- `connections`: [Connections](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) — The network connections associated with this resource.

- `uniqueId`: string — A unique identifier for this connection peer.

## Methods

- `toEgressRuleConfig(): EgressRuleConfig` — Produce the egress rule JSON for the given connection.

- `toIngressRuleConfig(): IngressRuleConfig` — Produce the ingress rule JSON for the given connection.
