Create infrastructure to call lambda
This commit is contained in:
39
infrastructure/cloudformation/dt/cloudwatch.yaml
Normal file
39
infrastructure/cloudformation/dt/cloudwatch.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
AWSTemplateFormatVersion: "2010-09-09"
|
||||
Description: DT CloudWatch stack
|
||||
Parameters:
|
||||
#------------------------
|
||||
# Deployment Information
|
||||
#------------------------
|
||||
environment:
|
||||
Type: String
|
||||
Description: Name of the environment
|
||||
Default: production
|
||||
|
||||
#----------------
|
||||
# ECS Information
|
||||
#----------------
|
||||
Cluster:
|
||||
Description: The ECS cluster to watch
|
||||
Type: String
|
||||
|
||||
#-------------------
|
||||
# Lambda Information
|
||||
#-------------------
|
||||
LambdaArn:
|
||||
Description: Lambda function to call upon ecs task state change
|
||||
Type: String
|
||||
|
||||
Resources:
|
||||
|
||||
TaskListRule:
|
||||
EventPattern:
|
||||
source:
|
||||
- "aws.ecs"
|
||||
detail-type:
|
||||
- "ECS Task State Change"
|
||||
detail:
|
||||
clusterArn:
|
||||
- !Ref Cluster
|
||||
Targets:
|
||||
- Id: RedisUpdater
|
||||
Arn: !Ref LambdaArn
|
Reference in New Issue
Block a user