From e2baa63aeb02b77200adc7936ee22365f8521ca3 Mon Sep 17 00:00:00 2001 From: Lars Wander Date: Fri, 23 Oct 2015 10:10:41 -0400 Subject: [PATCH] provider/google: SQL instance & database tests & documentation --- r/compute_address.html.markdown | 2 +- r/compute_autoscaler.html.markdown | 2 +- r/compute_backend_service.html.markdown | 2 +- r/compute_disk.html.markdown | 2 +- r/compute_firewall.html.markdown | 2 +- r/compute_forwarding_rule.html.markdown | 2 +- r/compute_http_health_check.html.markdown | 2 +- r/compute_instance.html.markdown | 2 +- ...mpute_instance_group_manager.html.markdown | 2 +- r/compute_instance_template.html.markdown | 2 +- r/compute_network.html.markdown | 2 +- r/compute_project_metadata.html.markdown | 2 +- r/compute_route.html.markdown | 2 +- r/compute_target_pool.html.markdown | 2 +- r/compute_vpn_gateway.html.markdown | 2 +- r/compute_vpn_tunnel.html.markdown | 2 +- r/container_cluster.html.markdown | 2 +- r/dns_managed_zone.markdown | 2 +- r/sql_database.html.markdown | 45 ++++++ r/sql_database_instance.html.markdown | 147 ++++++++++++++++++ r/storage_bucket.html.markdown | 2 +- r/storage_bucket_acl.html.markdown | 2 +- r/storage_bucket_object.html.markdown | 2 +- r/storage_object_acl.html.markdown | 2 +- 24 files changed, 214 insertions(+), 22 deletions(-) create mode 100644 r/sql_database.html.markdown create mode 100644 r/sql_database_instance.html.markdown diff --git a/r/compute_address.html.markdown b/r/compute_address.html.markdown index 2ffd6226..b171df5e 100644 --- a/r/compute_address.html.markdown +++ b/r/compute_address.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_address" -sidebar_current: "docs-google-resource-address" +sidebar_current: "docs-google-compute-address" description: |- Creates a static IP address resource for Google Compute Engine. --- diff --git a/r/compute_autoscaler.html.markdown b/r/compute_autoscaler.html.markdown index 672988fb..b8125285 100644 --- a/r/compute_autoscaler.html.markdown +++ b/r/compute_autoscaler.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_autoscaler" -sidebar_current: "docs-google-resource-compute-autoscaler" +sidebar_current: "docs-google-compute-autoscaler" description: |- Manages an Autoscaler within GCE. --- diff --git a/r/compute_backend_service.html.markdown b/r/compute_backend_service.html.markdown index 5a862e23..df73c49b 100644 --- a/r/compute_backend_service.html.markdown +++ b/r/compute_backend_service.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_backend_service" -sidebar_current: "docs-google-resource-backend-service" +sidebar_current: "docs-google-compute-backend-service" description: |- Creates a Backend Service resource for Google Compute Engine. --- diff --git a/r/compute_disk.html.markdown b/r/compute_disk.html.markdown index f38da7e4..e6fe353f 100644 --- a/r/compute_disk.html.markdown +++ b/r/compute_disk.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_disk" -sidebar_current: "docs-google-resource-disk" +sidebar_current: "docs-google-compute-disk" description: |- Creates a new persistent disk within GCE, based on another disk. --- diff --git a/r/compute_firewall.html.markdown b/r/compute_firewall.html.markdown index f0ed797d..f6574150 100644 --- a/r/compute_firewall.html.markdown +++ b/r/compute_firewall.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_firewall" -sidebar_current: "docs-google-resource-firewall" +sidebar_current: "docs-google-compute-firewall" description: |- Manages a firewall resource within GCE. --- diff --git a/r/compute_forwarding_rule.html.markdown b/r/compute_forwarding_rule.html.markdown index 9e831318..582f36af 100644 --- a/r/compute_forwarding_rule.html.markdown +++ b/r/compute_forwarding_rule.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_forwarding_rule" -sidebar_current: "docs-google-resource-forwarding_rule" +sidebar_current: "docs-google-compute-forwarding-rule" description: |- Manages a Target Pool within GCE. --- diff --git a/r/compute_http_health_check.html.markdown b/r/compute_http_health_check.html.markdown index 4a4cd348..32f28c77 100644 --- a/r/compute_http_health_check.html.markdown +++ b/r/compute_http_health_check.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_http_health_check" -sidebar_current: "docs-google-resource-http_health_check" +sidebar_current: "docs-google-compute-http-health-check" description: |- Manages an HTTP Health Check within GCE. --- diff --git a/r/compute_instance.html.markdown b/r/compute_instance.html.markdown index 7426d700..c7bc4100 100644 --- a/r/compute_instance.html.markdown +++ b/r/compute_instance.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_instance" -sidebar_current: "docs-google-resource-instance" +sidebar_current: "docs-google-compute-instance" description: |- Manages a VM instance resource within GCE. --- diff --git a/r/compute_instance_group_manager.html.markdown b/r/compute_instance_group_manager.html.markdown index 58bda485..30527c80 100644 --- a/r/compute_instance_group_manager.html.markdown +++ b/r/compute_instance_group_manager.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_instance_group_manager" -sidebar_current: "docs-google-resource-compute-instance_group_manager" +sidebar_current: "docs-google-compute-instance-group-manager" description: |- Manages an Instance Group within GCE. --- diff --git a/r/compute_instance_template.html.markdown b/r/compute_instance_template.html.markdown index 927390bc..e8996b54 100644 --- a/r/compute_instance_template.html.markdown +++ b/r/compute_instance_template.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_instance_template" -sidebar_current: "docs-google-resource-instance_template" +sidebar_current: "docs-google-compute-instance-template" description: |- Manages a VM instance template resource within GCE. --- diff --git a/r/compute_network.html.markdown b/r/compute_network.html.markdown index a6d94e40..1306a092 100644 --- a/r/compute_network.html.markdown +++ b/r/compute_network.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_network" -sidebar_current: "docs-google-resource-network" +sidebar_current: "docs-google-compute-network" description: |- Manages a network within GCE. --- diff --git a/r/compute_project_metadata.html.markdown b/r/compute_project_metadata.html.markdown index aedb201a..286455db 100644 --- a/r/compute_project_metadata.html.markdown +++ b/r/compute_project_metadata.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_project_metadata" -sidebar_current: "docs-google-resource-project-metadata" +sidebar_current: "docs-google-compute-project-metadata" description: |- Manages common instance metadata --- diff --git a/r/compute_route.html.markdown b/r/compute_route.html.markdown index 94688637..14b1706a 100644 --- a/r/compute_route.html.markdown +++ b/r/compute_route.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_route" -sidebar_current: "docs-google-resource-route" +sidebar_current: "docs-google-compute-route" description: |- Manages a network route within GCE. --- diff --git a/r/compute_target_pool.html.markdown b/r/compute_target_pool.html.markdown index 82bc4a7d..6857bc0c 100644 --- a/r/compute_target_pool.html.markdown +++ b/r/compute_target_pool.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_target_pool" -sidebar_current: "docs-google-resource-target_pool" +sidebar_current: "docs-google-compute-target-pool" description: |- Manages a Target Pool within GCE. --- diff --git a/r/compute_vpn_gateway.html.markdown b/r/compute_vpn_gateway.html.markdown index 0073ecb7..881bbc9e 100644 --- a/r/compute_vpn_gateway.html.markdown +++ b/r/compute_vpn_gateway.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_vpn_gateway" -sidebar_current: "docs-google-resource-vpn-gateway" +sidebar_current: "docs-google-compute-vpn-gateway" description: |- Manages a VPN Gateway in the GCE network --- diff --git a/r/compute_vpn_tunnel.html.markdown b/r/compute_vpn_tunnel.html.markdown index 0df012bc..4d3ae0be 100644 --- a/r/compute_vpn_tunnel.html.markdown +++ b/r/compute_vpn_tunnel.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_compute_vpn_tunnel" -sidebar_current: "docs-google-resource-vpn-tunnel" +sidebar_current: "docs-google-compute-vpn-tunnel" description: |- Manages a VPN Tunnel to the GCE network --- diff --git a/r/container_cluster.html.markdown b/r/container_cluster.html.markdown index 76f0171f..5a66ec9a 100644 --- a/r/container_cluster.html.markdown +++ b/r/container_cluster.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_container_cluster" -sidebar_current: "docs-google-resource-container-cluster" +sidebar_current: "docs-google-container-cluster" description: |- Creates a GKE cluster. --- diff --git a/r/dns_managed_zone.markdown b/r/dns_managed_zone.markdown index f3e650a2..90e9c73f 100644 --- a/r/dns_managed_zone.markdown +++ b/r/dns_managed_zone.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_dns_managed_zone" -sidebar_current: "docs-google-resource-dns-managed-zone" +sidebar_current: "docs-google-dns-managed-zone" description: |- Manages a zone within Google Cloud DNS. --- diff --git a/r/sql_database.html.markdown b/r/sql_database.html.markdown new file mode 100644 index 00000000..eae67b36 --- /dev/null +++ b/r/sql_database.html.markdown @@ -0,0 +1,45 @@ +--- +layout: "google" +page_title: "Google: google_sql_database" +sidebar_current: "docs-google-sql-database" +description: |- + Creates a new SQL database in Google Cloud SQL. +--- + +# google\_sql\_database + +Creates a new Google SQL Database on a 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/databases). + +## Example Usage + +Example creating a SQL Database. + +``` +resource "google_sql_database_instance" "master" { + name = "master-instance" + + settings { + tier = "D0" + } +} + +resource "google_sql_database" "users" { + name = "image-store-bucket" + instance = "${google_sql_database_instance.master.name}" +} + +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The name of the database. + +* `instance` - (Required) The name of containing instance. + +## Attributes Reference + +The following attributes are exported: + +* `self_link` - The URI of the created resource. diff --git a/r/sql_database_instance.html.markdown b/r/sql_database_instance.html.markdown new file mode 100644 index 00000000..7889f144 --- /dev/null +++ b/r/sql_database_instance.html.markdown @@ -0,0 +1,147 @@ +--- +layout: "google" +page_title: "Google: google_sql_database_instance" +sidebar_current: "docs-google-sql-database-instance" +description: |- + Creates a new SQL database instance in Google Cloud SQL. +--- + +# google\_sql\_database\_instance + +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). + +## Example Usage + +Example creating a SQL Database. + +``` +resource "google_sql_database_instance" "master" { + name = "master-instance" + + settings { + tier = "D0" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The name of the instance. + +* `region` - (Required) The region the instance will sit in. Note, this does + not line up with the Google Compute Engine (GCE) regions - your options are + `us-central`, `asia-west1`, `europe-west1`, and `us-east1`. + +* `master_instance_name` - (Optional) The name of the instance that will act as + the master in the replication setup. Note, this requires the master to have + `binary_log_enabled` set, as well as existing backups. + +* `database_version` - (Optional, Default: `MYSQL_5_5`) The MySQL version to + use. Can be either `MYSQL_5_5` or `MYSQL_5_6`. + +* `pricing_plan` - (Optional) Pricing plan for this instance, can be one of + `PER_USE` or `PACKAGE`. + +* `replication_type` - (Optional) Replication type for this instance, can be one of + `ASYNCHRONOUS` or `SYNCHRONOUS`. + +The required `settings` block supports: + +* `tier` - (Required) The machine tier to use. See + [pricing](https://cloud.google.com/sql/pricing) for more details and + supported versions. + +* `activation_policy` - (Optional) This specifies when the instance should be + active. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`. + +* `authorized_gae_applications` - (Optional) A list of Google App Engine (GAE) project names that + are allowed to access this instance. + +* `crash_safe_replication` - (Optional) Specific to read instances, indicates + when crash-safe replication flags are enabled. + +The optional `settings.database_flags` sublist supports: + +* `name` - (Optional) Name of the flag. + +* `value` - (Optional) Value of the flag. + +The optional `settings.backup_configuration` subblock supports: + +* `binary_log_enabled` - (Optional) True iff binary logging is enabled. If + `logging` is false, this must be as well. + +* `enabled` - (Optional) True iff backup configuration is enabled. + +* `start_time` - (Optional) `HH:MM` format time indicating when backup + configuration starts. + +The optional `settings.ip_configuration` subblock supports: + +* `ipv4_enabled` - (Optional) True iff the instance should be assigned an IP + address. + +* `require_ssl` - (Optional) True iff mysqld should default to `REQUIRE X509` + for users connecting over IP. + +The optional `settings.ip_configuration.authorized_networks[]` sublist supports: + +* `expiration_time` - (Optional) The [RFC + 3339](https://tools.ietf.org/html/rfc3339) formatted date time string + indicating when this whitelist expires. + +* `name` - (Optional) A name for this whitelist entry. + +* `value` - (Optional) A CIDR notation IPv4 or IPv6 address that is allowed to + access this instance. Must be set even if other two attributes are not for + the whitelist to become active. + +The optional `settings.location_preference` subblock supports: + +* `follow_gae_application` - (Optional) A GAE application whose zone to remain + in. Must be in the same region as this instance. + +* `zone` - (Optional) The preferred compute engine + [zone](https://cloud.google.com/compute/docs/zones?hl=en). + +The optional `replica_configuration` block must have +`master_instance_name` set to work, cannot be updated, and supports: + +* `ca_certificate` - (Optional) PEM representation of the trusted CA's x509 + certificate. + +* `client_certificate` - (Optional) PEM representation of the slave's x509 + certificate. + +* `client_key` - (Optional) PEM representation of the slave's private key. + The corresponding public key in encoded in the `client_certificate`. + +* `connect_retry_interval` - (Optional, Default: 60) The number of seconds + between connect retries. + +* `dump_file_path` - (Optional) Path to a SQL file in GCS from which slave + instances are created. Format is `gs://bucket/filename`. + +* `master_heartbeat_period` - (Optional) Time in ms between replication + heartbeats. + +* `password` - (Optional) Password for the replication connection. + +* `sslCipher` - (Optional) Permissible ciphers for use in SSL encryption. + +* `username` - (Optional) Username for replication connection. + +* `verify_server_certificate` - (Optional) True iff the master's common name + value is checked during the SSL handshake. + +## Attributes Reference + +The following attributes are exported: + +* `self_link` - The URI of the created resource. + +The `settings` block exports: + +* `version` - Used to make sure changes to the `settings` block are atomic. diff --git a/r/storage_bucket.html.markdown b/r/storage_bucket.html.markdown index 2821e558..b5afc282 100644 --- a/r/storage_bucket.html.markdown +++ b/r/storage_bucket.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_storage_bucket" -sidebar_current: "docs-google-resource-storage" +sidebar_current: "docs-google-storage-bucket" description: |- Creates a new bucket in Google Cloud Storage. --- diff --git a/r/storage_bucket_acl.html.markdown b/r/storage_bucket_acl.html.markdown index b7734b06..14a169b9 100644 --- a/r/storage_bucket_acl.html.markdown +++ b/r/storage_bucket_acl.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_storage_bucket_acl" -sidebar_current: "docs-google-resource-storage-acl" +sidebar_current: "docs-google-storage-bucket-acl" description: |- Creates a new bucket ACL in Google Cloud Storage. --- diff --git a/r/storage_bucket_object.html.markdown b/r/storage_bucket_object.html.markdown index 61b32823..1c970530 100644 --- a/r/storage_bucket_object.html.markdown +++ b/r/storage_bucket_object.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_storage_bucket_object" -sidebar_current: "docs-google-resource-storage-object" +sidebar_current: "docs-google-storage-bucket-object" description: |- Creates a new object inside a specified bucket --- diff --git a/r/storage_object_acl.html.markdown b/r/storage_object_acl.html.markdown index 9f04d484..9f27f8e3 100644 --- a/r/storage_object_acl.html.markdown +++ b/r/storage_object_acl.html.markdown @@ -1,7 +1,7 @@ --- layout: "google" page_title: "Google: google_storage_object_acl" -sidebar_current: "docs-google-resource-storage-acl" +sidebar_current: "docs-google-storage-object-acl" description: |- Creates a new object ACL in Google Cloud Storage. ---