Skip to content

Commit f758729

Browse files
committed
Add CapacityOptionType description to README.md
1 parent 1fccba3 commit f758729

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/aws-cdk-lib/aws-ecs/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,8 @@ new ecs.Ec2Service(this, 'EC2Service', {
16631663

16641664
Managed Instances Capacity Providers allow you to use AWS-managed EC2 instances for your ECS tasks while providing more control over instance selection than standard Fargate. AWS handles the instance lifecycle, patching, and maintenance while you can specify detailed instance requirements. You can define detailed instance requirements to control which types of instances are used for your workloads.
16651665

1666+
Capacity Option Type provides the purchasing option for the EC2 instances used in the capacity provider. Determines whether to use On-Demand or Spot instances. Valid values are `ON_DEMAND` and `SPOT`. Defaults to `ON_DEMAND` when not specified. Changing this value will trigger replacement of the capacity provider. For more information, see [Amazon EC2 billing and purchasing options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html) in the Amazon EC2 User Guide.
1667+
16661668
See [ECS documentation for Managed Instances Capacity Provider](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/managed-instances-capacity-providers-concept.html) for more documentation.
16671669

16681670
#### IAM Roles Setup
@@ -1675,12 +1677,9 @@ declare const vpc: ec2.Vpc;
16751677
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
16761678

16771679
const miCapacityProvider = new ecs.ManagedInstancesCapacityProvider(this, 'MICapacityProvider', {
1678-
<<<<<<< HEAD
1679-
=======
16801680
infrastructureRole,
1681-
capacityOptionType: ecs.CapacityOptionType.SPOT, // Optionally specify whether capacity should be ON_DEMAND or SPOT
1681+
capacityOptionType: ecs.CapacityOptionType.SPOT,
16821682
ec2InstanceProfile: instanceProfile,
1683-
>>>>>>> 0c4467efa0 (feat(ecs): add capacityOptionType (SPOT) to ManagedInstances config)
16841683
subnets: vpc.privateSubnets,
16851684
instanceRequirements: {
16861685
vCpuCountMin: 1,

0 commit comments

Comments
 (0)