Interface Ec2ServiceProps
- All Superinterfaces:
BaseServiceOptions
,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
Ec2ServiceProps.Jsii$Proxy
Example:
Cluster cluster; TaskDefinition taskDefinition; Vpc vpc; Ec2Service service = Ec2Service.Builder.create(this, "Service").cluster(cluster).taskDefinition(taskDefinition).build(); LoadBalancer lb = LoadBalancer.Builder.create(this, "LB").vpc(vpc).build(); lb.addListener(LoadBalancerListener.builder().externalPort(80).build()); lb.addTarget(service.loadBalancerTarget(LoadBalancerTargetOptions.builder() .containerName("MyContainer") .containerPort(80) .build()));
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forEc2ServiceProps
static final class
An implementation forEc2ServiceProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic Ec2ServiceProps.Builder
builder()
default Boolean
Specifies whether the task's elastic network interface receives a public IP address.default Boolean
Specifies whether the service will use the daemon scheduling strategy.default List<PlacementConstraint>
The placement constraints to use for tasks in the service.default List<PlacementStrategy>
The placement strategies to use for tasks in the service.default ISecurityGroup
Deprecated.use securityGroups instead.default List<ISecurityGroup>
The security groups to associate with the service.The task definition to use for tasks in the service.default SubnetSelection
The subnets to associate with the service.Methods inherited from interface software.amazon.awscdk.services.ecs.BaseServiceOptions
getCapacityProviderStrategies, getCircuitBreaker, getCloudMapOptions, getCluster, getDeploymentController, getDesiredCount, getEnableECSManagedTags, getEnableExecuteCommand, getHealthCheckGracePeriod, getMaxHealthyPercent, getMinHealthyPercent, getPropagateTags, getPropagateTaskTagsFrom, getServiceName
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getTaskDefinition
The task definition to use for tasks in the service.[disable-awslint:ref-via-interface]
-
getAssignPublicIp
Specifies whether the task's elastic network interface receives a public IP address.If true, each task will receive a public IP address.
This property is only used for tasks that use the awsvpc network mode.
Default: false
-
getDaemon
Specifies whether the service will use the daemon scheduling strategy.If true, the service scheduler deploys exactly one task on each container instance in your cluster.
When you are using this strategy, do not specify a desired number of tasks orany task placement strategies.
Default: false
-
getPlacementConstraints
The placement constraints to use for tasks in the service.For more information, see Amazon ECS Task Placement Constraints.
Default: - No constraints.
-
getPlacementStrategies
The placement strategies to use for tasks in the service.For more information, see Amazon ECS Task Placement Strategies.
Default: - No strategies.
-
getSecurityGroup
Deprecated.use securityGroups instead.(deprecated) The security groups to associate with the service.If you do not specify a security group, a new security group is created.
This property is only used for tasks that use the awsvpc network mode.
Default: - A new security group is created.
-
getSecurityGroups
The security groups to associate with the service.If you do not specify a security group, a new security group is created.
This property is only used for tasks that use the awsvpc network mode.
Default: - A new security group is created.
-
getVpcSubnets
The subnets to associate with the service.This property is only used for tasks that use the awsvpc network mode.
Default: - Public subnets if `assignPublicIp` is set, otherwise the first available one of Private, Isolated, Public, in that order.
-
builder
- Returns:
- a
Ec2ServiceProps.Builder
ofEc2ServiceProps
-