ECS / Client / create_daemon
create_daemon¶
- ECS.Client.create_daemon(**kwargs)¶
Creates a new daemon in the specified cluster and capacity providers. A daemon deploys cross-cutting software agents such as security monitoring, telemetry, and logging independently across your Amazon ECS infrastructure.
Amazon ECS deploys exactly one daemon task on each container instance of the specified capacity providers. When a container instance registers with the cluster, Amazon ECS automatically starts daemon tasks. Amazon ECS starts a daemon task before scheduling other tasks.
Daemons are essential for instance health - if a daemon task stops, Amazon ECS automatically drains and replaces that container instance.
Note
ECS Managed Daemons is only supported for Amazon ECS Managed Instances Capacity Providers.
See also: AWS API Documentation
Request Syntax
response = client.create_daemon( daemonName='string', clusterArn='string', daemonTaskDefinitionArn='string', capacityProviderArns=[ 'string', ], deploymentConfiguration={ 'drainPercent': 123.0, 'alarms': { 'alarmNames': [ 'string', ], 'enable': True|False }, 'bakeTimeInMinutes': 123 }, tags=[ { 'key': 'string', 'value': 'string' }, ], propagateTags='DAEMON'|'NONE', enableECSManagedTags=True|False, enableExecuteCommand=True|False, clientToken='string' )
- Parameters:
daemonName (string) –
[REQUIRED]
The name of the daemon. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.
clusterArn (string) – The Amazon Resource Name (ARN) of the cluster to create the daemon in.
daemonTaskDefinitionArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the daemon task definition to use for the daemon.
capacityProviderArns (list) –
[REQUIRED]
The Amazon Resource Names (ARNs) of the capacity providers to associate with the daemon. The daemon deploys tasks on container instances managed by these capacity providers.
(string) –
deploymentConfiguration (dict) –
Optional deployment parameters that control how the daemon rolls out updates, including the drain percentage, alarm-based rollback, and bake time.
drainPercent (float) –
The percentage of container instances to drain simultaneously during a daemon deployment. Valid values are between 0.0 and 100.0.
alarms (dict) –
The CloudWatch alarm configuration for the daemon deployment. When alarms are triggered during a deployment, the deployment can be automatically rolled back.
alarmNames (list) –
The CloudWatch alarm names to monitor during a daemon deployment.
(string) –
enable (boolean) –
Determines whether to use the CloudWatch alarm option in the daemon deployment process. The default value is
false.
bakeTimeInMinutes (integer) –
The amount of time (in minutes) to wait after a successful deployment step before proceeding. This allows time to monitor for issues before continuing. The default value is 0.
tags (list) –
The metadata that you apply to the daemon to help you categorize and organize them. Each tag consists of a key and an optional value. You define both of them.
The following basic restrictions apply to tags:
Maximum number of tags per resource - 50
For each resource, each tag key must be unique, and each tag key can have only one value.
Maximum key length - 128 Unicode characters in UTF-8
Maximum value length - 256 Unicode characters in UTF-8
If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
Tag keys and values are case-sensitive.
Do not use
aws:,AWS:, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.
(dict) –
The metadata that you apply to a resource to help you categorize and organize them. Each tag consists of a key and an optional value. You define them.
The following basic restrictions apply to tags:
Maximum number of tags per resource - 50
For each resource, each tag key must be unique, and each tag key can have only one value.
Maximum key length - 128 Unicode characters in UTF-8
Maximum value length - 256 Unicode characters in UTF-8
If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.
Tag keys and values are case-sensitive.
Do not use
aws:,AWS:, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.
key (string) –
One part of a key-value pair that make up a tag. A
keyis a general label that acts like a category for more specific tag values.value (string) –
The optional part of a key-value pair that make up a tag. A
valueacts as a descriptor within a tag category (key).
propagateTags (string) – 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. To add tags to a task after task creation, use the TagResource API action.
enableECSManagedTags (boolean) – 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.
enableExecuteCommand (boolean) – Determines whether the execute command functionality is turned on for the daemon. If
true, the execute command functionality is turned on for all tasks in the daemon.clientToken (string) – An identifier that you provide to ensure the idempotency of the request. It must be unique and is case sensitive. Up to 36 ASCII characters in the range of 33-126 (inclusive) are allowed.
- Return type:
dict
- Returns:
Response Syntax
{ 'daemonArn': 'string', 'status': 'ACTIVE'|'DELETE_IN_PROGRESS', 'createdAt': datetime(2015, 1, 1), 'deploymentArn': 'string' }
Response Structure
(dict) –
daemonArn (string) –
The Amazon Resource Name (ARN) of the daemon.
status (string) –
The status of the daemon.
createdAt (datetime) –
The Unix timestamp for the time when the daemon was created.
deploymentArn (string) –
The Amazon Resource Name (ARN) of the initial daemon deployment. This deployment places daemon tasks on each container instance of the specified capacity providers.
Exceptions
ECS.Client.exceptions.AccessDeniedExceptionECS.Client.exceptions.PlatformUnknownExceptionECS.Client.exceptions.ServerExceptionECS.Client.exceptions.InvalidParameterExceptionECS.Client.exceptions.ClientExceptionECS.Client.exceptions.ClusterNotFoundExceptionECS.Client.exceptions.UnsupportedFeatureException