Skip to content

ec2-ssh fails against non-EC2 managed instances #44

@strophy

Description

@strophy

I have a few Raspberry Pis that are registered as managed instances mi-* in Fleet Manager. Connecting to them works fine with a command like ec2-session pi-1:

$ ec2-session pi-1
Starting session with SessionId: strophy-0f0424c62fea5e575
$ 
Exiting session with sessionId: strophy-0f0424c62fea5e575.

But ec2-ssh fails with the following behaviour:

$ ec2-ssh pi-1
INFO: Resolved instance name 'pi-1' to 'mi-048afb7f6460a110d'
ERROR: Unable to figure out the EC2 login name. Use "-l {user}" or {user}@{instance}.
$ ec2-ssh pi@pi-1
INFO: Resolved instance name 'pi-1' to 'mi-048afb7f6460a110d'
INFO: Using SSH key from SSH Agent, should be as good as any.
ERROR: An error occurred (InvalidArgsException) when calling the SendSSHPublicKey operation: 1 validation error detected: Value 'mi-048afb7f6460a110d' at 'instanceId' failed to satisfy constraint: Member must satisfy regular expression pattern: ^i-[a-f0-9]+$

Is this a restriction imposed by aws-ssm-tools or the underlying ssm start-session command? Are there any workarounds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions