provider/google: Add import support to google_sql_user (#14457)

* Support importing google_sql_user

* Updated documentation to reflect that passwords are not retrieved.

* Added additional documentation detailing use.

* Removed unneeded d.setId() line from GoogleSqlUser Read method.

* Changed an errors.New() call to fmt.Errorf().

* Migrate schemas of existing GoogleSqlUser resources.

* Remove explicitly setting 'id' property

* Added google_sql_user to importability page.

* Changed separator to '/' from '.' and updated tests + debug messages.
This commit is contained in:
Riley Karson 2017-05-22 13:43:11 -07:00 committed by Dana Hoffman
parent cc0b0144d4
commit 9f1c31a843

View File

@ -11,7 +11,8 @@ description: |-
Creates a new Google SQL User on a Google SQL User 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/users).
~> **Note:** All arguments including the username and password will be stored in the raw state as plain-text.
[Read more about sensitive data in state](/docs/state/sensitive-data.html).
[Read more about sensitive data in state](/docs/state/sensitive-data.html). Passwords will not be retrieved when running
"terraform import".
## Example Usage
@ -57,3 +58,17 @@ The following arguments are supported:
## Attributes Reference
Only the arguments listed above are exposed as attributes.
## Import Format
Importing an SQL user is formatted as:
```bash
terraform import google_sql_user.$RESOURCENAME $INSTANCENAME/$SQLUSERNAME
```
For example, the sample at the top of this page could be imported with:
```bash
terraform import google_sql_user.users master-instance/me
```