-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathtemplate.yaml
56 lines (49 loc) · 1.97 KB
/
template.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
isolator
Sample SAM Template for isolator
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 5
Resources:
IsolatorStateMachine:
Type: AWS::Serverless::StateMachine
Properties:
Name: Isolator
Policies:
- LambdaInvokePolicy:
FunctionName: !Ref IsolatorFunction
- LambdaInvokePolicy:
FunctionName: !Ref SnapshotFunction
DefinitionUri: statemachine/workflows-dev-test.asl.json
DefinitionSubstitutions:
IsolatorFunctionArn: !GetAtt IsolatorFunction.Arn
SnapshotFunctionArn: !GetAtt SnapshotFunction.Arn
IsolatorFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: functions/isolator/
Handler: isolator
Runtime: go1.x
Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html
SnapshotFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: functions/snapshot/
Handler: snapshot
Runtime: go1.x
Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html
Outputs:
IsolatorFunction:
Description: "Lambda function to isolate security groups"
Value: !GetAtt IsolatorFunction.Arn
SnapshotFunction:
Description: "Lambda function to initiate EBS volume snapshot"
Value: !GetAtt SnapshotFunction.Arn
IsolatorWorkflow:
Description: "Workflow ARN"
Value: !Ref IsolatorStateMachine