Creating a command alias in AWS Chatbot - AWS Chatbot

Creating a command alias in AWS Chatbot

You can create command aliases using the CreateCustomAction action and providing an AliasName, or by running:

@aws alias create alias_name mapped_action.

Note

The command alias definition can contain additional parameters. Also note that alias_name has a 100 character limit and mapped_action has a 5,000 character limit.

For example, in this alias:

@aws alias create automation ssm start-automation-execution --document-name $name --parameters { "AutomationAssumeRole": ["arn:aws:iam::123456789012:role/$role-name"] }

The parameters $name and $role-name are input variables that are required to run the alias. When the alias is run, your supplied parameter values are used for the parameters.

So, if you run:

@aws run automation val1 val2.

$name is assigned the value val1 and $role-name the value of val2. These values are assigned by position.

Alternatively, you can explicitly name the alias parameters:

@aws run automation --name val1 --role-name val2.