# AnalysisSecurityGroupRuleProperty

Describes a security group rule.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## 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 analysisSecurityGroupRuleProperty: ec2.CfnNetworkInsightsAnalysis.AnalysisSecurityGroupRuleProperty = {
  cidr: 'cidr',
  direction: 'direction',
  portRange: {
    from: 123,
    to: 123,
  },
  prefixListId: 'prefixListId',
  protocol: 'protocol',
  securityGroupId: 'securityGroupId',
};
```

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

analysis_security_group_rule_property = ec2.CfnNetworkInsightsAnalysis.AnalysisSecurityGroupRuleProperty(
    cidr="cidr",
    direction="direction",
    port_range=ec2.CfnNetworkInsightsAnalysis.PortRangeProperty(
        from=123,
        to=123
    ),
    prefix_list_id="prefixListId",
    protocol="protocol",
    security_group_id="securityGroupId"
)
```

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.*;

AnalysisSecurityGroupRuleProperty analysisSecurityGroupRuleProperty = AnalysisSecurityGroupRuleProperty.builder()
        .cidr("cidr")
        .direction("direction")
        .portRange(PortRangeProperty.builder()
                .from(123)
                .to(123)
                .build())
        .prefixListId("prefixListId")
        .protocol("protocol")
        .securityGroupId("securityGroupId")
        .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 analysisSecurityGroupRuleProperty = new AnalysisSecurityGroupRuleProperty {
    Cidr = "cidr",
    Direction = "direction",
    PortRange = new PortRangeProperty {
        From = 123,
        To = 123
    },
    PrefixListId = "prefixListId",
    Protocol = "protocol",
    SecurityGroupId = "securityGroupId"
};
```

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"

analysisSecurityGroupRuleProperty := &AnalysisSecurityGroupRuleProperty{
	Cidr: jsii.String("cidr"),
	Direction: jsii.String("direction"),
	PortRange: &PortRangeProperty{
		From: jsii.Number(123),
		To: jsii.Number(123),
	},
	PrefixListId: jsii.String("prefixListId"),
	Protocol: jsii.String("protocol"),
	SecurityGroupId: jsii.String("securityGroupId"),
}
```

## Properties

- `cidr`: string — The IPv4 address range, in CIDR notation.

- `direction`: string — The direction. The following are the possible values:.

  - egress
  - ingress

- `portRange`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnNetworkInsightsAnalysis.PortRangeProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnNetworkInsightsAnalysis.PortRangeProperty.html) — The port range.

- `prefixListId`: string — The prefix list ID.

- `protocol`: string — The protocol name.

- `securityGroupId`: string — The security group ID.
