update_capacity_provider
¶
update_capacity_provider(
name: String,
*,
config_overrides: Optional[ECSClientConfig] = None,
cluster: Optional[String] = None,
auto_scaling_group_provider: Optional[AutoScalingGroupProviderUpdate] = None,
managed_instances_provider: Optional[
UpdateManagedInstancesProviderConfiguration
] = None,
) -> UpdateCapacityProviderResponse
Modifies the parameters for a capacity provider.
These changes only apply to new Amazon ECS Managed Instances, or EC2 instances, not existing ones.
Parameters:
-
name(String) –The name of the capacity provider to update.
-
cluster(Optional[String], default:None) –The name of the cluster that contains the capacity provider to update. Managed instances capacity providers are cluster-scoped and can only be updated within their associated cluster.
-
auto_scaling_group_provider(Optional[AutoScalingGroupProviderUpdate], default:None) –An object that represent the parameters to update for the Auto Scaling group capacity provider.
-
managed_instances_provider(Optional[UpdateManagedInstancesProviderConfiguration], default:None) –The updated configuration for the Amazon ECS Managed Instances provider. You can modify the infrastructure role, instance launch template, and tag propagation settings. Changes take effect for new instances launched after the update.
Raises:
-
AccessDeniedException–You don't have authorization to perform the requested action.
-
ClientException–These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.
-
ClusterNotFoundException–The specified cluster wasn't found. You can view your available clusters with ListClusters. Amazon ECS clusters are Region specific.
-
InvalidParameterException–The specified parameter isn't valid. Review the available parameters for the API request.
For more information about service event errors, see Amazon ECS service event messages.
-
ServerException–These errors are usually caused by a server issue.
-
UnsupportedFeatureException–The specified task isn't supported in this Region.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To update a capacity provider's parameters This example updates the targetCapacity and instanceWarmupPeriod parameters for the capacity provider MyCapacityProvider to 90 and 150 respectively.
>>> client.update_capacity_provider(name='MyCapacityProvider', auto_scaling_group_provider={'managedScaling': {'status': 'ENABLED', 'targetCapacity': 90, 'instanceWarmupPeriod': 150}})
Source code in docs_src/capo_ecs/_services/ecs.py
1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 | |