update_cluster
async
¶
update_cluster(
cluster: String,
*,
config_overrides: Optional[AsyncECSClientConfig] = 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.
>>> await 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.
>>> await client.update_cluster(cluster='ECS-project-update-cluster', service_connect_defaults={'namespace': 'test'})
Source code in docs_src/capo_ecs/_services/async_ecs.py
1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 | |