update_capacity_provider
async
¶
update_capacity_provider(
name: String,
*,
config_overrides: Optional[AsyncECSClientConfig] = 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.
>>> await 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/async_ecs.py
1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 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 | |