Skip to content

Commit

Permalink
Deprecate convenience fields in google_compute_snapshot (#2572)
Browse files Browse the repository at this point in the history
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
  • Loading branch information
modular-magician authored and rileykarson committed Dec 5, 2018
1 parent 2afc653 commit df27012
Show file tree
Hide file tree
Showing 7 changed files with 1,344 additions and 188 deletions.
1 change: 0 additions & 1 deletion google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func Provider() terraform.ResourceProvider {
"google_compute_attached_disk": resourceComputeAttachedDisk(),
"google_compute_backend_service": resourceComputeBackendService(),
"google_compute_disk": resourceComputeDisk(),
"google_compute_snapshot": resourceComputeSnapshot(),
"google_compute_firewall": resourceComputeFirewall(),
"google_compute_forwarding_rule": resourceComputeForwardingRule(),
"google_compute_global_forwarding_rule": resourceComputeGlobalForwardingRule(),
Expand Down
1 change: 1 addition & 0 deletions google/provider_compute_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var GeneratedComputeResourcesMap = map[string]*schema.Resource{
"google_compute_region_disk": resourceComputeRegionDisk(),
"google_compute_route": resourceComputeRoute(),
"google_compute_router": resourceComputeRouter(),
"google_compute_snapshot": resourceComputeSnapshot(),
"google_compute_ssl_certificate": resourceComputeSslCertificate(),
"google_compute_ssl_policy": resourceComputeSslPolicy(),
"google_compute_subnetwork": resourceComputeSubnetwork(),
Expand Down
4 changes: 0 additions & 4 deletions google/resource_bigtable_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,20 @@ func resourceBigtableInstance() *schema.Resource {
"cluster_id": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"zone": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"num_nodes": {
Type: schema.TypeInt,
Optional: true,
ForceNew: true,
ValidateFunc: validation.IntAtLeast(3),
},
"storage_type": {
Type: schema.TypeString,
Optional: true,
Default: "SSD",
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"SSD", "HDD"}, false),
},
},
Expand Down
15 changes: 4 additions & 11 deletions google/resource_bigtable_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@ func TestAccBigtableInstance_basic(t *testing.T) {
CheckDestroy: testAccCheckBigtableInstanceDestroy,
Steps: []resource.TestStep{
{
Config: testAccBigtableInstance(instanceName, 3),
Check: resource.ComposeTestCheckFunc(
testAccBigtableInstanceExists(
"google_bigtable_instance.instance"),
),
},
{
Config: testAccBigtableInstance(instanceName, 4),
Config: testAccBigtableInstance(instanceName),
Check: resource.ComposeTestCheckFunc(
testAccBigtableInstanceExists(
"google_bigtable_instance.instance"),
Expand Down Expand Up @@ -132,18 +125,18 @@ func testAccBigtableInstanceExists(n string) resource.TestCheckFunc {
}
}

func testAccBigtableInstance(instanceName string, numNodes int) string {
func testAccBigtableInstance(instanceName string) string {
return fmt.Sprintf(`
resource "google_bigtable_instance" "instance" {
name = "%s"
cluster {
cluster_id = "%s"
zone = "us-central1-b"
num_nodes = %d
num_nodes = 3
storage_type = "HDD"
}
}
`, instanceName, instanceName, numNodes)
`, instanceName, instanceName)
}

func testAccBigtableInstance_cluster(instanceName string) string {
Expand Down
Loading

0 comments on commit df27012

Please sign in to comment.