-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. Setting appGateway resoruce to be non updatable. 3. Added a test to verify update/patch ot app connector
- Loading branch information
1 parent
fd081de
commit c76750c
Showing
3 changed files
with
69 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
mmv1/third_party/terraform/tests/resource_beyondcorp_app_connector_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package google | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
) | ||
|
||
func TestAccBeyondcorpAppConnector_beyondcorpAppConnectorUpdateExample(t *testing.T) { | ||
t.Parallel() | ||
|
||
context := map[string]interface{}{ | ||
"random_suffix": randString(t, 10), | ||
} | ||
|
||
vcrTest(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testAccCheckBeyondcorpAppConnectorDestroyProducer(t), | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccBeyondcorpAppConnector_beyondcorpAppConnectorBasicExample(context), | ||
}, | ||
{ | ||
ResourceName: "google_beyondcorp_app_connector.app_connector", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"name", "region"}, | ||
}, | ||
{ | ||
Config: testAccBeyondcorpAppConnector_beyondcorpAppConnectorUpdateExample(context), | ||
}, | ||
{ | ||
ResourceName: "google_beyondcorp_app_connector.app_connector", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"name", "region"}, | ||
}, | ||
{ | ||
Config: testAccBeyondcorpAppConnector_beyondcorpAppConnectorBasicExample(context), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testAccBeyondcorpAppConnector_beyondcorpAppConnectorUpdateExample(context map[string]interface{}) string { | ||
return Nprintf(` | ||
resource "google_service_account" "service_account" { | ||
account_id = "tf-test-my-account%{random_suffix}" | ||
display_name = "Test Service Account" | ||
} | ||
resource "google_beyondcorp_app_connector" "app_connector" { | ||
name = "tf-test-my-app-connector%{random_suffix}" | ||
principal_info { | ||
service_account { | ||
email = google_service_account.service_account.email | ||
} | ||
} | ||
display_name = "Some display name" | ||
} | ||
`, context) | ||
} |