Skip to content

Commit

Permalink
Allow updating single_cluster_routing in google_bigtable_app_profile (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rileykarson authored Sep 14, 2020
1 parent 1319e39 commit eaab447
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
1 change: 0 additions & 1 deletion products/bigtable/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ objects:
- multi_cluster_routing_use_any
description: |
Use a single-cluster routing policy.
input: true
properties:
- !ruby/object:Api::Type::String
name: 'clusterId'
Expand Down
24 changes: 16 additions & 8 deletions third_party/terraform/tests/resource_bigtable_app_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestAccBigtableAppProfile_update(t *testing.T) {
CheckDestroy: testAccCheckBigtableAppProfileDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccBigtableAppProfile_multiClusterRouting(instanceName),
Config: testAccBigtableAppProfile_update1(instanceName),
},
{
ResourceName: "google_bigtable_app_profile.ap",
Expand All @@ -29,7 +29,7 @@ func TestAccBigtableAppProfile_update(t *testing.T) {
ImportStateVerifyIgnore: []string{"ignore_warnings"},
},
{
Config: testAccBigtableAppProfile_update(instanceName),
Config: testAccBigtableAppProfile_update2(instanceName),
},
{
ResourceName: "google_bigtable_app_profile.ap",
Expand All @@ -41,7 +41,7 @@ func TestAccBigtableAppProfile_update(t *testing.T) {
})
}

func testAccBigtableAppProfile_multiClusterRouting(instanceName string) string {
func testAccBigtableAppProfile_update1(instanceName string) string {
return fmt.Sprintf(`
resource "google_bigtable_instance" "instance" {
name = "%s"
Expand All @@ -59,13 +59,17 @@ resource "google_bigtable_app_profile" "ap" {
instance = google_bigtable_instance.instance.id
app_profile_id = "test"
multi_cluster_routing_use_any = true
single_cluster_routing {
cluster_id = %q
allow_transactional_writes = true
}
ignore_warnings = true
}
`, instanceName, instanceName)
`, instanceName, instanceName, instanceName)
}

func testAccBigtableAppProfile_update(instanceName string) string {
func testAccBigtableAppProfile_update2(instanceName string) string {
return fmt.Sprintf(`
resource "google_bigtable_instance" "instance" {
name = "%s"
Expand All @@ -84,8 +88,12 @@ resource "google_bigtable_app_profile" "ap" {
app_profile_id = "test"
description = "add a description"
multi_cluster_routing_use_any = true
single_cluster_routing {
cluster_id = %q
allow_transactional_writes = false
}
ignore_warnings = true
}
`, instanceName, instanceName)
`, instanceName, instanceName, instanceName)
}

0 comments on commit eaab447

Please sign in to comment.