dcloud ec2 instances add-key

Add a key pair to a running instance (root and its default user), no reboot

IAM ec2:AddInstanceKeyChanges state

Through Deutsche Cloud Connect: works while the instance is connected (`connect-status`). The line in authorized_keys ends in `ews-key:<keyPairId>`, so `remove-key` takes out exactly that line. On an instance without Connect: 409 with what is possible.

Synopsis

dcloud ec2 instances add-key id --key-pair-id keyPairId [flags]

Arguments

  • <id>Required

    string

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

Flags

  • --key-pair-idRequired

    string

    The key pair to add (ec2 key pairs)

  • --usersOptional

    enum

    Whose authorized_keys get it: root, the image’s default user, or both (the default)

    One of: root, default

Example

dcloud ec2 instances add-key id --key-pair-id example

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