Skip to content

Commit

Permalink
Use redis as both broker and backend
Browse files Browse the repository at this point in the history
  • Loading branch information
jonodrew committed Jun 1, 2023
1 parent fb8fea7 commit 84c7922
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions mentor_match_infra/mentor_match_infra/mentor_match_stack.py
Expand Up @@ -7,7 +7,6 @@
)
from aws_cdk.aws_elasticache import CfnCacheCluster, CfnSubnetGroup
from aws_cdk.aws_iam import Role, CompositePrincipal, ArnPrincipal, ManagedPolicy
from aws_cdk.aws_sqs import Queue
from constructs import Construct


Expand Down Expand Up @@ -101,7 +100,7 @@ def __init__(
backend = RedisCache(self, "MentorCache", vpc)

broker_vars = {
"BROKER_URL": "sqs://",
"BROKER_URL": "redis://redis:6379/0",
"BACKEND_URL": "redis://redis:6379/0",
}

Expand Down Expand Up @@ -153,11 +152,3 @@ def __init__(
celery_worker.service.connections, port_range=ec2.Port.tcp(6379)
)
backend.connections.allow_from_any_ipv4(port_range=ec2.Port.tcp(6379))

broker = Queue(self, "MentorQueue")

broker.grant_send_messages(celery_worker.task_definition.task_role)
broker.grant_send_messages(web_service.task_definition.task_role)

broker.grant_consume_messages(celery_worker.task_definition.task_role)
broker.grant_consume_messages(web_service.task_definition.task_role)

0 comments on commit 84c7922

Please sign in to comment.