-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple users with the same name for different host for 1st gen. #1066
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,19 +19,39 @@ a restricted host and strong password. | |
|
||
## Example Usage | ||
|
||
Example creating a SQL Database. | ||
### SQL First Generation | ||
|
||
```hcl | ||
resource "google_sql_database_instance" "master" { | ||
name = "master-instance" | ||
database_version = "POSTGRES_9_6" | ||
database_version = "MYSQL_5_6" | ||
# First-generation instance regions are not the conventional | ||
# Google Compute Engine region. See argument reference below. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: regions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
region = "us-central" | ||
|
||
settings { | ||
tier = "D0" | ||
} | ||
} | ||
``` | ||
|
||
|
||
### SQL Second generation | ||
|
||
```hcl | ||
resource "google_sql_database_instance" "master" { | ||
name = "master-instance" | ||
database_version = "POSTGRES_9_6" | ||
region = "us-central1" | ||
|
||
settings { | ||
# Second-generation instance tier are based on the machine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: tiers There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
# type. See argument reference below. | ||
tier = "db-f1-micro" | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,9 +39,6 @@ resource "google_sql_user" "users" { | |
|
||
The following arguments are supported: | ||
|
||
* `host` - (Required) The host the user can connect from. Can be an IP address. | ||
Changing this forces a new resource to be created. | ||
|
||
* `instance` - (Required) The name of the Cloud SQL instance. Changing this | ||
forces a new resource to be created. | ||
|
||
|
@@ -52,6 +49,10 @@ The following arguments are supported: | |
|
||
- - - | ||
|
||
* `host` - (Optional) The host the user can connect from. This is only supported | ||
for first generation SQL instance. Don't set this field for second generation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: instances There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
SQL instance. Can be an IP address. Changing this forces a new resource to be created. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: instances There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
* `project` - (Optional) The project in which the resource belongs. If it | ||
is not provided, the provider project is used. | ||
|
||
|
@@ -61,7 +62,13 @@ Only the arguments listed above are exposed as attributes. | |
|
||
## Import | ||
|
||
SQL users can be imported using the `instance` and `name`, e.g. | ||
SQL users for 1st generation databases can be imported using the `instance`, `host` and `name`, e.g. | ||
|
||
``` | ||
$ terraform import google_sql_user.users master-instance/my-domain.com/me | ||
``` | ||
|
||
SQL users for 2nd generation databases can be imported using the `instance` and `name`, e.g. | ||
|
||
``` | ||
$ terraform import google_sql_user.users master-instance/me | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry to be That Person but can we use a gender-neutral name here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Changed for
admin
.