-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws_sfn_state_machine.tf
117 lines (112 loc) · 6.33 KB
/
aws_sfn_state_machine.tf
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
resource "aws_sfn_state_machine" "rekognition" {
definition = templatefile("./state_machine/Rekognition.json", {
rekognition_detect_faces = aws_sfn_state_machine.rekognition_detect_faces.arn
rekognition_detect_labels = aws_sfn_state_machine.rekognition_detect_labels.arn
rekognition_detect_moderation_labels = aws_sfn_state_machine.rekognition_detect_moderation_labels.arn
rekognition_detect_protective_equipment = aws_sfn_state_machine.rekognition_detect_protective_equipment.arn
rekognition_detect_text = aws_sfn_state_machine.rekognition_detect_text.arn
s3_object_rekognition_detect_faces = aws_s3_object.rekognition_detect_faces.key
s3_object_rekognition_detect_labels = aws_s3_object.rekognition_detect_labels.key
s3_object_rekognition_detect_moderation_labels = aws_s3_object.rekognition_detect_moderation_labels.key
s3_object_rekognition_detect_protective_equipment = aws_s3_object.rekognition_detect_protective_equipment.key
s3_object_rekognition_detect_text = aws_s3_object.rekognition_detect_text.key
})
name = "rekognition"
role_arn = aws_iam_role.sfn_state_machine_rekognition.arn
tags = {
bucket = aws_s3_bucket.main.bucket
bucket_key = aws_s3_object.images.key
caller_identity_account_arn = data.aws_caller_identity.main.arn
caller_identity_account_id = data.aws_caller_identity.main.account_id
caller_identity_user_id = data.aws_caller_identity.main.user_id
canonical_user_id = data.aws_canonical_user_id.main.id
organization = local.organization
region = data.aws_region.main.name
workspace = terraform.workspace
}
}
resource "aws_sfn_state_machine" "rekognition_detect_faces" {
definition = templatefile("./state_machine/RekognitionDetectFaces.json", {})
name = "rekognition-detect-faces"
role_arn = aws_iam_role.sfn_state_machine_rekognition_detect_faces.arn
tags = {
bucket = aws_s3_bucket.main.bucket
bucket_key = aws_s3_object.images.key
caller_identity_account_arn = data.aws_caller_identity.main.arn
caller_identity_account_id = data.aws_caller_identity.main.account_id
caller_identity_user_id = data.aws_caller_identity.main.user_id
canonical_user_id = data.aws_canonical_user_id.main.id
organization = local.organization
rekognition = "DetectFaces"
region = data.aws_region.main.name
workspace = terraform.workspace
}
}
resource "aws_sfn_state_machine" "rekognition_detect_labels" {
definition = templatefile("./state_machine/RekognitionDetectLabels.json", {})
name = "rekognition-detect-labels"
role_arn = aws_iam_role.sfn_state_machine_rekognition_detect_labels.arn
tags = {
bucket = aws_s3_bucket.main.bucket
bucket_key = aws_s3_object.images.key
caller_identity_account_arn = data.aws_caller_identity.main.arn
caller_identity_account_id = data.aws_caller_identity.main.account_id
caller_identity_user_id = data.aws_caller_identity.main.user_id
canonical_user_id = data.aws_canonical_user_id.main.id
organization = local.organization
rekognition = "DetectLabels"
region = data.aws_region.main.name
workspace = terraform.workspace
}
}
resource "aws_sfn_state_machine" "rekognition_detect_moderation_labels" {
definition = templatefile("./state_machine/RekognitionDetectModerationLabels.json", {})
name = "rekognition-detect-moderation-labels"
role_arn = aws_iam_role.sfn_state_machine_rekognition_detect_moderation_labels.arn
tags = {
bucket = aws_s3_bucket.main.bucket
bucket_key = aws_s3_object.images.key
caller_identity_account_arn = data.aws_caller_identity.main.arn
caller_identity_account_id = data.aws_caller_identity.main.account_id
caller_identity_user_id = data.aws_caller_identity.main.user_id
canonical_user_id = data.aws_canonical_user_id.main.id
organization = local.organization
rekognition = "DetectModerationLabels"
region = data.aws_region.main.name
workspace = terraform.workspace
}
}
resource "aws_sfn_state_machine" "rekognition_detect_protective_equipment" {
definition = templatefile("./state_machine/RekognitionDetectProtectiveEquipment.json", {})
name = "rekognition-detect-protective-equipment"
role_arn = aws_iam_role.sfn_state_machine_rekognition_detect_protective_equipment.arn
tags = {
bucket = aws_s3_bucket.main.bucket
bucket_key = aws_s3_object.images.key
caller_identity_account_arn = data.aws_caller_identity.main.arn
caller_identity_account_id = data.aws_caller_identity.main.account_id
caller_identity_user_id = data.aws_caller_identity.main.user_id
canonical_user_id = data.aws_canonical_user_id.main.id
organization = local.organization
rekognition = "DetectProtectiveEquipment"
region = data.aws_region.main.name
workspace = terraform.workspace
}
}
resource "aws_sfn_state_machine" "rekognition_detect_text" {
definition = templatefile("./state_machine/RekognitionDetectText.json", {})
name = "rekognition-detect-text"
role_arn = aws_iam_role.sfn_state_machine_rekognition_detect_text.arn
tags = {
bucket = aws_s3_bucket.main.bucket
bucket_key = aws_s3_object.images.key
caller_identity_account_arn = data.aws_caller_identity.main.arn
caller_identity_account_id = data.aws_caller_identity.main.account_id
caller_identity_user_id = data.aws_caller_identity.main.user_id
canonical_user_id = data.aws_canonical_user_id.main.id
organization = local.organization
rekognition = "DetectText"
region = data.aws_region.main.name
workspace = terraform.workspace
}
}