NetworkConfigurationProperty Struct
The network configuration for a task or service.
Example
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
# 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
// 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();
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" }
}
};
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
awsVpcConfigurationoptionalIResolvable | CfnTaskSet.AwsVpcConfigurationPropertyaws_vpc_configurationoptionaltyping.Union[IResolvable, AwsVpcConfigurationProperty]awsVpcConfigurationoptionalIResolvableAwsVpcConfigurationoptionalIResolvableAwsVpcConfigurationoptionalinterface{}#The VPC subnets and security groups that are associated with a task.
All specified subnets and security groups must be from the same VPC.