Create Capacity Provider

Create a Capacity Provider

  1. Open the Amazon ECS console.

  2. On the navigation bar at the top of the screen, select default region.

  3. In the navigation pane, choose Clusters.

  4. On the Clusters page, select your ecs-cluster-tripmgmtdemo cluster.

  5. On the Capacity Providers tab, choose Create.

  6. On the Create Capacity Providers window, do the following.

    1. For Capacity provider name, enter capprvdr-ecs-tripmgmtdemo for the name.
    2. For Auto Scaling group, select the ASG-TripmgmtDemo Auto Scaling group you created.
    3. For Managed scaling, choose Enabled. This enables Amazon ECS to manage the scale-in and scale-out actions for the capacity provider.
    4. For Target capacity %, enter 80.
    5. For Managed termination protection, choose Enabled. This prevents your container instances that contain tasks and that are in the Auto Scaling group from being terminated during a scale-in action.
    6. Choose Create.
  7. Choose View in cluster to see your new capacity provider.

  8. Repeat steps 4 to 6, creating a second capacity provider with name burst-capprvdr-ecs-tripmgmtdemo with your ASG-TripmgmtDemo-burst Auto Scaling group.

Set a Default Capacity Provider Strategy for the Cluster

When running a task or creating a service, the Amazon ECS console uses the default capacity provider strategy for the cluster. The default capacity provider strategy can be defined by updating the cluster.

  1. Open the Amazon ECS console.
  2. On the navigation bar at the top of the screen, select default region.
  3. In the navigation pane, choose Clusters.
  4. On the Clusters page, select your ecs-cluster-tripmgmtdemo cluster.
  5. On the Cluster : ecs-cluster-tripmgmtdemo page, choose Update Cluster.
  6. For Default capacity provider strategy choose, Add another provider.
  7. Select your capprovider-ecs-tripmgmtdemo capacity provider.
  8. Choose Add another provider, select your burst-capprovider-ecs-tripmgmtdemo capacity provider.
  9. Leave the Base value at 0 and leave the Weight value at 1.
  10. Choose Update. This will add the capacity providers to the default capacity provider strategy for the cluster.
  11. Choose View cluster.