Skip to content

Commit

Permalink
Revert "wait for SA to propagate on beyondcord app" (#12386) (#20450)
Browse files Browse the repository at this point in the history
[upstream:206992bee01c41ff727f0c94fc14a813cb902d3d]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Nov 22, 2024
1 parent 58f2f55 commit 8cc65f4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 125 deletions.
2 changes: 2 additions & 0 deletions .changelog/12386.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
```release-note:none
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ func TestAccDataSourceGoogleBeyondcorpAppConnection_basic(t *testing.T) {
acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
ExternalProviders: map[string]resource.ExternalProvider{
"time": {},
},
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccDataSourceGoogleBeyondcorpAppConnection_basic(context),
Expand All @@ -45,10 +42,7 @@ func TestAccDataSourceGoogleBeyondcorpAppConnection_full(t *testing.T) {
acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
ExternalProviders: map[string]resource.ExternalProvider{
"time": {},
},
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccDataSourceGoogleBeyondcorpAppConnection_full(context),
Expand All @@ -63,85 +57,68 @@ func TestAccDataSourceGoogleBeyondcorpAppConnection_full(t *testing.T) {
func testAccDataSourceGoogleBeyondcorpAppConnection_basic(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_service_account" "service_account" {
account_id = "tf-test-my-account%{random_suffix}"
display_name = "Test Service Account"
account_id = "tf-test-my-account%{random_suffix}"
display_name = "Test Service Account"
}
resource "time_sleep" "wait_120_seconds" {
depends_on = [google_service_account.service_account]
create_duration = "120s"
}
resource "google_beyondcorp_app_connector" "app_connector" {
depends_on = [time_sleep.wait_120_seconds]
name = "tf-test-appconnector-%{random_suffix}"
principal_info {
service_account {
email = google_service_account.service_account.email
}
}
name = "tf-test-appconnector-%{random_suffix}"
principal_info {
service_account {
email = google_service_account.service_account.email
}
}
}
resource "google_beyondcorp_app_connection" "foo" {
name = "tf-test-my-app-connection-%{random_suffix}"
type = "TCP_PROXY"
application_endpoint {
host = "foo-host"
port = 8080
}
connectors = [google_beyondcorp_app_connector.app_connector.id]
labels = {
my-label = "my-label-value"
}
name = "tf-test-my-app-connection-%{random_suffix}"
type = "TCP_PROXY"
application_endpoint {
host = "foo-host"
port = 8080
}
connectors = [google_beyondcorp_app_connector.app_connector.id]
labels = {
my-label = "my-label-value"
}
}
data "google_beyondcorp_app_connection" "foo" {
name = google_beyondcorp_app_connection.foo.name
name = google_beyondcorp_app_connection.foo.name
}
`, context)
}

func testAccDataSourceGoogleBeyondcorpAppConnection_full(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_service_account" "service_account" {
account_id = "tf-test-my-account%{random_suffix}"
display_name = "Test Service Account"
}
resource "time_sleep" "wait_120_seconds" {
depends_on = [google_service_account.service_account]
create_duration = "120s"
account_id = "tf-test-my-account%{random_suffix}"
display_name = "Test Service Account"
}
resource "google_beyondcorp_app_connector" "app_connector" {
depends_on = [time_sleep.wait_120_seconds]
name = "tf-test-appconnector-%{random_suffix}"
principal_info {
service_account {
email = google_service_account.service_account.email
}
}
name = "tf-test-appconnector-%{random_suffix}"
principal_info {
service_account {
email = google_service_account.service_account.email
}
}
}
resource "google_beyondcorp_app_connection" "foo" {
name = "tf-test-my-app-connection-%{random_suffix}"
type = "TCP_PROXY"
application_endpoint {
host = "foo-host"
port = 8080
}
connectors = [google_beyondcorp_app_connector.app_connector.id]
name = "tf-test-my-app-connection-%{random_suffix}"
type = "TCP_PROXY"
application_endpoint {
host = "foo-host"
port = 8080
}
connectors = [google_beyondcorp_app_connector.app_connector.id]
}
data "google_beyondcorp_app_connection" "foo" {
name = google_beyondcorp_app_connection.foo.name
project = google_beyondcorp_app_connection.foo.project
region = google_beyondcorp_app_connection.foo.region
name = google_beyondcorp_app_connection.foo.name
project = google_beyondcorp_app_connection.foo.project
region = google_beyondcorp_app_connection.foo.region
}
`, context)
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ func TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample(t *testi
acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
ExternalProviders: map[string]resource.ExternalProvider{
"time": {},
},
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample(context),
Expand All @@ -65,18 +62,7 @@ resource "google_service_account" "service_account" {
display_name = "Test Service Account"
}
# wait for service account to propagate -- can be needed due to
# SA eventual consistency issue
resource "time_sleep" "wait_120_seconds" {
depends_on = [google_service_account.service_account]
create_duration = "120s"
}
resource "google_beyondcorp_app_connector" "app_connector" {
depends_on = [time_sleep.wait_120_seconds]
name = "tf-test-my-app-connector%{random_suffix}"
principal_info {
service_account {
Expand Down Expand Up @@ -107,10 +93,7 @@ func TestAccBeyondcorpAppConnection_beyondcorpAppConnectionFullExample(t *testin
acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
ExternalProviders: map[string]resource.ExternalProvider{
"time": {},
},
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccBeyondcorpAppConnection_beyondcorpAppConnectionFullExample(context),
Expand All @@ -132,23 +115,13 @@ resource "google_service_account" "service_account" {
display_name = "Test Service Account"
}
# wait for service account to propagate -- can be needed due to
# SA eventual consistency issue
resource "time_sleep" "wait_120_seconds" {
depends_on = [google_service_account.service_account]
create_duration = "120s"
}
resource "google_beyondcorp_app_gateway" "app_gateway" {
name = "tf-test-my-app-gateway%{random_suffix}"
type = "TCP_PROXY"
host_type = "GCP_REGIONAL_MIG"
}
resource "google_beyondcorp_app_connector" "app_connector" {
depends_on = [time_sleep.wait_120_seconds]
name = "tf-test-my-app-connector%{random_suffix}"
principal_info {
service_account {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ func TestAccBeyondcorpAppConnection_beyondcorpAppConnectionUpdateExample(t *test
acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
ExternalProviders: map[string]resource.ExternalProvider{
"time": {},
},
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
CheckDestroy: testAccCheckBeyondcorpAppConnectionDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample(context),
Expand Down Expand Up @@ -56,16 +53,7 @@ resource "google_service_account" "service_account" {
display_name = "Test Service Account"
}
resource "time_sleep" "wait_120_seconds" {
depends_on = [google_service_account.service_account]
create_duration = "120s"
}
resource "google_beyondcorp_app_connector" "app_connector" {
depends_on = [time_sleep.wait_120_seconds]
name = "tf-test-my-app-connector%{random_suffix}"
principal_info {
service_account {
Expand Down
21 changes: 0 additions & 21 deletions website/docs/r/beyondcorp_app_connection.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,7 @@ resource "google_service_account" "service_account" {
display_name = "Test Service Account"
}
# wait for service account to propagate -- can be needed due to
# SA eventual consistency issue
resource "time_sleep" "wait_120_seconds" {
depends_on = [google_service_account.service_account]
create_duration = "120s"
}
resource "google_beyondcorp_app_connector" "app_connector" {
depends_on = [time_sleep.wait_120_seconds]
name = "my-app-connector"
principal_info {
service_account {
Expand Down Expand Up @@ -88,23 +77,13 @@ resource "google_service_account" "service_account" {
display_name = "Test Service Account"
}
# wait for service account to propagate -- can be needed due to
# SA eventual consistency issue
resource "time_sleep" "wait_120_seconds" {
depends_on = [google_service_account.service_account]
create_duration = "120s"
}
resource "google_beyondcorp_app_gateway" "app_gateway" {
name = "my-app-gateway"
type = "TCP_PROXY"
host_type = "GCP_REGIONAL_MIG"
}
resource "google_beyondcorp_app_connector" "app_connector" {
depends_on = [time_sleep.wait_120_seconds]
name = "my-app-connector"
principal_info {
service_account {
Expand Down

0 comments on commit 8cc65f4

Please sign in to comment.