# VpcEncryptionControlProperty

Describes the configuration and state of VPC encryption controls.

For more information, see [Enforce VPC encryption in transit](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-encryption-controls.html) in the *Amazon VPC User Guide*.

- Source: Generated at build time
- Type last changed: v2.264.0 · 10 Aug 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 vpcEncryptionControlProperty: ec2.CfnVPC.VpcEncryptionControlProperty = {
  egressOnlyInternetGatewayExclusion: 'egressOnlyInternetGatewayExclusion',
  elasticFileSystemExclusion: 'elasticFileSystemExclusion',
  internetGatewayExclusion: 'internetGatewayExclusion',
  lambdaExclusion: 'lambdaExclusion',
  mode: 'mode',
  natGatewayExclusion: 'natGatewayExclusion',
  resourceExclusions: {
    egressOnlyInternetGateway: {
      state: 'state',
      stateMessage: 'stateMessage',
    },
    elasticFileSystem: {
      state: 'state',
      stateMessage: 'stateMessage',
    },
    internetGateway: {
      state: 'state',
      stateMessage: 'stateMessage',
    },
    lambda: {
      state: 'state',
      stateMessage: 'stateMessage',
    },
    natGateway: {
      state: 'state',
      stateMessage: 'stateMessage',
    },
    virtualPrivateGateway: {
      state: 'state',
      stateMessage: 'stateMessage',
    },
    vpcLattice: {
      state: 'state',
      stateMessage: 'stateMessage',
    },
    vpcPeering: {
      state: 'state',
      stateMessage: 'stateMessage',
    },
  },
  state: 'state',
  stateMessage: 'stateMessage',
  virtualPrivateGatewayExclusion: 'virtualPrivateGatewayExclusion',
  vpcEncryptionControlId: 'vpcEncryptionControlId',
  vpcId: 'vpcId',
  vpcLatticeExclusion: 'vpcLatticeExclusion',
  vpcPeeringExclusion: 'vpcPeeringExclusion',
};
```

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

vpc_encryption_control_property = ec2.CfnVPC.VpcEncryptionControlProperty(
    egress_only_internet_gateway_exclusion="egressOnlyInternetGatewayExclusion",
    elastic_file_system_exclusion="elasticFileSystemExclusion",
    internet_gateway_exclusion="internetGatewayExclusion",
    lambda_exclusion="lambdaExclusion",
    mode="mode",
    nat_gateway_exclusion="natGatewayExclusion",
    resource_exclusions=ec2.CfnVPC.VpcEncryptionControlExclusionsProperty(
        egress_only_internet_gateway=ec2.CfnVPC.VpcEncryptionControlExclusionProperty(
            state="state",
            state_message="stateMessage"
        ),
        elastic_file_system=ec2.CfnVPC.VpcEncryptionControlExclusionProperty(
            state="state",
            state_message="stateMessage"
        ),
        internet_gateway=ec2.CfnVPC.VpcEncryptionControlExclusionProperty(
            state="state",
            state_message="stateMessage"
        ),
        lambda_=ec2.CfnVPC.VpcEncryptionControlExclusionProperty(
            state="state",
            state_message="stateMessage"
        ),
        nat_gateway=ec2.CfnVPC.VpcEncryptionControlExclusionProperty(
            state="state",
            state_message="stateMessage"
        ),
        virtual_private_gateway=ec2.CfnVPC.VpcEncryptionControlExclusionProperty(
            state="state",
            state_message="stateMessage"
        ),
        vpc_lattice=ec2.CfnVPC.VpcEncryptionControlExclusionProperty(
            state="state",
            state_message="stateMessage"
        ),
        vpc_peering=ec2.CfnVPC.VpcEncryptionControlExclusionProperty(
            state="state",
            state_message="stateMessage"
        )
    ),
    state="state",
    state_message="stateMessage",
    virtual_private_gateway_exclusion="virtualPrivateGatewayExclusion",
    vpc_encryption_control_id="vpcEncryptionControlId",
    vpc_id="vpcId",
    vpc_lattice_exclusion="vpcLatticeExclusion",
    vpc_peering_exclusion="vpcPeeringExclusion"
)
```

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

VpcEncryptionControlProperty vpcEncryptionControlProperty = VpcEncryptionControlProperty.builder()
        .egressOnlyInternetGatewayExclusion("egressOnlyInternetGatewayExclusion")
        .elasticFileSystemExclusion("elasticFileSystemExclusion")
        .internetGatewayExclusion("internetGatewayExclusion")
        .lambdaExclusion("lambdaExclusion")
        .mode("mode")
        .natGatewayExclusion("natGatewayExclusion")
        .resourceExclusions(VpcEncryptionControlExclusionsProperty.builder()
                .egressOnlyInternetGateway(VpcEncryptionControlExclusionProperty.builder()
                        .state("state")
                        .stateMessage("stateMessage")
                        .build())
                .elasticFileSystem(VpcEncryptionControlExclusionProperty.builder()
                        .state("state")
                        .stateMessage("stateMessage")
                        .build())
                .internetGateway(VpcEncryptionControlExclusionProperty.builder()
                        .state("state")
                        .stateMessage("stateMessage")
                        .build())
                .lambda(VpcEncryptionControlExclusionProperty.builder()
                        .state("state")
                        .stateMessage("stateMessage")
                        .build())
                .natGateway(VpcEncryptionControlExclusionProperty.builder()
                        .state("state")
                        .stateMessage("stateMessage")
                        .build())
                .virtualPrivateGateway(VpcEncryptionControlExclusionProperty.builder()
                        .state("state")
                        .stateMessage("stateMessage")
                        .build())
                .vpcLattice(VpcEncryptionControlExclusionProperty.builder()
                        .state("state")
                        .stateMessage("stateMessage")
                        .build())
                .vpcPeering(VpcEncryptionControlExclusionProperty.builder()
                        .state("state")
                        .stateMessage("stateMessage")
                        .build())
                .build())
        .state("state")
        .stateMessage("stateMessage")
        .virtualPrivateGatewayExclusion("virtualPrivateGatewayExclusion")
        .vpcEncryptionControlId("vpcEncryptionControlId")
        .vpcId("vpcId")
        .vpcLatticeExclusion("vpcLatticeExclusion")
        .vpcPeeringExclusion("vpcPeeringExclusion")
        .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 vpcEncryptionControlProperty = new VpcEncryptionControlProperty {
    EgressOnlyInternetGatewayExclusion = "egressOnlyInternetGatewayExclusion",
    ElasticFileSystemExclusion = "elasticFileSystemExclusion",
    InternetGatewayExclusion = "internetGatewayExclusion",
    LambdaExclusion = "lambdaExclusion",
    Mode = "mode",
    NatGatewayExclusion = "natGatewayExclusion",
    ResourceExclusions = new VpcEncryptionControlExclusionsProperty {
        EgressOnlyInternetGateway = new VpcEncryptionControlExclusionProperty {
            State = "state",
            StateMessage = "stateMessage"
        },
        ElasticFileSystem = new VpcEncryptionControlExclusionProperty {
            State = "state",
            StateMessage = "stateMessage"
        },
        InternetGateway = new VpcEncryptionControlExclusionProperty {
            State = "state",
            StateMessage = "stateMessage"
        },
        Lambda = new VpcEncryptionControlExclusionProperty {
            State = "state",
            StateMessage = "stateMessage"
        },
        NatGateway = new VpcEncryptionControlExclusionProperty {
            State = "state",
            StateMessage = "stateMessage"
        },
        VirtualPrivateGateway = new VpcEncryptionControlExclusionProperty {
            State = "state",
            StateMessage = "stateMessage"
        },
        VpcLattice = new VpcEncryptionControlExclusionProperty {
            State = "state",
            StateMessage = "stateMessage"
        },
        VpcPeering = new VpcEncryptionControlExclusionProperty {
            State = "state",
            StateMessage = "stateMessage"
        }
    },
    State = "state",
    StateMessage = "stateMessage",
    VirtualPrivateGatewayExclusion = "virtualPrivateGatewayExclusion",
    VpcEncryptionControlId = "vpcEncryptionControlId",
    VpcId = "vpcId",
    VpcLatticeExclusion = "vpcLatticeExclusion",
    VpcPeeringExclusion = "vpcPeeringExclusion"
};
```

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"

vpcEncryptionControlProperty := &VpcEncryptionControlProperty{
	EgressOnlyInternetGatewayExclusion: jsii.String("egressOnlyInternetGatewayExclusion"),
	ElasticFileSystemExclusion: jsii.String("elasticFileSystemExclusion"),
	InternetGatewayExclusion: jsii.String("internetGatewayExclusion"),
	LambdaExclusion: jsii.String("lambdaExclusion"),
	Mode: jsii.String("mode"),
	NatGatewayExclusion: jsii.String("natGatewayExclusion"),
	ResourceExclusions: &VpcEncryptionControlExclusionsProperty{
		EgressOnlyInternetGateway: &VpcEncryptionControlExclusionProperty{
			State: jsii.String("state"),
			StateMessage: jsii.String("stateMessage"),
		},
		ElasticFileSystem: &VpcEncryptionControlExclusionProperty{
			State: jsii.String("state"),
			StateMessage: jsii.String("stateMessage"),
		},
		InternetGateway: &VpcEncryptionControlExclusionProperty{
			State: jsii.String("state"),
			StateMessage: jsii.String("stateMessage"),
		},
		Lambda: &VpcEncryptionControlExclusionProperty{
			State: jsii.String("state"),
			StateMessage: jsii.String("stateMessage"),
		},
		NatGateway: &VpcEncryptionControlExclusionProperty{
			State: jsii.String("state"),
			StateMessage: jsii.String("stateMessage"),
		},
		VirtualPrivateGateway: &VpcEncryptionControlExclusionProperty{
			State: jsii.String("state"),
			StateMessage: jsii.String("stateMessage"),
		},
		VpcLattice: &VpcEncryptionControlExclusionProperty{
			State: jsii.String("state"),
			StateMessage: jsii.String("stateMessage"),
		},
		VpcPeering: &VpcEncryptionControlExclusionProperty{
			State: jsii.String("state"),
			StateMessage: jsii.String("stateMessage"),
		},
	},
	State: jsii.String("state"),
	StateMessage: jsii.String("stateMessage"),
	VirtualPrivateGatewayExclusion: jsii.String("virtualPrivateGatewayExclusion"),
	VpcEncryptionControlId: jsii.String("vpcEncryptionControlId"),
	VpcId: jsii.String("vpcId"),
	VpcLatticeExclusion: jsii.String("vpcLatticeExclusion"),
	VpcPeeringExclusion: jsii.String("vpcPeeringExclusion"),
}
```

## Properties

- `egressOnlyInternetGatewayExclusion`: string

- `elasticFileSystemExclusion`: string

- `internetGatewayExclusion`: string

- `lambdaExclusion`: string

- `mode`: string — The encryption mode for the VPC Encryption Control configuration.

- `natGatewayExclusion`: string

- `resourceExclusions`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnVPC.VpcEncryptionControlExclusionsProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnVPC.VpcEncryptionControlExclusionsProperty.html) — Describes the exclusion configurations for various resource types in VPC Encryption Control.

  For more information, see [Enforce VPC encryption in transit](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-encryption-controls.html) in the *Amazon VPC User Guide*.

- `state`: string — The current state of the VPC Encryption Control configuration.

- `stateMessage`: string — A message providing additional information about the encryption control state.

- `virtualPrivateGatewayExclusion`: string

- `vpcEncryptionControlId`: string — The ID of the VPC Encryption Control configuration.

- `vpcId`: string — The ID of the VPC associated with the encryption control configuration.

- `vpcLatticeExclusion`: string

- `vpcPeeringExclusion`: string
