@@ -44,6 +44,8 @@ func TestAccTFEPolicySetDataSource_basic(t *testing.T) {
44
44
"data.tfe_policy_set.bar" , "policy_ids.#" , "1" ),
45
45
resource .TestCheckResourceAttr (
46
46
"data.tfe_policy_set.bar" , "workspace_ids.#" , "1" ),
47
+ resource .TestCheckResourceAttr (
48
+ "data.tfe_policy_set.bar" , "project_ids.#" , "1" ),
47
49
resource .TestCheckResourceAttr (
48
50
"data.tfe_policy_set.bar" , "vcs_repo.#" , "0" ),
49
51
),
@@ -87,6 +89,8 @@ func TestAccTFEPolicySetDataSourceOPA_basic(t *testing.T) {
87
89
"data.tfe_policy_set.bar" , "overridable" , "true" ),
88
90
resource .TestCheckResourceAttr (
89
91
"data.tfe_policy_set.bar" , "workspace_ids.#" , "1" ),
92
+ resource .TestCheckResourceAttr (
93
+ "data.tfe_policy_set.bar" , "project_ids.#" , "1" ),
90
94
resource .TestCheckResourceAttr (
91
95
"data.tfe_policy_set.bar" , "vcs_repo.#" , "0" ),
92
96
),
@@ -144,6 +148,8 @@ func TestAccTFEPolicySetDataSource_vcs(t *testing.T) {
144
148
"data.tfe_policy_set.bar" , "policy_ids.#" , "0" ),
145
149
resource .TestCheckResourceAttr (
146
150
"data.tfe_policy_set.bar" , "workspace_ids.#" , "0" ),
151
+ resource .TestCheckResourceAttr (
152
+ "data.tfe_policy_set.bar" , "project_ids.#" , "0" ),
147
153
resource .TestCheckResourceAttr (
148
154
"data.tfe_policy_set.bar" , "vcs_repo.#" , "1" ),
149
155
),
@@ -180,6 +186,11 @@ resource "tfe_workspace" "foobar" {
180
186
organization = local.organization_name
181
187
}
182
188
189
+ resource "tfe_project" "foobar" {
190
+ name = "project-foo-%d"
191
+ organization = local.organization_name
192
+ }
193
+
183
194
resource "tfe_sentinel_policy" "foo" {
184
195
name = "policy-foo"
185
196
policy = "main = rule { true }"
@@ -192,12 +203,13 @@ resource "tfe_policy_set" "foobar" {
192
203
organization = local.organization_name
193
204
policy_ids = [tfe_sentinel_policy.foo.id]
194
205
workspace_ids = [tfe_workspace.foobar.id]
206
+ project_ids = [tfe_project.foobar.id]
195
207
}
196
208
197
209
data "tfe_policy_set" "bar" {
198
210
name = tfe_policy_set.foobar.name
199
211
organization = local.organization_name
200
- }` , organization , rInt , rInt )
212
+ }` , organization , rInt , rInt , rInt )
201
213
}
202
214
203
215
func testAccTFEPolicySetDataSourceConfigOPA_basic (organization string , rInt int ) string {
@@ -211,20 +223,26 @@ resource "tfe_workspace" "foobar" {
211
223
organization = local.organization_name
212
224
}
213
225
226
+ resource "tfe_project" "foobar" {
227
+ name = "project-foo-%d"
228
+ organization = local.organization_name
229
+ }
230
+
214
231
resource "tfe_policy_set" "foobar" {
215
232
name = "tst-policy-set-%d"
216
233
description = "Policy Set"
217
234
organization = local.organization_name
218
235
kind = "opa"
219
236
overridable = true
220
237
workspace_ids = [tfe_workspace.foobar.id]
238
+ project_ids = [tfe_project.foobar.id]
221
239
}
222
240
223
241
data "tfe_policy_set" "bar" {
224
242
name = tfe_policy_set.foobar.name
225
243
organization = local.organization_name
226
244
kind = "opa"
227
- }` , organization , rInt , rInt )
245
+ }` , organization , rInt , rInt , rInt )
228
246
}
229
247
230
248
func testAccTFEPolicySetDataSourceConfig_vcs (organization string , rInt int ) string {
0 commit comments