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

Commit 927c69f

Browse files
committed
added ecs task and service for bastion host
1 parent 3299998 commit 927c69f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

awscdk/awscdk/bastion_host.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,19 @@ def __init__(
4343
self.cluster = scope.cluster
4444

4545
self.cluster.add_auto_scaling_group(self.asg)
46+
47+
self.bastion_host_task = ecs.Ec2TaskDefinition(self, "BastionHostTask")
48+
49+
self.bastion_host_task.add_container(
50+
image=scope.image,
51+
command=["/start_prod.sh"],
52+
environment=scope.variables.regular_variables,
53+
secrets=scope.variables.secret_variables,
54+
)
55+
56+
self.bastion_host_service = ecs.Ec2Service(
57+
self,
58+
"BastionHostService",
59+
task_definition=self.bastion_host_task,
60+
cluster=self.cluster,
61+
)

0 commit comments

Comments
 (0)