Skip to content
v2.274.0

AwsVpcConfigurationProperty Struct ​

An object representing the networking details for a task or service.

For example awsVpcConfiguration={subnets=["subnet-12344321"],securityGroups=["sg-12344321"]} .

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 awsVpcConfigurationProperty: ecs.CfnService.AwsVpcConfigurationProperty = {
  assignPublicIp: 'assignPublicIp',
  securityGroups: ['securityGroups'],
  subnets: ['subnets'],
};

Properties ​

assignPublicIpstringassign_public_ipstrassignPublicIpStringAssignPublicIpstringAssignPublicIp*string#
Whether the task's elastic network interface receives a public IP address.

Consider the following when you set this value:

  • When you use create-service or update-service , the default is DISABLED .
  • When the service deploymentController is ECS , the value must be DISABLED .
securityGroupsstring[]security_groupstyping.List[str]securityGroupsList<String>SecurityGroupsstring[]SecurityGroups*[]*string#
The IDs of the security groups associated with the task or service.

If you don't specify a security group, the default security group for the VPC is used. There's a limit of 5 security groups that can be specified.

All specified security groups must be from the same VPC.

subnetsstring[]subnetstyping.List[str]subnetsList<String>Subnetsstring[]Subnets*[]*string#
The IDs of the subnets associated with the task or service.

There's a limit of 16 subnets that can be specified.

All specified subnets must be from the same VPC.