mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-03 01:01:06 +00:00
Allow use of provider region, with big caveats in docs. (#1463)
This commit is contained in:
parent
105709bbdb
commit
560e180693
@ -51,7 +51,7 @@ func resourceSqlDatabaseInstance() *schema.Resource {
|
||||
Schema: map[string]*schema.Schema{
|
||||
"region": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
@ -423,7 +423,10 @@ func resourceSqlDatabaseInstanceCreate(d *schema.ResourceData, meta interface{})
|
||||
return err
|
||||
}
|
||||
|
||||
region := d.Get("region").(string)
|
||||
region, err := getRegion(d, config)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
databaseVersion := d.Get("database_version").(string)
|
||||
|
||||
_settingsList := d.Get("settings").([]interface{})
|
||||
|
@ -59,6 +59,10 @@ The following arguments are supported:
|
||||
* `region` - (Required) The region the instance will sit in. Note, first-generation Cloud SQL instance
|
||||
regions do not line up with the Google Compute Engine (GCE) regions, and Cloud SQL is not
|
||||
available in all regions - choose from one of the options listed [here](https://cloud.google.com/sql/docs/mysql/instance-locations).
|
||||
A valid region must be provided to use this resource. If a region is not provided in the resource definition,
|
||||
the provider region will be used instead, but this will be an apply-time error for all first-generation
|
||||
instances *and* for second-generation instances if the provider region is not supported with Cloud SQL.
|
||||
If you choose not to provide the `region` argument for this resource, make sure you understand this.
|
||||
|
||||
* `settings` - (Required) The settings to use for the database. The
|
||||
configuration is detailed below.
|
||||
|
Loading…
Reference in New Issue
Block a user