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
2020-05-14 05:15:17 -04:00

70 lines
1.9 KiB
YAML

AWSTemplateFormatVersion: "2010-09-09"
Description: DT Lambdas stack
Parameters:
#------------------------
# Deployment Information
#------------------------
environment:
Type: String
Description: Name of the environment
Default: production
release:
Type: String
Description: Name of the release name of the stack version to use.
Default: production
#----------------
# 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
Properties:
Handler: lambda_function.lambda_handler
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
Role: !Ref TaskManagerRole
VpcConfig:
SecurityGroupIds:
- !Ref TaskListSecurityGroup
SubnetIds: !Ref SubnetIds
Outputs:
TaskListManager:
Value: !Ref TaskListManagerLambda
Description: Function that adds and removes tasks from a redis list