# 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.CfnService.NetworkConfigurationProperty = {
  awsvpcConfiguration: {
    assignPublicIp: 'assignPublicIp',
    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

network_configuration_property = ecs.CfnService.NetworkConfigurationProperty(
    awsvpc_configuration=ecs.CfnService.AwsVpcConfigurationProperty(
        assign_public_ip="assignPublicIp",
        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.*;

NetworkConfigurationProperty networkConfigurationProperty = NetworkConfigurationProperty.builder()
        .awsvpcConfiguration(AwsVpcConfigurationProperty.builder()
                .assignPublicIp("assignPublicIp")
                .securityGroups(List.of("securityGroups"))
                .subnets(List.of("subnets"))
                .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 {
        AssignPublicIp = "assignPublicIp",
        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"

networkConfigurationProperty := &NetworkConfigurationProperty{
	AwsvpcConfiguration: &AwsVpcConfigurationProperty{
		AssignPublicIp: jsii.String("assignPublicIp"),
		SecurityGroups: []*string{
			jsii.String("securityGroups"),
		},
		Subnets: []*string{
			jsii.String("subnets"),
		},
	},
}
```

## Properties

- `awsvpcConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnService.AwsVpcConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CfnService.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.
