Skip to content

Commit e6ea011

Browse files
authored
Merge pull request #5861 from cloudflare/tamas/zero_trust_access_group
chore: modernize zero_trust_access_group tests
2 parents 1832dfc + bf53a44 commit e6ea011

14 files changed

+804
-176
lines changed

internal/services/zero_trust_access_group/resource_test.go

Lines changed: 520 additions & 176 deletions
Large diffs are not rendered by default.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
resource "cloudflare_zero_trust_access_group" "%[1]s" {
2+
account_id = "%[2]s"
3+
name = "%[1]s"
4+
5+
include = [
6+
{
7+
email = {
8+
9+
}
10+
},
11+
{
12+
email_domain = {
13+
domain = "example.com"
14+
}
15+
},
16+
{
17+
ip = {
18+
ip = "192.0.2.1/32"
19+
}
20+
},
21+
{
22+
geo = {
23+
country_code = "US"
24+
}
25+
},
26+
{
27+
everyone = {}
28+
},
29+
{
30+
any_valid_service_token = {}
31+
},
32+
{
33+
certificate = {}
34+
},
35+
{
36+
auth_method = {
37+
auth_method = "swk"
38+
}
39+
}
40+
]
41+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
resource "cloudflare_zero_trust_access_group" "%[1]s" {
2+
account_id = "%[2]s"
3+
name = "%[1]s"
4+
5+
include = [
6+
{
7+
email = {
8+
9+
}
10+
}
11+
]
12+
13+
exclude = [
14+
{
15+
geo = {
16+
country_code = "CN"
17+
}
18+
},
19+
{
20+
device_posture = {
21+
integration_uid = "test-device-posture-uid"
22+
}
23+
},
24+
{
25+
external_evaluation = {
26+
evaluate_url = "https://example.com/evaluate"
27+
keys_url = "https://example.com/keys"
28+
}
29+
}
30+
]
31+
32+
require = [
33+
{
34+
auth_method = {
35+
auth_method = "hwk"
36+
}
37+
},
38+
{
39+
certificate = {}
40+
},
41+
{
42+
any_valid_service_token = {}
43+
}
44+
]
45+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
resource "cloudflare_zero_trust_access_group" "%[1]s" {
2+
account_id = "%[2]s"
3+
name = "%[1]s"
4+
5+
include = [
6+
{
7+
email = {
8+
9+
}
10+
},
11+
{
12+
ip = {
13+
ip = "10.0.0.0/8"
14+
}
15+
}
16+
]
17+
18+
exclude = [
19+
{
20+
email = {
21+
22+
}
23+
}
24+
]
25+
26+
require = [
27+
{
28+
email_domain = {
29+
domain = "company.com"
30+
}
31+
}
32+
]
33+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resource "cloudflare_zero_trust_access_group" "%[1]s" {
2+
account_id = "%[2]s"
3+
name = "%[1]s"
4+
5+
include = [
6+
{
7+
device_posture = {
8+
integration_uid = "test-device-posture-uid"
9+
}
10+
}
11+
]
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
resource "cloudflare_zero_trust_access_group" "%[1]s" {
2+
account_id = "%[2]s"
3+
name = "%[1]s"
4+
5+
include = [
6+
{
7+
external_evaluation = {
8+
evaluate_url = "https://example.com/evaluate"
9+
keys_url = "https://example.com/keys"
10+
}
11+
}
12+
]
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
resource "cloudflare_zero_trust_access_group" "%[1]s" {
2+
account_id = "%[2]s"
3+
name = "%[1]s"
4+
5+
include = [
6+
{
7+
gsuite = {
8+
9+
identity_provider_id = "gsuite-idp-id"
10+
}
11+
}
12+
]
13+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
resource "cloudflare_zero_trust_access_group" "%[1]s" {
2+
account_id = "%[2]s"
3+
name = "%[1]s"
4+
5+
include = [
6+
{
7+
email = {
8+
9+
}
10+
},
11+
{
12+
ip = {
13+
ip = "192.0.2.0/24"
14+
}
15+
}
16+
]
17+
18+
exclude = [
19+
{
20+
ip = {
21+
ip = "192.0.2.100/32"
22+
}
23+
}
24+
]
25+
26+
require = [
27+
{
28+
email_domain = {
29+
domain = "company.com"
30+
}
31+
}
32+
]
33+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
resource "cloudflare_zero_trust_access_group" "%[1]s" {
2+
account_id = "%[2]s"
3+
name = "%[1]s"
4+
5+
include = [
6+
{
7+
everyone = {}
8+
}
9+
]
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
resource "cloudflare_zero_trust_access_group" "%[1]s" {
2+
account_id = "%[2]s"
3+
name = "%[1]s"
4+
5+
include = [
6+
{
7+
oidc = {
8+
claim_name = "groups"
9+
claim_value = "admin"
10+
identity_provider_id = "oidc-idp-id"
11+
}
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)