-
Notifications
You must be signed in to change notification settings - Fork 0
/
transcribe.json
87 lines (87 loc) · 2.56 KB
/
transcribe.json
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
83
84
85
86
87
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "IAM User account and credentials for accessing AWS Transcribe",
"Outputs": {
"TranscribeUserAccessKeyId": {
"Description": "Access Key ID for the user",
"Value": {
"Ref": "TranscribeUserAccessKey"
},
"Export" : {
"Name" : {"Fn::Sub": "${ApplicationName}-transcribe-user-access-key-id" }
}
}
},
"Parameters": {
"ApplicationName": {
"Description": "Name of the application (snake-case, will be prepended to make internal reference names)",
"Type": "String",
"Default": "app"
},
"BucketName": {
"Description": "Name of the S3 bucket where audio files and resulting transcriptions will be stored",
"Type": "String"
}
},
"Resources": {
"TranscribeUser": {
"Type": "AWS::IAM::User",
"Properties": {
"Policies": [
{
"PolicyName": {
"Fn::Sub": "${ApplicationName}-transcribe-policy"
},
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:GetObject", "s3:ListBucket", "s3:DeleteObject"],
"Resource": [
{ "Fn::Sub": "arn:aws:s3:::${BucketName}/*" },
{ "Fn::Sub": "arn:aws:s3:::${BucketName}" }
]
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": ["transcribe:GetTranscriptionJob", "transcribe:StartTranscriptionJob"],
"Resource": "*"
}
]
}
}
],
"UserName": {
"Fn::Sub": "${ApplicationName}-transcribe-user"
}
}
},
"TranscribeUserAccessKey": {
"Type": "AWS::IAM::AccessKey",
"Properties": {
"Status": "Active",
"UserName": {
"Ref": "TranscribeUser"
}
}
},
"TranscribeUserSecretAccessKeyParameter": {
"Type" : "Custom::SSMSecureStringParam",
"Properties" : {
"Name" : {
"Fn::Sub": "/iam/user/${ApplicationName}-transcribe-user/secret-access-key"
},
"ServiceToken": {
"Fn::ImportValue": "ssm-securestring-cfn-macro-function-arn"
},
"Type": "SecureString",
"Value" : {
"Fn::GetAtt": ["TranscribeUserAccessKey", "SecretAccessKey"]
}
}
}
}
}