github.com/jmbataller/terraform@v0.6.8-0.20151125192640-b7a12e3a580c/website/source/docs/providers/google/r/sql_database_instance.html.markdown (about)

     1  ---
     2  layout: "google"
     3  page_title: "Google: google_sql_database_instance"
     4  sidebar_current: "docs-google-sql-database-instance"
     5  description: |-
     6    Creates a new SQL database instance in Google Cloud SQL.
     7  ---
     8  
     9  # google\_sql\_database\_instance
    10  
    11  Creates a new Google SQL Database Instance. For more information, see the [official documentation](https://cloud.google.com/sql/), or the [JSON API](https://cloud.google.com/sql/docs/admin-api/v1beta4/instances).
    12  
    13  ## Example Usage
    14  
    15  Example creating a SQL Database.
    16  
    17  ```
    18  resource "google_sql_database_instance" "master" {
    19      name = "master-instance"
    20  
    21      settings {
    22          tier = "D0"
    23      }
    24  }
    25  ```
    26  
    27  ## Argument Reference
    28  
    29  The following arguments are supported:
    30  
    31  * `name` - (Required) The name of the instance.
    32  
    33  * `region` - (Required) The region the instance will sit in. Note, this does
    34    not line up with the Google Compute Engine (GCE) regions - your options are
    35    `us-central`, `asia-west1`, `europe-west1`, and `us-east1`.
    36  
    37  * `master_instance_name` - (Optional) The name of the instance that will act as
    38    the master in the replication setup. Note, this requires the master to have
    39    `binary_log_enabled` set, as well as existing backups.
    40  
    41  * `database_version` - (Optional, Default: `MYSQL_5_5`) The MySQL version to
    42    use. Can be either `MYSQL_5_5` or `MYSQL_5_6`.
    43  
    44  * `pricing_plan` - (Optional) Pricing plan for this instance, can be one of
    45    `PER_USE` or `PACKAGE`.
    46  
    47  * `replication_type` - (Optional) Replication type for this instance, can be one of
    48    `ASYNCHRONOUS` or `SYNCHRONOUS`.
    49  
    50  The required `settings` block supports:
    51  
    52  * `tier` - (Required) The machine tier to use. See
    53    [pricing](https://cloud.google.com/sql/pricing) for more details and
    54    supported versions.
    55  
    56  * `activation_policy` - (Optional) This specifies when the instance should be
    57    active. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`.
    58  
    59  * `authorized_gae_applications` - (Optional) A list of Google App Engine (GAE) project names that
    60    are allowed to access this instance.
    61  
    62  * `crash_safe_replication` - (Optional) Specific to read instances, indicates
    63    when crash-safe replication flags are enabled.
    64  
    65  The optional `settings.database_flags` sublist supports:
    66  
    67  * `name` - (Optional) Name of the flag.
    68  
    69  * `value` - (Optional) Value of the flag.
    70  
    71  The optional `settings.backup_configuration` subblock supports:
    72  
    73  * `binary_log_enabled` - (Optional) True iff binary logging is enabled. If
    74    `logging` is false, this must be as well.
    75  
    76  * `enabled` - (Optional) True iff backup configuration is enabled.
    77  
    78  * `start_time` - (Optional) `HH:MM` format time indicating when backup
    79    configuration starts.
    80  
    81  The optional `settings.ip_configuration` subblock supports:
    82  
    83  * `ipv4_enabled` - (Optional) True iff the instance should be assigned an IP
    84    address.
    85  
    86  * `require_ssl` - (Optional) True iff mysqld should default to `REQUIRE X509`
    87    for users connecting over IP.
    88  
    89  The optional `settings.ip_configuration.authorized_networks[]` sublist supports:
    90  
    91  * `expiration_time` - (Optional) The [RFC
    92    3339](https://tools.ietf.org/html/rfc3339) formatted date time string
    93    indicating when this whitelist expires.
    94  
    95  * `name` - (Optional) A name for this whitelist entry.
    96  
    97  * `value` - (Optional) A CIDR notation IPv4 or IPv6 address that is allowed to
    98    access this instance. Must be set even if other two attributes are not for
    99    the whitelist to become active.
   100  
   101  The optional `settings.location_preference` subblock supports:
   102  
   103  * `follow_gae_application` - (Optional) A GAE application whose zone to remain
   104    in. Must be in the same region as this instance.
   105  
   106  * `zone` - (Optional) The preferred compute engine
   107    [zone](https://cloud.google.com/compute/docs/zones?hl=en).
   108  
   109  The optional `replica_configuration` block must have
   110  `master_instance_name` set to work, cannot be updated, and supports:
   111  
   112  * `ca_certificate` - (Optional) PEM representation of the trusted CA's x509
   113    certificate.
   114  
   115  * `client_certificate` - (Optional) PEM representation of the slave's x509
   116    certificate.
   117  
   118  * `client_key` - (Optional) PEM representation of the slave's private key.
   119    The corresponding public key in encoded in the `client_certificate`.
   120  
   121  * `connect_retry_interval` - (Optional, Default: 60) The number of seconds
   122    between connect retries.
   123  
   124  * `dump_file_path` - (Optional) Path to a SQL file in GCS from which slave
   125    instances are created. Format is `gs://bucket/filename`.
   126  
   127  * `master_heartbeat_period` - (Optional) Time in ms between replication
   128    heartbeats.
   129  
   130  * `password` - (Optional) Password for the replication connection.
   131  
   132  * `sslCipher` - (Optional) Permissible ciphers for use in SSL encryption.
   133  
   134  * `username` - (Optional) Username for replication connection.
   135  
   136  * `verify_server_certificate` - (Optional) True iff the master's common name
   137    value is checked during the SSL handshake.
   138  
   139  ## Attributes Reference
   140  
   141  The following attributes are exported:
   142  
   143  * `self_link` - The URI of the created resource.
   144  
   145  The `settings` block exports:
   146  
   147  * `version` - Used to make sure changes to the `settings` block are atomic.