wow, I just discovered AWS bastion hosts today. :o...
# general
s
wow, I just discovered AWS bastion hosts today. 😮 no more manually setting up EC2 instances purely for tunneling to access private services. SO easy to set up via CDK, too
Copy code
const bastionHost = new ec2.BastionHostLinux(stack, 'BastionHost', {
    instanceName: 'bastion-host',
    instanceType: new ec2.InstanceType('t3.nano'),
    vpc: ec2.Vpc.fromLookup(stack, 'DefaultVPC', { isDefault: true }),
  });
a
yep, very helpful to connect to rds instances.
s
though now that I say it’s easy.. I’m stuck 😅
ahhhhh never mind. I didn’t realize that when you use
aws ec2-instance-connect send-ssh-public-key
, the pub key is only valid for 60 seconds. so you have to connect right away
a
haha lol!
oh yes, the quirks of using aws. 😂
s
better off just adding the key manually in
/home/ssm-user/.ssh/authorized_keys
🤷‍♂️