# ManagedInstancesNetworkConfigurationProperty

The network configuration for Amazon ECS Managed Instances.

This specifies the VPC subnets and security groups that instances use for network connectivity. Amazon ECS Managed Instances support multiple network modes including `awsvpc` (instances receive ENIs for task isolation), `host` (instances share network namespace with tasks), and `none` (no external network connectivity), ensuring backward compatibility for migrating workloads from Fargate or Amazon EC2.

- Source: Generated at build time
- Type last changed: v2.235.0 · 15 Jan 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_ecs as ecs } from 'aws-cdk-lib';
const managedInstancesNetworkConfigurationProperty: ecs.CfnCapacityProvider.ManagedInstancesNetworkConfigurationProperty = {
  securityGroups: ['securityGroups'],
  subnets: ['subnets'],
};
```

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_ecs as ecs

managed_instances_network_configuration_property = ecs.CfnCapacityProvider.ManagedInstancesNetworkConfigurationProperty(
    security_groups=["securityGroups"],
    subnets=["subnets"]
)
```

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

ManagedInstancesNetworkConfigurationProperty managedInstancesNetworkConfigurationProperty = ManagedInstancesNetworkConfigurationProperty.builder()
        .securityGroups(List.of("securityGroups"))
        .subnets(List.of("subnets"))
        .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.ECS;

var managedInstancesNetworkConfigurationProperty = new ManagedInstancesNetworkConfigurationProperty {
    SecurityGroups = new [] { "securityGroups" },
    Subnets = new [] { "subnets" }
};
```

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"

managedInstancesNetworkConfigurationProperty := &ManagedInstancesNetworkConfigurationProperty{
	SecurityGroups: []*string{
		jsii.String("securityGroups"),
	},
	Subnets: []*string{
		jsii.String("subnets"),
	},
}
```

## Properties

- `securityGroups`: string[] (required) — The list of security group IDs to apply to Amazon ECS Managed Instances.

  These security groups control the network traffic allowed to and from the instances.

- `subnets`: string[] (required) — The list of subnet IDs where Amazon ECS can launch Amazon ECS Managed Instances.

  Instances are distributed across the specified subnets for high availability. All subnets must be in the same VPC.
