update_daemon
async
¶
update_daemon(
daemon_arn: String,
daemon_task_definition_arn: String,
capacity_provider_arns: StringList,
*,
config_overrides: Optional[AsyncECSClientConfig] = None,
deployment_configuration: Optional[DaemonDeploymentConfiguration] = None,
propagate_tags: Optional[DaemonPropagateTags] = None,
enable_ecs_managed_tags: Optional[Boolean] = None,
enable_execute_command: Optional[Boolean] = None,
critical: Optional[BoxedBoolean] = None,
) -> UpdateDaemonResponse
Updates the specified daemon. When you update a daemon, a new deployment is triggered that progressively rolls out the changes to the container instances associated with the daemon's capacity providers. For more information, see Daemon deployments in the Amazon Elastic Container Service Developer Guide.
Amazon ECS drains existing container instances and provisions new instances with the updated daemon. Amazon ECS automatically launches replacement tasks for your services.
Updating a daemon triggers a rolling deployment that drains and replaces container instances. Plan updates during maintenance windows to minimize impact on running services.
ECS Managed Daemons is only supported for Amazon ECS Managed Instances Capacity Providers.
Parameters:
-
daemon_arn(String) –The Amazon Resource Name (ARN) of the daemon to update.
-
daemon_task_definition_arn(String) –The Amazon Resource Name (ARN) of the daemon task definition to use for the updated daemon.
-
capacity_provider_arns(StringList) –The Amazon Resource Names (ARNs) of the capacity providers to associate with the daemon.
-
deployment_configuration(Optional[DaemonDeploymentConfiguration], default:None) –Optional deployment parameters that control how the daemon rolls out updates, including the drain percentage, alarm-based rollback, and bake time.
-
propagate_tags(Optional[DaemonPropagateTags], default:None) –Specifies whether to propagate the tags from the daemon to the daemon tasks. If you don't specify a value, the tags aren't propagated. You can only propagate tags to daemon tasks during task creation.
-
enable_ecs_managed_tags(Optional[Boolean], default:None) –Specifies whether to turn on Amazon ECS managed tags for the tasks in the daemon. For more information, see Tagging your Amazon ECS resources in the Amazon Elastic Container Service Developer Guide.
-
enable_execute_command(Optional[Boolean], default:None) –If
true, the execute command functionality is turned on for all tasks in the daemon. Iffalse, the execute command functionality is turned off. -
critical(Optional[BoxedBoolean], default:None) –If the
criticalparameter of a daemon istrue, and the daemon task fails, stops, or becomes unhealthy, Amazon ECS drains the container instance and stops the other tasks running on it. If thecriticalparameter isfalse, the daemon task failure doesn't affect the other tasks on the instance. The default value istrue.A non-critical daemon doesn't block instance registration. The container instance becomes active and continues to run your other tasks, whether the daemon task fails during scale-out or during a deployment.
Amazon ECS emits an EventBridge event when a daemon task fails to start, for both critical and non-critical daemons.
Daemon task launch failures during a deployment are still counted by the deployment circuit breaker. The circuit breaker can roll back an unstable target revision.
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.
-
DaemonNotActiveException–The specified daemon isn't active. You can't update a daemon that's inactive. If you have previously deleted a daemon, you can re-create it with CreateDaemon.
-
DaemonNotFoundException–The specified daemon wasn't found. You can view your available daemons with ListDaemons. Amazon ECS daemons are cluster specific and 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.
-
PlatformUnknownException–The specified platform version doesn't exist.
-
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 daemon This example updates the my-monitoring-daemon daemon to use a new daemon task definition revision.
>>> await client.update_daemon(daemon_arn='arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon', daemon_task_definition_arn='arn:aws:ecs:us-east-1:123456789012:daemon-task-definition/monitoring-agent:2', capacity_provider_arns=['arn:aws:ecs:us-east-1:123456789012:capacity-provider/my-capacity-provider'], deployment_configuration={'drainPercent': 10.0, 'bakeTimeInMinutes': 5})
Source code in docs_src/capo_ecs/_services/async_ecs.py
3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 | |