forked from hashicorp/terraform-provider-google
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resource_cloud_identity_group_test.go
51 lines (42 loc) · 1.23 KB
/
resource_cloud_identity_group_test.go
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
package google
import (
"testing"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)
func TestAccCloudIdentityGroup_update(t *testing.T) {
t.Parallel()
context := map[string]interface{}{
"org_domain": getTestOrgDomainFromEnv(t),
"cust_id": getTestCustIdFromEnv(t),
"random_suffix": randString(t, 10),
}
vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckCloudIdentityGroupDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccCloudIdentityGroup_cloudIdentityGroupsBasicExample(context),
},
{
Config: testAccCloudIdentityGroup_update(context),
},
},
})
}
func testAccCloudIdentityGroup_update(context map[string]interface{}) string {
return Nprintf(`
resource "google_cloud_identity_group" "cloud_identity_group_basic" {
display_name = "tf-test-my-identity-group%{random_suffix}-update"
description = "my-description"
parent = "customers/%{cust_id}"
group_key {
id = "tf-test-my-identity-group%{random_suffix}@%{org_domain}"
}
labels = {
"cloudidentity.googleapis.com/groups.discussion_forum" = ""
"cloudidentity.googleapis.com/groups.security" = ""
}
}
`, context)
}