-
Notifications
You must be signed in to change notification settings - Fork 19
/
aws_pipeline.pipe.tf
43 lines (38 loc) · 1.28 KB
/
aws_pipeline.pipe.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
resource "aws_codepipeline" "pipe" {
artifact_store {
location = var.artifact_store["location"]
type = var.artifact_store["type"]
encryption_key {
id = var.kms_key_arn
type = "KMS"
}
}
name = var.name
role_arn = local.role_arn
dynamic "stage" {
for_each = [for s in var.stages : {
name = s.name
action = s.action
} if(lookup(s, "enabled", true))]
content {
name = stage.value.name
dynamic "action" {
for_each = stage.value.action
content {
name = action.value["name"]
owner = action.value["owner"]
version = action.value["version"]
category = action.value["category"]
provider = action.value["provider"]
input_artifacts = lookup(action.value, "input_artifacts", [])
output_artifacts = lookup(action.value, "output_artifacts", [])
configuration = lookup(action.value, "configuration", {})
role_arn = lookup(action.value, "role_arn", null)
run_order = lookup(action.value, "run_order", null)
region = lookup(action.value, "region", data.aws_region.current.name)
}
}
}
}
tags = var.common_tags
}