diff --git a/mentor_match_infra/mentor_match_infra/mentor_match_stack.py b/mentor_match_infra/mentor_match_infra/mentor_match_stack.py index 8aeefed..80b89c2 100644 --- a/mentor_match_infra/mentor_match_infra/mentor_match_stack.py +++ b/mentor_match_infra/mentor_match_infra/mentor_match_stack.py @@ -80,7 +80,7 @@ def connections(self): return self._connections -class MentorMatchStack(cdk.Stack): +class MentorMatchWebStack(cdk.Stack): def __init__( self, scope: Construct, @@ -91,8 +91,6 @@ def __init__( ) -> None: super().__init__(scope, construct_id, **kwargs) - DeveloperRole(self, "MentorDev") - vpc = ec2.Vpc(self, "MentorMatchVPC", max_azs=2) # default is all AZs in region cluster = ecs.Cluster(self, "MentorMatchCluster", vpc=vpc) @@ -161,3 +159,10 @@ def __init__( celery_worker.connections, port_range=ec2.Port.tcp(6379) ) backend.connections.allow_from_any_ipv4(port_range=ec2.Port.tcp(6379)) + + +class MentorMatchSupportStack(cdk.Stack): + def __init__(self, scope: Construct, id_: str): + super().__init__(scope, id_) + + DeveloperRole(self, "MentorDev") diff --git a/mentor_match_infra/mentor_match_infra/mentor_match_stage.py b/mentor_match_infra/mentor_match_infra/mentor_match_stage.py index 611fcf8..f6d6684 100644 --- a/mentor_match_infra/mentor_match_infra/mentor_match_stage.py +++ b/mentor_match_infra/mentor_match_infra/mentor_match_stage.py @@ -3,7 +3,7 @@ import aws_cdk as cdk from constructs import Construct -from .mentor_match_stack import MentorMatchStack +from .mentor_match_stack import MentorMatchWebStack, MentorMatchSupportStack Account = Literal["staging", "production"] @@ -20,7 +20,9 @@ def __init__( ) -> None: super().__init__(scope, construct_id, **kwargs) - self._service = MentorMatchStack( + self._support = MentorMatchSupportStack(self, "SupportStack") + + self._service = MentorMatchWebStack( self, "MentorMatchStack", **self.stage_env_vars[account] )