-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpolicy_sets.tf
39 lines (33 loc) · 1.18 KB
/
policy_sets.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
data "tfe_oauth_client" "this" {
name = var.oauth_name
organization = local.organization
provider = tfe.organization
}
data "tfe_slug" "generic" {
count = var.configure_policy_set != false ? 1 : 0
// point to the local directory where the policies are located.
source_path = "policy_sets/generic"
}
resource "tfe_policy_set" "generic" {
count = var.configure_policy_set != false ? 1 : 0
name = "vmp_generic"
description = "a generic policy"
organization = local.organization
global = true
// reference the tfe_slug data source.
slug = data.tfe_slug.generic["0"]
}
resource "tfe_policy_set" "vmp_vcs_storage_validation" {
count = var.configure_policy_set != false && var.sentinel_vcs_repo_identifier != "" ? 1 : 0
name = "vmp_initial_policy_set"
description = "A vmp pattern deployed policy set"
organization = local.organization
global = true
policies_path = "./policy_sets/storage_validation"
vcs_repo {
identifier = var.sentinel_vcs_repo_identifier
branch = var.sentinel_branch
ingress_submodules = false
oauth_token_id = data.tfe_oauth_client.this.oauth_token_id
}
}