-
Notifications
You must be signed in to change notification settings - Fork 129
/
Copy pathtemplate.yaml
82 lines (74 loc) · 2.27 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Step Functions Workflow - description
Resources:
MySampleStateMachine:
Type: AWS::Serverless::StateMachine
Properties:
DefinitionUri: statemachine/statemachine.asl.json
DefinitionSubstitutions:
AWS_ACCOUNT_ID: !Ref AWS::AccountId
MEDIACONVERT_ROLE : !GetAtt MediaConvertRole.Arn
REGION: !Ref AWS::Region
Policies:
- Version: "2012-10-17"
Statement:
- Effect: "Allow"
Action: [
"rekognition:GetSegmentDetection",
"rekognition:StartSegmentDetection",
"mediaconvert:CreateJob",
"mediaconvert:GetJob",
"events:PutTargets",
"events:PutRule",
"events:DescribeRule"
]
Resource: "*"
- Effect: "Allow"
Action: [
"iam:PassRole"
]
Resource: "*"
Condition:
StringLike:
"iam:PassedToService": "mediaconvert.amazonaws.com"
- S3ReadPolicy:
BucketName: !Ref S3Bucket
S3Bucket:
Type: 'AWS::S3::Bucket'
MediaConvertRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service:
- mediaconvert.amazonaws.com
Action:
- 'sts:AssumeRole'
Policies:
- PolicyName: "mediaconvert_default"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Action: [
"s3:Get*",
"s3:List*",
"s3:Put*"
]
Resource:
- !GetAtt S3Bucket.Arn
- !Join
- ''
- - !GetAtt S3Bucket.Arn
- '/*'
Outputs:
MySegementDetectionStateMachineArn:
Description: "MySampleStateMachine ARN"
Value: !Ref MySampleStateMachine
S3Bucket:
Description: "Video input/output S3 bucket"
Value: !Ref S3Bucket