Description
The Attach IAM Role to EC2 Instances action can be used to attach an IAM role to one or more EC2 instances.
Settings
Please see Common Action Settings for a description of settings common to all action types.
Instance Identification Method
Indicates the method in which instances will be selected. Possible options include:
All Instances - All instances will be selected
Instance ID - Instances with the specified IDs will be selected
Instance Name - Instances with the specified 'Name' tag value will be selected
Resource Tag - Instances with the specified resource tag value will be selected
Instance IDs
Indicate the list of instance IDs of your EC2 instances. Instance IDs usually looks like "i-84a3dc7b". All instances must reside in the region specified.
Multiple instances can be added by clicking "Add many instances". In the dialog that appears, enter a space-, comma-, or line-seperated list of instance IDs.
Instance Name
Indicates the value of the 'Name' tag to match when selecting instances.
Resource Tag Name
Indicates the resource tag name to use when selecting instances.
Resource Tag Value
Indicates the resource tag value to compare when selecting instances.
IAM Role Name
Name of the IAM role to be added to the EC2 instances.
Amazon Commands Used
The following Amazon AWS commands are used. The access key should have permission to execute all of them.
ec2:AssociateIamInstanceProfile
ec2:DescribeIamInstanceProfileAssociations
ec2:DescribeInstances
iam:ListRoles
iam:ListInstanceProfilesForRole