@@ -20,10 +20,7 @@ func TestAccDataSourceGoogleBeyondcorpAppConnection_basic(t *testing.T) {
20
20
acctest .VcrTest (t , resource.TestCase {
21
21
PreCheck : func () { acctest .AccTestPreCheck (t ) },
22
22
ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
23
- ExternalProviders : map [string ]resource.ExternalProvider {
24
- "time" : {},
25
- },
26
- CheckDestroy : testAccCheckBeyondcorpAppConnectionDestroyProducer (t ),
23
+ CheckDestroy : testAccCheckBeyondcorpAppConnectionDestroyProducer (t ),
27
24
Steps : []resource.TestStep {
28
25
{
29
26
Config : testAccDataSourceGoogleBeyondcorpAppConnection_basic (context ),
@@ -45,10 +42,7 @@ func TestAccDataSourceGoogleBeyondcorpAppConnection_full(t *testing.T) {
45
42
acctest .VcrTest (t , resource.TestCase {
46
43
PreCheck : func () { acctest .AccTestPreCheck (t ) },
47
44
ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
48
- ExternalProviders : map [string ]resource.ExternalProvider {
49
- "time" : {},
50
- },
51
- CheckDestroy : testAccCheckBeyondcorpAppConnectionDestroyProducer (t ),
45
+ CheckDestroy : testAccCheckBeyondcorpAppConnectionDestroyProducer (t ),
52
46
Steps : []resource.TestStep {
53
47
{
54
48
Config : testAccDataSourceGoogleBeyondcorpAppConnection_full (context ),
@@ -63,85 +57,68 @@ func TestAccDataSourceGoogleBeyondcorpAppConnection_full(t *testing.T) {
63
57
func testAccDataSourceGoogleBeyondcorpAppConnection_basic (context map [string ]interface {}) string {
64
58
return acctest .Nprintf (`
65
59
resource "google_service_account" "service_account" {
66
- account_id = "tf-test-my-account%{random_suffix}"
67
- display_name = "Test Service Account"
60
+ account_id = "tf-test-my-account%{random_suffix}"
61
+ display_name = "Test Service Account"
68
62
}
69
63
70
- resource "time_sleep" "wait_120_seconds" {
71
- depends_on = [google_service_account.service_account]
72
-
73
- create_duration = "120s"
74
- }
75
-
76
-
77
64
resource "google_beyondcorp_app_connector" "app_connector" {
78
- depends_on = [time_sleep.wait_120_seconds]
79
-
80
- name = "tf-test-appconnector-%{random_suffix}"
81
- principal_info {
82
- service_account {
83
- email = google_service_account.service_account.email
84
- }
85
- }
65
+ name = "tf-test-appconnector-%{random_suffix}"
66
+ principal_info {
67
+ service_account {
68
+ email = google_service_account.service_account.email
69
+ }
70
+ }
86
71
}
87
72
88
73
resource "google_beyondcorp_app_connection" "foo" {
89
- name = "tf-test-my-app-connection-%{random_suffix}"
90
- type = "TCP_PROXY"
91
- application_endpoint {
92
- host = "foo-host"
93
- port = 8080
94
- }
95
- connectors = [google_beyondcorp_app_connector.app_connector.id]
96
- labels = {
97
- my-label = "my-label-value"
98
- }
74
+ name = "tf-test-my-app-connection-%{random_suffix}"
75
+ type = "TCP_PROXY"
76
+ application_endpoint {
77
+ host = "foo-host"
78
+ port = 8080
79
+ }
80
+ connectors = [google_beyondcorp_app_connector.app_connector.id]
81
+ labels = {
82
+ my-label = "my-label-value"
83
+ }
99
84
}
100
85
101
86
data "google_beyondcorp_app_connection" "foo" {
102
- name = google_beyondcorp_app_connection.foo.name
87
+ name = google_beyondcorp_app_connection.foo.name
103
88
}
104
89
` , context )
105
90
}
106
91
107
92
func testAccDataSourceGoogleBeyondcorpAppConnection_full (context map [string ]interface {}) string {
108
93
return acctest .Nprintf (`
109
94
resource "google_service_account" "service_account" {
110
- account_id = "tf-test-my-account%{random_suffix}"
111
- display_name = "Test Service Account"
112
- }
113
-
114
- resource "time_sleep" "wait_120_seconds" {
115
- depends_on = [google_service_account.service_account]
116
-
117
- create_duration = "120s"
95
+ account_id = "tf-test-my-account%{random_suffix}"
96
+ display_name = "Test Service Account"
118
97
}
119
98
120
99
resource "google_beyondcorp_app_connector" "app_connector" {
121
- depends_on = [time_sleep.wait_120_seconds]
122
-
123
- name = "tf-test-appconnector-%{random_suffix}"
124
- principal_info {
125
- service_account {
126
- email = google_service_account.service_account.email
127
- }
128
- }
100
+ name = "tf-test-appconnector-%{random_suffix}"
101
+ principal_info {
102
+ service_account {
103
+ email = google_service_account.service_account.email
104
+ }
105
+ }
129
106
}
130
107
131
108
resource "google_beyondcorp_app_connection" "foo" {
132
- name = "tf-test-my-app-connection-%{random_suffix}"
133
- type = "TCP_PROXY"
134
- application_endpoint {
135
- host = "foo-host"
136
- port = 8080
137
- }
138
- connectors = [google_beyondcorp_app_connector.app_connector.id]
109
+ name = "tf-test-my-app-connection-%{random_suffix}"
110
+ type = "TCP_PROXY"
111
+ application_endpoint {
112
+ host = "foo-host"
113
+ port = 8080
114
+ }
115
+ connectors = [google_beyondcorp_app_connector.app_connector.id]
139
116
}
140
117
141
118
data "google_beyondcorp_app_connection" "foo" {
142
- name = google_beyondcorp_app_connection.foo.name
143
- project = google_beyondcorp_app_connection.foo.project
144
- region = google_beyondcorp_app_connection.foo.region
119
+ name = google_beyondcorp_app_connection.foo.name
120
+ project = google_beyondcorp_app_connection.foo.project
121
+ region = google_beyondcorp_app_connection.foo.region
145
122
}
146
123
` , context )
147
124
}
0 commit comments