-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudformation.yml
36 lines (36 loc) · 983 Bytes
/
cloudformation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: changethis
Parameters:
elasticIp:
Type: String
Description: "Elastic IP to assign to the new Spot instance"
Default: ''
ecsClusterArn:
Type: String
Description: "ECS Cluster"
Resources:
ElasticSpotHandlerFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ../build/handler.zip
Handler: handler
Architectures:
- x86_64
Runtime: go1.x
Tracing: Active
MemorySize: 128
Events:
ElasticSpotEvent:
Type: CloudWatchEvent
Properties:
Pattern:
source: ["aws.ecs"]
detail-type: ["ECS Container Instance State Change"]
detail:
clusterArn:
- !Ref ecsClusterArn
Environment:
Variables:
ELASTIC_IP:
- !Ref elasticIp