# NetworkConfigurationProperty

The network configuration for a task or service.

- 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_ecs as ecs } from 'aws-cdk-lib';
const networkConfigurationProperty: ecs.CfnTaskSet.NetworkConfigurationProperty = {
  awsVpcConfiguration: {
    subnets: ['subnets'],

    // the properties below are optional
    assignPublicIp: 'assignPublicIp',
    securityGroups: ['securityGroups'],
  },
};
```

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

network_configuration_property = ecs.CfnTaskSet.NetworkConfigurationProperty(
    aws_vpc_configuration=ecs.CfnTaskSet.AwsVpcConfigurationProperty(
        subnets=["subnets"],

        # the properties below are optional
        assign_public_ip="assignPublicIp",
        security_groups=["securityGroups"]
    )
)
```

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

NetworkConfigurationProperty networkConfigurationProperty = NetworkConfigurationProperty.builder()
        .awsVpcConfiguration(AwsVpcConfigurationProperty.builder()
                .subnets(List.of("subnets"))

                // the properties below are optional
                .assignPublicIp("assignPublicIp")
                .securityGroups(List.of("securityGroups"))
                .build())
        .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 networkConfigurationProperty = new NetworkConfigurationProperty {
    AwsVpcConfiguration = new AwsVpcConfigurationProperty {
        Subnets = new [] { "subnets" },

        // the properties below are optional
        AssignPublicIp = "assignPublicIp",
        SecurityGroups = new [] { "securityGroups" }
    }
};
```

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"

networkConfigurationProperty := &NetworkConfigurationProperty{
	AwsVpcConfiguration: &AwsVpcConfigurationProperty{
		Subnets: []*string{
			jsii.String("subnets"),
		},

		// the properties below are optional
		AssignPublicIp: jsii.String("assignPublicIp"),
		SecurityGroups: []*string{
			jsii.String("securityGroups"),
		},
	},
}
```

## Properties

- `awsVpcConfiguration`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTaskSet.AwsVpcConfigurationProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnTaskSet.AwsVpcConfigurationProperty.html) — The VPC subnets and security groups that are associated with a task.

  > All specified subnets and security groups must be from the same VPC.
