ALIYUN::ECS::Invocation is used to run a Cloud Assistant command on Elastic Compute Service (ECS) instances.
Syntax
{
"Type": "ALIYUN::ECS::Invocation",
"Properties": {
"Frequency": String,
"CommandId": String,
"Parameters": Map,
"InstanceIds": List,
"Sync": Boolean,
"CommandName": String,
"WindowsPasswordName": String,
"Timeout": Integer,
"RepeatMode": String,
"ResourceGroupId": String,
"ContainerName": String,
"ContainerId": String,
"Username": String,
"Tags": List
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
Frequency | String | No | No | The schedule on which the command is run. For information about the value structures, see Cron expression. | None |
CommandId | String | No | Yes | The command ID. | None |
InstanceIds | List | Yes | Yes | The IDs of the ECS instances on which you want to run the command. | You can specify up to 20 instance IDs. |
Parameters | Map | No | Yes | The key-value pairs of the custom parameters that you want to pass to the command when the custom parameter feature is enabled. Example: | You can specify up to 10 custom parameters. Each key in a Map collection cannot be an empty string, and can be up to 64 characters in length. Each value in a Map collection can be an empty string. After the custom parameters and the original command content are Base64-encoded, the total size cannot exceed 16 KB. The set of custom parameter names must be a subset of the parameter set that you specify when you create the command. You can use empty strings to represent the parameters that are not passed in. |
Sync | Boolean | No | No | Specifies whether to run the command synchronously. | Valid values:
|
CommandName | String | No | No | The command name. | None |
WindowsPasswordName | String | No | No | The username of the password that you 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, specify the WindowsPasswordName and Note If you use the root user for Linux instances or the System user for Windows instances to run the command, you do not need to specify the WindowsPasswordName property. |
Timeout | Integer | No | Yes | The timeout period for command execution. Unit: seconds. | Take note of the following items when you specify this property:
|
RepeatMode | String | No | No | The mode in which you want to run the command. | Valid values:
Default values:
Take note of the following items when you specify this property:
|
ResourceGroupId | String | No | No | The ID of the resource group. | Take note of the following items when you specify this property:
|
ContainerName | String | No | No | The container name. | Take note of the following items when you specify this property:
|
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 when you specify this property:
|
Username | String | No | No | The username that you use to run the command on 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. |
Tags | List | No | No | The tags. | You can specify up to 20 tags in the following format: For more information, see Tags properties. |
Tags syntax
"Tags": [
{
"Value": String,
"Key": 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
InvokeId: the invocation ID of the command.
InvokeInstances: the instances on which the command is run.
InvokeResults: the results of command execution.
If you want to run the command only once, see ALIYUN::ECS::RunCommand.