This repository has been archived on 2023-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
defend-together/infrastructure/cloudformation/dt/lambdas.yaml

70 lines
1.9 KiB
YAML
Raw Normal View History

2020-05-14 10:39:51 +02:00
AWSTemplateFormatVersion: "2010-09-09"
Description: DT Lambdas stack
Parameters:
#------------------------
# Deployment Information
#------------------------
environment:
Type: String
Description: Name of the environment
Default: production
2020-05-14 11:08:59 +02:00
release:
Type: String
Description: Name of the release name of the stack version to use.
Default: production
2020-05-14 10:39:51 +02:00
#----------------
# IAM Information
#----------------
TaskManagerRole:
Type: String
Description: IAM role assumed by Task Manager Lambda
VpcId:
Type: AWS::EC2::VPC::Id
Description: The id of the VPC the cluster will be in
ConstraintDescription: VPC Id must begin with 'vpc-'
SubnetIds:
Type: List<AWS::EC2::Subnet::Id>
Description: Comma seperated list of subnets for ECS instances to run in
Resources:
TaskListSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: TaskListManagerLambda Allowed Ports
VpcId: !Ref VpcId
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '0'
ToPort: '65535'
CidrIp: 0.0.0.0/0
SecurityGroupEgress:
- IpProtocol: tcp
FromPort: '0'
ToPort: '65535'
CidrIp: 0.0.0.0/0
TaskListManagerLambda:
Type: AWS::Lambda::Function
2020-05-14 11:03:53 +02:00
Properties:
2020-05-14 11:15:17 +02:00
Handler: lambda_function.lambda_handler
2020-05-14 11:03:53 +02:00
Runtime: python3.7
Code:
S3Bucket: sumu-stacks
S3Key: !Sub "dt/${release}/lambda/task_queue_manager.zip"
FunctionName: !Sub "FnQueueManager-DT-${environment}"
Description: Adds and removes tasks from a redis list
MemorySize: 128
Timeout: 10
2020-05-14 11:08:59 +02:00
Role: !Ref TaskManagerRole
2020-05-14 11:03:53 +02:00
VpcConfig:
SecurityGroupIds:
- !Ref TaskListSecurityGroup
SubnetIds: !Ref SubnetIds
2020-05-14 10:39:51 +02:00
Outputs:
TaskListManager:
Value: !Ref TaskListManagerLambda
Description: Function that adds and removes tasks from a redis list