Skip to content

Instantly share code, notes, and snippets.

@youngsoul
Created March 11, 2022 22:24
Show Gist options
  • Save youngsoul/10d0b0c8a2aaefec08470505b4c909e3 to your computer and use it in GitHub Desktop.
Save youngsoul/10d0b0c8a2aaefec08470505b4c909e3 to your computer and use it in GitHub Desktop.
bastion_host = ec2.Instance(self, id=f'{resource_prefix}-bastion-host',
instance_type=ec2.InstanceType(instance_type_identifier='t2.micro'),
machine_image=ec2.AmazonLinuxImage(
edition=ec2.AmazonLinuxEdition.STANDARD,
generation=ec2.AmazonLinuxGeneration.AMAZON_LINUX_2,
virtualization=ec2.AmazonLinuxVirt.HVM,
storage=ec2.AmazonLinuxStorage.GENERAL_PURPOSE
),
vpc=vpc,
key_name='pryan-aws', # must create the key name manually first
vpc_subnets=ec2.SubnetSelection(
subnet_type=ec2.SubnetType.PUBLIC
),
security_group=bastion_sg
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment