-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtemplate.yml
68 lines (63 loc) · 2.04 KB
/
template.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: "App-video-processing"
Parameters:
MySampleDataBucketName:
Type: String
MySampleDataInputKey:
Type: String
Resources:
# Define a common IAM role to be used for all components of this app
ApplicationRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
-
Effect: "Allow"
Principal:
Service:
- "states.amazonaws.com"
Action:
- "sts:AssumeRole"
Policies:
- PolicyName: AppPolicy
PolicyDocument:
Version: 2012-10-17
Statement:
-
Effect: Allow
Action:
- xray:PutTraceSegments
- xray:PutTelemetryRecords
- xray:GetSamplingRules
- xray:GetSamplingTargets
- transcribe:StartTranscriptionJob
- transcribe:GetTranscriptionJob
- translate:TranslateText
Resource: '*'
-
Effect: Allow
Action:
- s3:*
Resource: '*'
# An S3 Bucket for the data processing
DataBucket:
Type: AWS::S3::Bucket
Properties:
BucketName : !Join ["",[!Ref "AWS::AccountId","-",!Ref "AWS::Region","-video-processing-example2"]]
StateMachineProcessVideoFile:
Type: AWS::Serverless::StateMachine
Properties:
Type: "STANDARD"
Role: !GetAtt ApplicationRole.Arn
Name: !Join ["",[!Ref "AWS::AccountId","-",!Ref "AWS::Region","-video-processing-example1"]]
DefinitionUri: state-machine/state-machine.asl.json
DefinitionSubstitutions:
SampleDataBucketName: !Ref MySampleDataBucketName
SampleDataInputKey: !Ref MySampleDataInputKey
S3BucketName: !Ref DataBucket
ApplicationRoleArn: !GetAtt ApplicationRole.Arn
Tracing:
Enabled: true