This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodepipeline.tf
147 lines (126 loc) · 3.65 KB
/
codepipeline.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
resource "aws_codepipeline" "codepipeline" {
name = "${var.SERVICE}-${var.BUILD_STAGE}-pipeline"
role_arn = aws_iam_role.codepipeline_role.arn
artifact_store {
location = module.pipeline_artifact_bucket.s3_bucket_id
type = "S3"
encryption_key {
id = aws_kms_alias.deployment_key.arn
type = "KMS"
}
}
stage {
name = "UploadManifest"
action {
name = "UploadManifest"
category = "Source"
owner = "AWS"
provider = "S3"
version = "1"
run_order = 1
output_artifacts = ["source_output"]
configuration = {
S3Bucket = module.source_bucket.s3_bucket_id
S3ObjectKey = "config/manifest.json"
PollForSourceChanges = false
}
}
}
stage {
name = "MachineLearningStage"
action {
name = "InvokeCreateSchemaFunction"
category = "Invoke"
owner = "AWS"
provider = "Lambda"
input_artifacts = ["source_output"]
output_artifacts = ["create_schema_output"]
version = "1"
run_order = 1
configuration = {
FunctionName = aws_ssm_parameter.create_schema_lambda_name.value
}
}
action {
name = "UploadSourceData"
category = "Approval"
owner = "AWS"
provider = "Manual"
version = "1"
run_order = 2
configuration = {
CustomData = "Please upload source data to begin ML workflow."
}
}
action {
name = "InvokeMLStepFunction"
category = "Invoke"
owner = "AWS"
provider = "StepFunctions"
input_artifacts = ["create_schema_output"]
output_artifacts = ["ml_step_function_output"]
version = "1"
run_order = 3
configuration = {
StateMachineArn = aws_sfn_state_machine.training_step_function.arn
InputType = "FilePath"
Input = "manifest.json"
}
}
}
stage {
name = "ApproveModelStage"
action {
name = "ApprovalMLModel"
category = "Approval"
owner = "AWS"
provider = "Manual"
version = "1"
configuration = {
CustomData = "Please approve model to continue workflow."
}
}
}
stage {
name = "InferenceStage"
action {
name = "InvokeUpdateSchemaFunction"
category = "Invoke"
owner = "AWS"
provider = "Lambda"
input_artifacts = ["ml_step_function_output"]
output_artifacts = ["update_schema_output"]
version = "1"
run_order = 1
configuration = {
FunctionName = aws_ssm_parameter.update_schema_lambda_name.value
}
}
action {
name = "UploadInferenceDataConfirmation"
category = "Approval"
owner = "AWS"
provider = "Manual"
version = "1"
run_order = 2
configuration = {
CustomData = "Please upload inference data if using Batch Transform."
}
}
action {
name = "InvokeMLStepFunctionInference"
category = "Invoke"
owner = "AWS"
provider = "StepFunctions"
input_artifacts = ["update_schema_output"]
output_artifacts = ["ml_step_function_batch_output"]
version = "1"
run_order = 3
configuration = {
StateMachineArn = aws_sfn_state_machine.inference_step_function.arn
InputType = "FilePath"
Input = "manifest.json"
}
}
}
}