forked from arundeepkurni/gitops-tf-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbsl-s3.tf
More file actions
40 lines (35 loc) · 1.21 KB
/
bsl-s3.tf
File metadata and controls
40 lines (35 loc) · 1.21 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
locals {
bsl_files = fileset("${path.module}/config", "backup-storage-location-s3-*.yaml")
bsls = {
for k in local.bsl_files :
trimsuffix(k, ".yaml") => yamldecode(file("config/${k}"))
}
bsl_ids = {
for k, v in spectrocloud_backup_storage_location.this :
v.name => v.id
}
# rbac_yaml = yamldecode(file("rbac.yaml"))
# rbac_all_crb = lookup(local.rbac_yaml.all_accounts, "accountRoleBindings", [])
# rbac_all_rb = lookup(local.rbac_yaml.all_accounts, "namespaces", [])
# rbac_map = {
# for k, v in local.rbac_yaml.accounts :
# k => {
# accountRoleBindings = concat(local.rbac_all_crb, lookup(v, "accountRoleBindings", []))
# namespaces = concat(local.rbac_all_rb, lookup(v, "namespaces", []))
# }
# }
}
################################ accounts ####################################################
# Create the backup storage location
resource "spectrocloud_backup_storage_location" "this" {
for_each = local.bsls
name = each.value.name
is_default = false
region = each.value.region
bucket_name = each.value.bucket_name
s3 {
credential_type = "sts"
arn = each.value.arn
external_id = each.value.external_id
}
}