update_cluster
¶
update_cluster(
cluster: String,
*,
config_overrides: Optional[ECSClientConfig] = None,
settings: Optional[ClusterSettings] = None,
configuration: Optional[ClusterConfiguration] = None,
service_connect_defaults: Optional[ClusterServiceConnectDefaultsRequest] = None,
) -> UpdateClusterResponse
Updates the cluster.
Parameters:
-
cluster(String) –The name of the cluster to modify the settings for.
-
settings(Optional[ClusterSettings], default:None) –The cluster settings for your cluster.
-
configuration(Optional[ClusterConfiguration], default:None) –The execute command configuration for the cluster.
-
service_connect_defaults(Optional[ClusterServiceConnectDefaultsRequest], default:None) –Use this parameter to set a default Service Connect namespace. After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the
enabledparameter totruein theServiceConnectConfiguration. You can set the namespace of each service individually in theServiceConnectConfigurationto override this default parameter.Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.
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.
-
NamespaceNotFoundException–The specified namespace wasn't found.
-
ServerException–These errors are usually caused by a server issue.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To update a cluster's observability settings. This example turns on enhanced containerInsights in an existing cluster.
>>> client.update_cluster(cluster='ECS-project-update-cluster', settings=[{'name': 'containerInsights', 'value': 'enhanced'}])
To update a cluster's Service Connect defaults.
This example sets a default Service Connect namespace.
>>> client.update_cluster(cluster='ECS-project-update-cluster', service_connect_defaults={'namespace': 'test'})
Source code in docs_src/capo_ecs/_services/ecs.py
1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 | |