Skip to content

Instantly share code, notes, and snippets.

@Console32
Last active July 24, 2019 07:51
Show Gist options
  • Save Console32/62fb1df1e1cc0749935812335668c7cb to your computer and use it in GitHub Desktop.
Save Console32/62fb1df1e1cc0749935812335668c7cb to your computer and use it in GitHub Desktop.
medium.bastion-host.createAllowPeerSshSg.ts
private createAllowExternSshSG(vpc: ec2.IVpc, peers: ec2.IPeer[]): ec2.SecurityGroup {
const sshSecurityGroup = new ec2.SecurityGroup(this, 'allow-ssh-external-SG', {
vpc: vpc
})
peers.forEach(peer => {
sshSecurityGroup.addIngressRule(peer, ec2.Port.tcp(22))
});
return sshSecurityGroup
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment