Skip to content

Commit aa9353c

Browse files
Revert "wait for SA to propagate on beyondcord app" (#12386) (#8763)
[upstream:206992bee01c41ff727f0c94fc14a813cb902d3d] Signed-off-by: Modular Magician <[email protected]>
1 parent 3f2cec2 commit aa9353c

5 files changed

+44
-125
lines changed

.changelog/12386.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```release-note:none
2+
```

google-beta/services/beyondcorp/data_source_google_beyondcorp_app_connection_test.go

+39-62
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ func TestAccDataSourceGoogleBeyondcorpAppConnection_basic(t *testing.T) {
2020
acctest.VcrTest(t, resource.TestCase{
2121
PreCheck: func() { acctest.AccTestPreCheck(t) },
2222
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
23-
ExternalProviders: map[string]resource.ExternalProvider{
24-
"time": {},
25-
},
26-
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
23+
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
2724
Steps: []resource.TestStep{
2825
{
2926
Config: testAccDataSourceGoogleBeyondcorpAppConnection_basic(context),
@@ -45,10 +42,7 @@ func TestAccDataSourceGoogleBeyondcorpAppConnection_full(t *testing.T) {
4542
acctest.VcrTest(t, resource.TestCase{
4643
PreCheck: func() { acctest.AccTestPreCheck(t) },
4744
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
48-
ExternalProviders: map[string]resource.ExternalProvider{
49-
"time": {},
50-
},
51-
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
45+
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
5246
Steps: []resource.TestStep{
5347
{
5448
Config: testAccDataSourceGoogleBeyondcorpAppConnection_full(context),
@@ -63,85 +57,68 @@ func TestAccDataSourceGoogleBeyondcorpAppConnection_full(t *testing.T) {
6357
func testAccDataSourceGoogleBeyondcorpAppConnection_basic(context map[string]interface{}) string {
6458
return acctest.Nprintf(`
6559
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"
6862
}
6963
70-
resource "time_sleep" "wait_120_seconds" {
71-
depends_on = [google_service_account.service_account]
72-
73-
create_duration = "120s"
74-
}
75-
76-
7764
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+
}
8671
}
8772
8873
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+
}
9984
}
10085
10186
data "google_beyondcorp_app_connection" "foo" {
102-
name = google_beyondcorp_app_connection.foo.name
87+
name = google_beyondcorp_app_connection.foo.name
10388
}
10489
`, context)
10590
}
10691

10792
func testAccDataSourceGoogleBeyondcorpAppConnection_full(context map[string]interface{}) string {
10893
return acctest.Nprintf(`
10994
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"
11897
}
11998
12099
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+
}
129106
}
130107
131108
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]
139116
}
140117
141118
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
145122
}
146123
`, context)
147124
}

google-beta/services/beyondcorp/resource_beyondcorp_app_connection_generated_test.go

+2-29
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ func TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample(t *testi
4040
acctest.VcrTest(t, resource.TestCase{
4141
PreCheck: func() { acctest.AccTestPreCheck(t) },
4242
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
43-
ExternalProviders: map[string]resource.ExternalProvider{
44-
"time": {},
45-
},
46-
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
43+
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
4744
Steps: []resource.TestStep{
4845
{
4946
Config: testAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample(context),
@@ -65,18 +62,7 @@ resource "google_service_account" "service_account" {
6562
display_name = "Test Service Account"
6663
}
6764
68-
# wait for service account to propagate -- can be needed due to
69-
# SA eventual consistency issue
70-
resource "time_sleep" "wait_120_seconds" {
71-
depends_on = [google_service_account.service_account]
72-
73-
create_duration = "120s"
74-
}
75-
76-
7765
resource "google_beyondcorp_app_connector" "app_connector" {
78-
depends_on = [time_sleep.wait_120_seconds]
79-
8066
name = "tf-test-my-app-connector%{random_suffix}"
8167
principal_info {
8268
service_account {
@@ -107,10 +93,7 @@ func TestAccBeyondcorpAppConnection_beyondcorpAppConnectionFullExample(t *testin
10793
acctest.VcrTest(t, resource.TestCase{
10894
PreCheck: func() { acctest.AccTestPreCheck(t) },
10995
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
110-
ExternalProviders: map[string]resource.ExternalProvider{
111-
"time": {},
112-
},
113-
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
96+
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
11497
Steps: []resource.TestStep{
11598
{
11699
Config: testAccBeyondcorpAppConnection_beyondcorpAppConnectionFullExample(context),
@@ -132,23 +115,13 @@ resource "google_service_account" "service_account" {
132115
display_name = "Test Service Account"
133116
}
134117
135-
# wait for service account to propagate -- can be needed due to
136-
# SA eventual consistency issue
137-
resource "time_sleep" "wait_120_seconds" {
138-
depends_on = [google_service_account.service_account]
139-
140-
create_duration = "120s"
141-
}
142-
143118
resource "google_beyondcorp_app_gateway" "app_gateway" {
144119
name = "tf-test-my-app-gateway%{random_suffix}"
145120
type = "TCP_PROXY"
146121
host_type = "GCP_REGIONAL_MIG"
147122
}
148123
149124
resource "google_beyondcorp_app_connector" "app_connector" {
150-
depends_on = [time_sleep.wait_120_seconds]
151-
152125
name = "tf-test-my-app-connector%{random_suffix}"
153126
principal_info {
154127
service_account {

google-beta/services/beyondcorp/resource_beyondcorp_app_connection_test.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ func TestAccBeyondcorpAppConnection_beyondcorpAppConnectionUpdateExample(t *test
1919
acctest.VcrTest(t, resource.TestCase{
2020
PreCheck: func() { acctest.AccTestPreCheck(t) },
2121
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
22-
ExternalProviders: map[string]resource.ExternalProvider{
23-
"time": {},
24-
},
25-
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
22+
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
2623
Steps: []resource.TestStep{
2724
{
2825
Config: testAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample(context),
@@ -56,16 +53,7 @@ resource "google_service_account" "service_account" {
5653
display_name = "Test Service Account"
5754
}
5855
59-
resource "time_sleep" "wait_120_seconds" {
60-
depends_on = [google_service_account.service_account]
61-
62-
create_duration = "120s"
63-
}
64-
65-
6656
resource "google_beyondcorp_app_connector" "app_connector" {
67-
depends_on = [time_sleep.wait_120_seconds]
68-
6957
name = "tf-test-my-app-connector%{random_suffix}"
7058
principal_info {
7159
service_account {

website/docs/r/beyondcorp_app_connection.html.markdown

-21
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,7 @@ resource "google_service_account" "service_account" {
4444
display_name = "Test Service Account"
4545
}
4646
47-
# wait for service account to propagate -- can be needed due to
48-
# SA eventual consistency issue
49-
resource "time_sleep" "wait_120_seconds" {
50-
depends_on = [google_service_account.service_account]
51-
52-
create_duration = "120s"
53-
}
54-
55-
5647
resource "google_beyondcorp_app_connector" "app_connector" {
57-
depends_on = [time_sleep.wait_120_seconds]
58-
5948
name = "my-app-connector"
6049
principal_info {
6150
service_account {
@@ -88,23 +77,13 @@ resource "google_service_account" "service_account" {
8877
display_name = "Test Service Account"
8978
}
9079
91-
# wait for service account to propagate -- can be needed due to
92-
# SA eventual consistency issue
93-
resource "time_sleep" "wait_120_seconds" {
94-
depends_on = [google_service_account.service_account]
95-
96-
create_duration = "120s"
97-
}
98-
9980
resource "google_beyondcorp_app_gateway" "app_gateway" {
10081
name = "my-app-gateway"
10182
type = "TCP_PROXY"
10283
host_type = "GCP_REGIONAL_MIG"
10384
}
10485
10586
resource "google_beyondcorp_app_connector" "app_connector" {
106-
depends_on = [time_sleep.wait_120_seconds]
107-
10887
name = "my-app-connector"
10988
principal_info {
11089
service_account {

0 commit comments

Comments
 (0)