ALIYUN::ECS::Command is used to create a Cloud Assistant command.
Syntax
{
"Type": "ALIYUN::ECS::Command",
"Properties": {
"Name": String,
"WorkingDir": String,
"CommandContent": String,
"Timeout": Integer,
"Type": String,
"Description": String,
"EnableParameter": Boolean,
"Username": String,
"WindowsPasswordName": String,
"ResourceGroupId": String,
"ContainerName": String,
"ContainerId": String,
"RepeatMode": String
"Tags": List
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
Name | String | No | Yes | The command name. | The command name must be 1 to 128 characters in length. All character sets are supported. |
WorkingDir | String | No | Yes | The working directory of the command on the Elastic Compute Service (ECS) instance. | Default values:
|
CommandContent | String | No | No | The Base64-encoded content of the command. | The value of this property must be Base64-encoded and can be up to 16 KB in size. You can define custom parameters in the command content. To use custom parameters, you must set EnableParameter to true.
|
Timeout | Integer | No | Yes | The timeout period for running the command on the ECS instance. | If the command fails to run within the specified period, the command times out. When a command execution times out, Cloud Assistant Agent forcefully terminates the command process by canceling the process ID (PID). Default value: 60. Unit: seconds. |
Type | String | Yes | No | The command type. | Valid values:
|
Description | String | No | Yes | The description of the command. | The description must be 1 to 512 characters in length. All character sets are supported. |
EnableParameter | Boolean | No | No | Specifies whether to use custom parameters in the command. | Valid values:
|
Tags | List | No | No | The tags of the instance. You can add up to 20 tags. | For more information, see Tags properties. |
RepeatMode | String | No | No | The mode in which you want to run the command. | Valid values:
Default values:
Take note of the following items:
|
ResourceGroupId | String | No | No | The ID of the resource group. | Take note of the following items when you specify ResourceGroupId:
|
ContainerName | String | No | No | The container name. | Take note of the following items:
|
ContainerId | String | No | No | The container ID. | Only 64-bit hexadecimal strings are supported. You can use container IDs that are prefixed with Take note of the following items:
|
Username | String | No | No | The username that you want to use to run the command on ECS instances. | The username can be up to 255 characters in length.
You can also specify other usernames that already exist on the instances to run the command. For security purposes, we recommend that you run Cloud Assistant commands as a regular user. For more information, see Run Cloud Assistant commands as a regular user. |
WindowsPasswordName | String | No | No | The name of the password that you want to use to run the command on Windows instances. | The name can be up to 255 characters in length. If you do not want to use the default System user to run the command on Windows instances, you must specify both WindowsPasswordName and Note You do not need to specify this property when you use the root user of a Linux instance or the System user of a Windows instance to run the command. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | Yes | No | The tag key. | The tag key must be 1 to 128 characters in length, and cannot contain |
Value | String | No | No | The tag value. | The tag value can be up to 128 characters in length, and cannot contain |
Return values
Fn::GetAtt
CommandId: the command ID.
You can run the command only once. For more information, see ALIYUN::ECS::RunCommand.