github.com/koding/terraform@v0.6.4-0.20170608090606-5d7e0339779d/website/source/docs/providers/google/r/sql_user.html.markdown (about)

     1  ---
     2  layout: "google"
     3  page_title: "Google: google_sql_user"
     4  sidebar_current: "docs-google-sql-user"
     5  description: |-
     6    Creates a new SQL user in Google Cloud SQL.
     7  ---
     8  
     9  # google\_sql\_user
    10  
    11  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).
    12  
    13  ~> **Note:** All arguments including the username and password will be stored in the raw state as plain-text.
    14  [Read more about sensitive data in state](/docs/state/sensitive-data.html). Passwords will not be retrieved when running
    15  "terraform import".
    16  
    17  ## Example Usage
    18  
    19  Example creating a SQL User.
    20  
    21  ```hcl
    22  resource "google_sql_database_instance" "master" {
    23    name = "master-instance"
    24  
    25    settings {
    26      tier = "D0"
    27    }
    28  }
    29  
    30  resource "google_sql_user" "users" {
    31    name     = "me"
    32    instance = "${google_sql_database_instance.master.name}"
    33    host     = "me.com"
    34    password = "changeme"
    35  }
    36  ```
    37  
    38  ## Argument Reference
    39  
    40  The following arguments are supported:
    41  
    42  * `host` - (Required) The host the user can connect from. Can be an IP address.
    43      Changing this forces a new resource to be created.
    44  
    45  * `instance` - (Required) The name of the Cloud SQL instance. Changing this
    46      forces a new resource to be created.
    47  
    48  * `name` - (Required) The name of the user. Changing this forces a new resource
    49      to be created.
    50  
    51  * `password` - (Required) The users password. Can be updated.
    52  
    53  - - -
    54  
    55  * `project` - (Optional) The project in which the resource belongs. If it
    56      is not provided, the provider project is used.
    57  
    58  ## Attributes Reference
    59  
    60  Only the arguments listed above are exposed as attributes.
    61  
    62  ## Import Format
    63  
    64  Importing an SQL user is formatted as:
    65  
    66  ```bash
    67  terraform import google_sql_user.$RESOURCENAME $INSTANCENAME/$SQLUSERNAME
    68  ```
    69  
    70  For example, the sample at the top of this page could be imported with:
    71  
    72  ```bash
    73  terraform import google_sql_user.users master-instance/me
    74  ```