dcloud ec2 instances set-role

Give the instance an IAM role it gets short-lived credentials for

IAM ec2:AssociateInstanceRoleChanges state

Also needs iam:PassRole on the role.

Synopsis

dcloud ec2 instances set-role id --iam-role-name iamRoleName

Arguments

  • <id>Required

    string

    Also accepted as --id. Constraints: /^i-[0-9a-f]{6,32}$/

Flags

  • --iam-role-nameRequired

    string

    IAM role the machine acts as (needs iam:PassRole on it): it gets 60-minute credentials for it through its instance identity (`ews-instance credentials`), with no key in user data

    Constraints: 1-64 chars, /^[\w+=,.@-]+$/

Example

dcloud ec2 instances set-role id --iam-role-name example

Generated from the API description, the same one the API checks requests against and the CLI is built from.