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??
Currently the command to send-ssh-public-key is although printed as an Output, still needs to be executed manually by the user.
It would be nice if this was taken care of seamlessly during deployment. Step Functions perhaps??