# RuleScope

The scope and id in which a given SecurityGroup rule should be defined.

- Source: [`aws-ec2/lib/security-group.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ec2/lib/security-group.ts#L233)
- Type last changed: v2.72.0 · 29 Mar 2023

## Example

```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';

declare const securityGroup: ec2.SecurityGroup;
const ruleScope: ec2.RuleScope = {
  id: 'id',
  scope: securityGroup,
};
```

## Properties

- `id`: string (required) — The construct ID to use for the rule.

- `scope`: [ISecurityGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html) (required) — The SecurityGroup in which a rule should be scoped.
