Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit 467f4f1

Browse files
committed
added ssh ingress rule
1 parent e29d1eb commit 467f4f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

awscdk/awscdk/bastion_host.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ def __init__(
2222
**kwargs,
2323
)
2424

25+
# add ingress rule on port 22 for SSH
26+
ec2.SecurityGroup.from_security_group_id(
27+
self,
28+
"DefaultSecurityGroupForIngress",
29+
scope.vpc.vpc_default_security_group,
30+
).add_ingress_rule(
31+
ec2.Peer.any_ipv4(),
32+
ec2.Port.tcp(22),
33+
)
34+
2535
self.asg = autoscaling.AutoScalingGroup(
2636
self,
2737
"AutoScalingGroup",

0 commit comments

Comments
 (0)