Skip to content

Automate sending EC2 Instance Connect public keys #3

@FarrOut

Description

@FarrOut

Currently the command to send-ssh-public-key is although printed as an Output, still needs to be executed manually by the user.

        send_key_command = f"aws ec2-instance-connect send-ssh-public-key --instance-id {bastion.instance_id} --instance-os-user {bastion_user} --ssh-public-key file://{public_key_key} --availability-zone {az}"
        CfnOutput(self, 'SendPublicSshKeyCommand',
                  value=send_key_command,
                  description='Command to send public SSH key to Bastion.',
                  )

        ssh_command = f"ssh -o \"IdentitiesOnly=yes\" -i {private_key_path} {bastion_user}@{bastion.instance_public_dns_name}"
        CfnOutput(self, 'BastionSSHcommand',
                  value=ssh_command,
                  description='Command to SSH into Bastion.',
                  )

It would be nice if this was taken care of seamlessly during deployment. Step Functions perhaps??

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions