From 18ada1c68775e571044c867d52bf1d1abc65f700 Mon Sep 17 00:00:00 2001 From: Mike Fowler Date: Thu, 22 Jun 2017 17:13:05 +0100 Subject: [PATCH] Add ability to import `google_sql_database` (#12) * Add ability to import `google_sql_database` * Update from code review * Ensure split id length and report error otherwise --- docs/r/sql_database.html.markdown | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/r/sql_database.html.markdown b/docs/r/sql_database.html.markdown index 51b1af09d42..3cc83f7d3e9 100644 --- a/docs/r/sql_database.html.markdown +++ b/docs/r/sql_database.html.markdown @@ -24,7 +24,7 @@ resource "google_sql_database_instance" "master" { } resource "google_sql_database" "users" { - name = "users" + name = "users-db" instance = "${google_sql_database_instance.master.name}" } ``` @@ -48,3 +48,11 @@ In addition to the arguments listed above, the following computed attributes are exported: * `self_link` - The URI of the created resource. + +## Import + +SQL databases can be imported using the `instance` and `name`, e.g. + +``` +$ terraform import google_sql_database.database master-instance:users-db +```