-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.tf
More file actions
69 lines (61 loc) · 2.26 KB
/
main.tf
File metadata and controls
69 lines (61 loc) · 2.26 KB
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
locals {
cloud_connectors_list = [for con in var.cloud_connectors : con.name]
}
# ################################
# # Create Stackguardian Workflow Group
# ################################
module "stackguardian_workflow_group" {
for_each = toset(var.workflow_groups)
source = "./stackguardian_workflow_group"
api_key = var.api_key
org_name = var.org_name
workflow_group_name = each.key
}
# ################################
# # Create Stackguardian cloud connector
# ################################
module "stackguardian_connector_cloud" {
for_each = { for c in var.cloud_connectors : c.name => c }
source = "./stackguardian_connector_cloud"
cloud_connector_name = each.key
connector_type = each.value.connector_type
role_arn = each.value.role_arn
role_external_id = each.value.aws_role_external_id
api_key = var.api_key
org_name = var.org_name
}
################################
# Create Stackguardian VCS Connector
################################
module "vcs_connector" {
source = "./stackguardian_connector_vcs"
vcs_connectors = var.vcs_connectors
api_key = var.api_key
org_name = var.org_name
}
################################
# Create Stackguardian Role
################################
module "stackguardian_role" {
source = "./stackguardian_role"
api_key = var.api_key
org_name = var.org_name
role_name = var.role_name
cloud_connectors = [for con in var.cloud_connectors : con.name]
vcs_connectors = [for vcs in var.vcs_connectors : vcs.name]
workflow_groups = var.workflow_groups
template_list = var.template_list
#depends_on = [ module.stackguardian_workflow_group, module.stackguardian_connector_cloud, module.stackguardian_connector_vcs ]
}
# ################################
# # Create Stackguardian role assignment
# ################################
module "stackguardian_role_assignment" {
source = "./stackguardian_role_assignment"
api_key = var.api_key
org_name = var.org_name
role_name = var.role_name
user_or_group = var.user_or_group
entity_type = var.entity_type
depends_on = [module.stackguardian_role]
}