Skip to content

Instantly share code, notes, and snippets.

@Console32
Last active July 24, 2019 09:36
Show Gist options
  • Save Console32/486ebb79dd2635beedf751489cea17cc to your computer and use it in GitHub Desktop.
Save Console32/486ebb79dd2635beedf751489cea17cc to your computer and use it in GitHub Desktop.
medium.bastion-host.createAsg.ts
const asg = new autoscaling.AutoScalingGroup(this, 'bastion-selfheal-ASG', {
vpc: props.vpc,
allowAllOutbound: true,
associatePublicIpAddress: false,
keyName: props.keyName,
notificationsTopic: snsTopic,
instanceType: props.instanceType ? props.instanceType : new ec2.InstanceType('t3.micro'),
machineImage: props.image,
vpcSubnets: props.subnets ? props.subnets : {
onePerAz: true,
subnetType: ec2.SubnetType.PUBLIC
}
})
asg.addSecurityGroup(externalSshSG)
asg.addSecurityGroup(internalSshSecurityGroup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment