# NetworkTrafficRuleProperty

Struct · External

Network traffic rule.

- Source: Generated at build time
- Type last changed: v2.249.0 · 13 Apr 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_securityagent as securityagent } from 'aws-cdk-lib';
const networkTrafficRuleProperty: securityagent.CfnPentest.NetworkTrafficRuleProperty = {
  effect: 'effect',
  networkTrafficRuleType: 'networkTrafficRuleType',
  pattern: 'pattern',
};
```

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_securityagent as securityagent

network_traffic_rule_property = securityagent.CfnPentest.NetworkTrafficRuleProperty(
    effect="effect",
    network_traffic_rule_type="networkTrafficRuleType",
    pattern="pattern"
)
```

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

NetworkTrafficRuleProperty networkTrafficRuleProperty = NetworkTrafficRuleProperty.builder()
        .effect("effect")
        .networkTrafficRuleType("networkTrafficRuleType")
        .pattern("pattern")
        .build();
```

C#:

```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.SecurityAgent;

var networkTrafficRuleProperty = new NetworkTrafficRuleProperty {
    Effect = "effect",
    NetworkTrafficRuleType = "networkTrafficRuleType",
    Pattern = "pattern"
};
```

Go:

```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"

networkTrafficRuleProperty := &NetworkTrafficRuleProperty{
	Effect: jsii.String("effect"),
	NetworkTrafficRuleType: jsii.String("networkTrafficRuleType"),
	Pattern: jsii.String("pattern"),
}
```

## Properties

- `effect`: string — Whether to allow or deny traffic matching this rule.

- `networkTrafficRuleType`: string — Type of pattern matching for this rule.

- `pattern`: string — URL pattern this rule applies to.
