diff --git a/.changelog/3186.txt b/.changelog/3186.txt new file mode 100644 index 0000000000..330a061da7 --- /dev/null +++ b/.changelog/3186.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +`google_sql_source_representation_instance` +``` diff --git a/google-beta/provider.go b/google-beta/provider.go index be3b69ac4a..8e8e44d4d8 100644 --- a/google-beta/provider.go +++ b/google-beta/provider.go @@ -564,9 +564,9 @@ func Provider() terraform.ResourceProvider { return provider } -// Generated resources: 126 +// Generated resources: 127 // Generated IAM resources: 54 -// Total generated resources: 180 +// Total generated resources: 181 func ResourceMap() map[string]*schema.Resource { resourceMap, _ := ResourceMapWithErrors() return resourceMap @@ -746,6 +746,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) { "google_spanner_instance": resourceSpannerInstance(), "google_spanner_database": resourceSpannerDatabase(), "google_sql_database": resourceSQLDatabase(), + "google_sql_source_representation_instance": resourceSQLSourceRepresentationInstance(), "google_storage_bucket_iam_binding": ResourceIamBinding(StorageBucketIamSchema, StorageBucketIamUpdaterProducer, StorageBucketIdParseFunc), "google_storage_bucket_iam_member": ResourceIamMember(StorageBucketIamSchema, StorageBucketIamUpdaterProducer, StorageBucketIdParseFunc), "google_storage_bucket_iam_policy": ResourceIamPolicy(StorageBucketIamSchema, StorageBucketIamUpdaterProducer, StorageBucketIdParseFunc), diff --git a/google-beta/resource_sql_source_representation_instance.go b/google-beta/resource_sql_source_representation_instance.go new file mode 100644 index 0000000000..01e9fcac51 --- /dev/null +++ b/google-beta/resource_sql_source_representation_instance.go @@ -0,0 +1,378 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "fmt" + "log" + "reflect" + "strconv" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func resourceSQLSourceRepresentationInstance() *schema.Resource { + return &schema.Resource{ + Create: resourceSQLSourceRepresentationInstanceCreate, + Read: resourceSQLSourceRepresentationInstanceRead, + Delete: resourceSQLSourceRepresentationInstanceDelete, + + Importer: &schema.ResourceImporter{ + State: resourceSQLSourceRepresentationInstanceImport, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(4 * time.Minute), + Delete: schema.DefaultTimeout(4 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "database_version": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{"MYSQL_5_6", "MYSQL_5_7"}, false), + Description: `The MySQL version running on your source database server: MYSQL_5_6 or MYSQL_5_7.`, + }, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: `The name of the source representation instance. Use any valid Cloud SQL instance name.`, + }, + "host": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validateIpAddress, + Description: `The externally accessible IPv4 address for the source database server.`, + }, + "port": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(0, 65535), + Description: `The externally accessible port for the source database server. +Defaults to 3306.`, + Default: 3306, + }, + + "region": { + Type: schema.TypeString, + Computed: true, + Optional: true, + ForceNew: true, + Description: `The Region in which the created instance should reside. +If it is not provided, the provider region is used.`, + }, + "project": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + }, + } +} + +func resourceSQLSourceRepresentationInstanceCreate(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + obj := make(map[string]interface{}) + nameProp, err := expandSQLSourceRepresentationInstanceName(d.Get("name"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("name"); !isEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) { + obj["name"] = nameProp + } + regionProp, err := expandSQLSourceRepresentationInstanceRegion(d.Get("region"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("region"); !isEmptyValue(reflect.ValueOf(regionProp)) && (ok || !reflect.DeepEqual(v, regionProp)) { + obj["region"] = regionProp + } + databaseVersionProp, err := expandSQLSourceRepresentationInstanceDatabaseVersion(d.Get("database_version"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("database_version"); !isEmptyValue(reflect.ValueOf(databaseVersionProp)) && (ok || !reflect.DeepEqual(v, databaseVersionProp)) { + obj["databaseVersion"] = databaseVersionProp + } + onPremisesConfigurationProp, err := expandSQLSourceRepresentationInstanceOnPremisesConfiguration(nil, d, config) + if err != nil { + return err + } else if !isEmptyValue(reflect.ValueOf(onPremisesConfigurationProp)) { + obj["onPremisesConfiguration"] = onPremisesConfigurationProp + } + + obj, err = resourceSQLSourceRepresentationInstanceEncoder(d, meta, obj) + if err != nil { + return err + } + + url, err := replaceVars(d, config, "{{SQLBasePath}}projects/{{project}}/instances") + if err != nil { + return err + } + + log.Printf("[DEBUG] Creating new SourceRepresentationInstance: %#v", obj) + project, err := getProject(d, config) + if err != nil { + return err + } + res, err := sendRequestWithTimeout(config, "POST", project, url, obj, d.Timeout(schema.TimeoutCreate)) + if err != nil { + return fmt.Errorf("Error creating SourceRepresentationInstance: %s", err) + } + + // Store the ID now + id, err := replaceVars(d, config, "projects/{{project}}/instances/{{name}}") + if err != nil { + return fmt.Errorf("Error constructing id: %s", err) + } + d.SetId(id) + + err = sqlAdminOperationWaitTime( + config, res, project, "Creating SourceRepresentationInstance", + int(d.Timeout(schema.TimeoutCreate).Minutes())) + + if err != nil { + // The resource didn't actually create + d.SetId("") + return fmt.Errorf("Error waiting to create SourceRepresentationInstance: %s", err) + } + + log.Printf("[DEBUG] Finished creating SourceRepresentationInstance %q: %#v", d.Id(), res) + + return resourceSQLSourceRepresentationInstanceRead(d, meta) +} + +func resourceSQLSourceRepresentationInstanceRead(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + url, err := replaceVars(d, config, "{{SQLBasePath}}projects/{{project}}/instances/{{name}}") + if err != nil { + return err + } + + project, err := getProject(d, config) + if err != nil { + return err + } + res, err := sendRequest(config, "GET", project, url, nil) + if err != nil { + return handleNotFoundError(err, d, fmt.Sprintf("SQLSourceRepresentationInstance %q", d.Id())) + } + + res, err = resourceSQLSourceRepresentationInstanceDecoder(d, meta, res) + if err != nil { + return err + } + + if res == nil { + // Decoding the object has resulted in it being gone. It may be marked deleted + log.Printf("[DEBUG] Removing SQLSourceRepresentationInstance because it no longer exists.") + d.SetId("") + return nil + } + + if err := d.Set("project", project); err != nil { + return fmt.Errorf("Error reading SourceRepresentationInstance: %s", err) + } + + if err := d.Set("name", flattenSQLSourceRepresentationInstanceName(res["name"], d, config)); err != nil { + return fmt.Errorf("Error reading SourceRepresentationInstance: %s", err) + } + if err := d.Set("region", flattenSQLSourceRepresentationInstanceRegion(res["region"], d, config)); err != nil { + return fmt.Errorf("Error reading SourceRepresentationInstance: %s", err) + } + if err := d.Set("database_version", flattenSQLSourceRepresentationInstanceDatabaseVersion(res["databaseVersion"], d, config)); err != nil { + return fmt.Errorf("Error reading SourceRepresentationInstance: %s", err) + } + // Terraform must set the top level schema field, but since this object contains collapsed properties + // it's difficult to know what the top level should be. Instead we just loop over the map returned from flatten. + if flattenedProp := flattenSQLSourceRepresentationInstanceOnPremisesConfiguration(res["onPremisesConfiguration"], d, config); flattenedProp != nil { + casted := flattenedProp.([]interface{})[0] + if casted != nil { + for k, v := range casted.(map[string]interface{}) { + d.Set(k, v) + } + } + } + + return nil +} + +func resourceSQLSourceRepresentationInstanceDelete(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + + project, err := getProject(d, config) + if err != nil { + return err + } + + url, err := replaceVars(d, config, "{{SQLBasePath}}projects/{{project}}/instances/{{name}}") + if err != nil { + return err + } + + var obj map[string]interface{} + log.Printf("[DEBUG] Deleting SourceRepresentationInstance %q", d.Id()) + + res, err := sendRequestWithTimeout(config, "DELETE", project, url, obj, d.Timeout(schema.TimeoutDelete)) + if err != nil { + return handleNotFoundError(err, d, "SourceRepresentationInstance") + } + + err = sqlAdminOperationWaitTime( + config, res, project, "Deleting SourceRepresentationInstance", + int(d.Timeout(schema.TimeoutDelete).Minutes())) + + if err != nil { + return err + } + + log.Printf("[DEBUG] Finished deleting SourceRepresentationInstance %q: %#v", d.Id(), res) + return nil +} + +func resourceSQLSourceRepresentationInstanceImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + config := meta.(*Config) + if err := parseImportId([]string{ + "projects/(?P[^/]+)/instances/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)", + }, d, config); err != nil { + return nil, err + } + + // Replace import id for the resource id + id, err := replaceVars(d, config, "projects/{{project}}/instances/{{name}}") + if err != nil { + return nil, fmt.Errorf("Error constructing id: %s", err) + } + d.SetId(id) + + return []*schema.ResourceData{d}, nil +} + +func flattenSQLSourceRepresentationInstanceName(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSQLSourceRepresentationInstanceRegion(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSQLSourceRepresentationInstanceDatabaseVersion(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSQLSourceRepresentationInstanceOnPremisesConfiguration(v interface{}, d *schema.ResourceData, config *Config) interface{} { + if v == nil { + return nil + } + original := v.(map[string]interface{}) + if len(original) == 0 { + return nil + } + transformed := make(map[string]interface{}) + transformed["host"] = + flattenSQLSourceRepresentationInstanceOnPremisesConfigurationHost(original["host"], d, config) + transformed["port"] = + flattenSQLSourceRepresentationInstanceOnPremisesConfigurationPort(original["port"], d, config) + return []interface{}{transformed} +} +func flattenSQLSourceRepresentationInstanceOnPremisesConfigurationHost(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenSQLSourceRepresentationInstanceOnPremisesConfigurationPort(v interface{}, d *schema.ResourceData, config *Config) interface{} { + // Handles the string fixed64 format + if strVal, ok := v.(string); ok { + if intVal, err := strconv.ParseInt(strVal, 10, 64); err == nil { + return intVal + } // let terraform core handle it if we can't convert the string to an int. + } + return v +} + +func expandSQLSourceRepresentationInstanceName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + return v, nil +} + +func expandSQLSourceRepresentationInstanceRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + return v, nil +} + +func expandSQLSourceRepresentationInstanceDatabaseVersion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + return v, nil +} + +func expandSQLSourceRepresentationInstanceOnPremisesConfiguration(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + transformed := make(map[string]interface{}) + transformedHost, err := expandSQLSourceRepresentationInstanceOnPremisesConfigurationHost(d.Get("host"), d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedHost); val.IsValid() && !isEmptyValue(val) { + transformed["host"] = transformedHost + } + + transformedPort, err := expandSQLSourceRepresentationInstanceOnPremisesConfigurationPort(d.Get("port"), d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedPort); val.IsValid() && !isEmptyValue(val) { + transformed["port"] = transformedPort + } + + return transformed, nil +} + +func expandSQLSourceRepresentationInstanceOnPremisesConfigurationHost(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + return v, nil +} + +func expandSQLSourceRepresentationInstanceOnPremisesConfigurationPort(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + return v, nil +} + +func resourceSQLSourceRepresentationInstanceEncoder(d *schema.ResourceData, meta interface{}, obj map[string]interface{}) (map[string]interface{}, error) { + opc := obj["onPremisesConfiguration"].(map[string]interface{}) + opc["hostPort"] = fmt.Sprintf("%v:%v", opc["host"], opc["port"]) + delete(opc, "host") + delete(opc, "port") + return obj, nil +} + +func resourceSQLSourceRepresentationInstanceDecoder(d *schema.ResourceData, meta interface{}, res map[string]interface{}) (map[string]interface{}, error) { + if v, ok := res["onPremisesConfiguration"]; ok { + opc := v.(map[string]interface{}) + hostPort := opc["hostPort"] + spl := strings.Split(hostPort.(string), ":") + if len(spl) != 2 { + return nil, fmt.Errorf("unexpected value for hostPort, expected [host]:[port], got %q", hostPort) + } + opc["host"] = spl[0] + p, err := strconv.Atoi(spl[1]) + if err != nil { + return nil, fmt.Errorf("error converting port %q to int: %v", spl[1], err) + } + opc["port"] = p + delete(opc, "hostPort") + } + return res, nil +} diff --git a/google-beta/resource_sql_source_representation_instance_generated_test.go b/google-beta/resource_sql_source_representation_instance_generated_test.go new file mode 100644 index 0000000000..b2d7b6df9a --- /dev/null +++ b/google-beta/resource_sql_source_representation_instance_generated_test.go @@ -0,0 +1,86 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "fmt" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccSQLSourceRepresentationInstance_sqlSourceRepresentationInstanceBasicExample(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(10), + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckSQLSourceRepresentationInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSQLSourceRepresentationInstance_sqlSourceRepresentationInstanceBasicExample(context), + }, + { + ResourceName: "google_sql_source_representation_instance.instance", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccSQLSourceRepresentationInstance_sqlSourceRepresentationInstanceBasicExample(context map[string]interface{}) string { + return Nprintf(` +resource "google_sql_source_representation_instance" "instance" { + name = "tf-test-my-instance%{random_suffix}" + region = "us-central1" + database_version = "MYSQL_5_7" + host = "10.20.30.40" + port = 3306 +} +`, context) +} + +func testAccCheckSQLSourceRepresentationInstanceDestroy(s *terraform.State) error { + for name, rs := range s.RootModule().Resources { + if rs.Type != "google_sql_source_representation_instance" { + continue + } + if strings.HasPrefix(name, "data.") { + continue + } + + config := testAccProvider.Meta().(*Config) + + url, err := replaceVarsForTest(config, rs, "{{SQLBasePath}}projects/{{project}}/instances/{{name}}") + if err != nil { + return err + } + + _, err = sendRequest(config, "GET", "", url, nil) + if err == nil { + return fmt.Errorf("SQLSourceRepresentationInstance still exists at %s", url) + } + } + + return nil +} diff --git a/google-beta/resource_sql_source_representation_instance_sweeper_test.go b/google-beta/resource_sql_source_representation_instance_sweeper_test.go new file mode 100644 index 0000000000..d318174761 --- /dev/null +++ b/google-beta/resource_sql_source_representation_instance_sweeper_test.go @@ -0,0 +1,119 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "context" + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func init() { + resource.AddTestSweepers("SQLSourceRepresentationInstance", &resource.Sweeper{ + Name: "SQLSourceRepresentationInstance", + F: testSweepSQLSourceRepresentationInstance, + }) +} + +// At the time of writing, the CI only passes us-central1 as the region +func testSweepSQLSourceRepresentationInstance(region string) error { + resourceName := "SQLSourceRepresentationInstance" + log.Printf("[INFO][SWEEPER_LOG] Starting sweeper for %s", resourceName) + + config, err := sharedConfigForRegion(region) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error getting shared config for region: %s", err) + return err + } + + err = config.LoadAndValidate(context.Background()) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error loading: %s", err) + return err + } + + // Setup variables to replace in list template + d := &ResourceDataMock{ + FieldsInSchema: map[string]interface{}{ + "project": config.Project, + "region": region, + "location": region, + "zone": "-", + }, + } + + listTemplate := strings.Split("https://sqladmin.googleapis.com/sql/v1beta4/projects/{{project}}/instances", "?")[0] + listUrl, err := replaceVars(d, config, listTemplate) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error preparing sweeper list url: %s", err) + return nil + } + + res, err := sendRequest(config, "GET", config.Project, listUrl, nil) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] Error in response from request %s: %s", listUrl, err) + return nil + } + + resourceList, ok := res["sourceRepresentationInstances"] + if !ok { + log.Printf("[INFO][SWEEPER_LOG] Nothing found in response.") + return nil + } + + rl := resourceList.([]interface{}) + + log.Printf("[INFO][SWEEPER_LOG] Found %d items in %s list response.", len(rl), resourceName) + // items who don't match the tf-test prefix + nonPrefixCount := 0 + for _, ri := range rl { + obj := ri.(map[string]interface{}) + if obj["name"] == nil { + log.Printf("[INFO][SWEEPER_LOG] %s resource name was nil", resourceName) + return nil + } + + name := GetResourceNameFromSelfLink(obj["name"].(string)) + // Only sweep resources with the test prefix + if !strings.HasPrefix(name, "tf-test") { + nonPrefixCount++ + continue + } + + deleteTemplate := "https://sqladmin.googleapis.com/sql/v1beta4/projects/{{project}}/instances/{{name}}" + deleteUrl, err := replaceVars(d, config, deleteTemplate) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] error preparing delete url: %s", err) + return nil + } + deleteUrl = deleteUrl + name + + // Don't wait on operations as we may have a lot to delete + _, err = sendRequest(config, "DELETE", config.Project, deleteUrl, nil) + if err != nil { + log.Printf("[INFO][SWEEPER_LOG] Error deleting for url %s : %s", deleteUrl, err) + } else { + log.Printf("[INFO][SWEEPER_LOG] Sent delete request for %s resource: %s", resourceName, name) + } + } + + if nonPrefixCount > 0 { + log.Printf("[INFO][SWEEPER_LOG] %d items without tf_test prefix remain.", nonPrefixCount) + } + + return nil +} diff --git a/website/docs/r/sql_source_representation_instance.html.markdown b/website/docs/r/sql_source_representation_instance.html.markdown new file mode 100644 index 0000000000..bbfd692ec2 --- /dev/null +++ b/website/docs/r/sql_source_representation_instance.html.markdown @@ -0,0 +1,117 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in +# .github/CONTRIBUTING.md. +# +# ---------------------------------------------------------------------------- +subcategory: "Cloud SQL" +layout: "google" +page_title: "Google: google_sql_source_representation_instance" +sidebar_current: "docs-google-sql-source-representation-instance" +description: |- + A source representation instance is a Cloud SQL instance that represents + the source database server to the Cloud SQL replica. +--- + +# google\_sql\_source\_representation\_instance + +A source representation instance is a Cloud SQL instance that represents +the source database server to the Cloud SQL replica. It is visible in the +Cloud Console and appears the same as a regular Cloud SQL instance, but it +contains no data, requires no configuration or maintenance, and does not +affect billing. You cannot update the source representation instance. + + + + +## Example Usage - Sql Source Representation Instance Basic + + +```hcl +resource "google_sql_source_representation_instance" "instance" { + name = "my-instance" + region = "us-central1" + database_version = "MYSQL_5_7" + host = "10.20.30.40" + port = 3306 +} +``` + +## Argument Reference + +The following arguments are supported: + + +* `name` - + (Required) + The name of the source representation instance. Use any valid Cloud SQL instance name. + +* `database_version` - + (Required) + The MySQL version running on your source database server: MYSQL_5_6 or MYSQL_5_7. + +* `host` - + (Required) + The externally accessible IPv4 address for the source database server. + + +- - - + + +* `region` - + (Optional) + The Region in which the created instance should reside. + If it is not provided, the provider region is used. + +* `port` - + (Optional) + The externally accessible port for the source database server. + Defaults to 3306. + +* `project` - (Optional) The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + + +## Attributes Reference + +In addition to the arguments listed above, the following computed attributes are exported: + +* `id` - an identifier for the resource with format `projects/{{project}}/instances/{{name}}` + + +## Timeouts + +This resource provides the following +[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `create` - Default is 4 minutes. +- `delete` - Default is 4 minutes. + +## Import + +SourceRepresentationInstance can be imported using any of these accepted formats: + +``` +$ terraform import google_sql_source_representation_instance.default projects/{{project}}/instances/{{name}} +$ terraform import google_sql_source_representation_instance.default {{project}}/{{name}} +$ terraform import google_sql_source_representation_instance.default {{name}} +``` + +-> If you're importing a resource with beta features, make sure to include `-provider=google-beta` +as an argument so that Terraform uses the correct provider to import your resource. + +## User Project Overrides + +This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override). diff --git a/website/google.erb b/website/google.erb index 92670400b6..eb1c0c6181 100644 --- a/website/google.erb +++ b/website/google.erb @@ -1379,6 +1379,10 @@ google_sql_database_instance + > + google_sql_source_representation_instance + + > google_sql_ssl_cert