From 3f2d2b8cf1134ac46374caf20fa580f6f0b6a4cf Mon Sep 17 00:00:00 2001 From: Leon Wright Date: Sat, 11 Mar 2023 16:17:08 +1100 Subject: [PATCH] feat: Add KSP2 Inflator This adds a secondary inflator and queue for ksp2 inflations, along with adding the relevant GAME env var to them. --- prod-stack.py | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/prod-stack.py b/prod-stack.py index 01d2ec27..4808db2d 100644 --- a/prod-stack.py +++ b/prod-stack.py @@ -48,6 +48,10 @@ QueueName="Inbound.fifo", ReceiveMessageWaitTimeSeconds=20, FifoQueue=True)) +inbound2 = t.add_resource(Queue("NetKANKSP2Inbound", + QueueName="InboundKsp2.fifo", + ReceiveMessageWaitTimeSeconds=20, + FifoQueue=True)) outbound = t.add_resource(Queue("NetKANOutbound", QueueName="Outbound.fifo", ReceiveMessageWaitTimeSeconds=20, @@ -62,7 +66,7 @@ FifoQueue=True)) -for queue in [inbound, outbound, addqueue, mirrorqueue]: +for queue in [inbound, inbound2, outbound, addqueue, mirrorqueue]: t.add_output([ Output( "{}QueueURL".format(queue.title), @@ -151,6 +155,7 @@ ], "Resource": [ GetAtt(inbound, "Arn"), + GetAtt(inbound2, "Arn"), GetAtt(outbound, "Arn"), GetAtt(addqueue, "Arn"), GetAtt(mirrorqueue, "Arn"), @@ -501,6 +506,7 @@ ], "Resource": [ GetAtt(inbound, "Arn"), + GetAtt(inbound2, "Arn"), ] }, { @@ -741,7 +747,7 @@ 'schedule': 'rate(1 day)', }, { - 'name': 'Inflator', + 'name': 'InflatorKsp', 'image': 'kspckan/inflator', 'memory': '256', 'secrets': ['GH_Token'], @@ -754,6 +760,27 @@ ) ), ('AWS_REGION', Sub('${AWS::Region}')), + ('GAME', 'KSP') + ], + 'volumes': [ + ('ckan_cache', '/home/netkan/ckan_cache') + ] + }, + { + 'name': 'InflatorKsp2', + 'image': 'kspckan/inflator', + 'memory': '256', + 'secrets': ['GH_Token'], + 'env': [ + ( + 'QUEUES', Sub( + '${Inbound},${Outbound}', + Inbound=GetAtt(inbound2, 'QueueName'), + Outbound=GetAtt(outbound, 'QueueName') + ) + ), + ('AWS_REGION', Sub('${AWS::Region}')), + ('GAME', 'KSP2') ], 'volumes': [ ('ckan_cache', '/home/netkan/ckan_cache')