You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The module defines a network peering between a given VPC and the service
networks where Cloud SQL instances are created.
Added tests and modified the example.
MySQL [Private IP](https://cloud.google.com/sql/docs/mysql/private-ip)
4
+
configurations require a special peering between your VPC network and a
5
+
VPC managed by Google. The module supports creating such a peering.
6
+
7
+
It is sufficient to instantiate this module once for all MySQL instances
8
+
that are connected to the same VPC.
9
+
10
+
> NOTE: See the linked [documentation](https://cloud.google.com/sql/docs/mysql/private-ip)
11
+
> for all requirements for accessing a MySQL instance via its Private IP.
12
+
13
+
[^]: (autogen_docs_start)
14
+
15
+
## Inputs
16
+
17
+
| Name | Description | Type | Default | Required |
18
+
|------|-------------|:----:|:-----:|:-----:|
19
+
| address | First IP address of the IP range to allocate to CLoud SQL instances and other Private Service Access services. If not set, GCP will pick a valid one for you. | string |`""`| no |
20
+
| ip\_version | IP Version for the allocation. Can be IPV4 or IPV6. | string |`""`| no |
21
+
| labels | The key/value labels for the IP range allocated to the peered network. | map |`<map>`| no |
22
+
| prefix\_length | Prefix length of the IP range reserved for Cloud SQL instances and other Private Service Access services. Defaults to /16. | string |`"16"`| no |
23
+
| project\_id | The project ID of the VPC network to peer. This can be a shared VPC host projec. | string | n/a | yes |
24
+
| vpc\_network | Name of the VPC network to peer. | string | n/a | yes |
25
+
26
+
## Outputs
27
+
28
+
| Name | Description |
29
+
|------|-------------|
30
+
| address | First IP of the reserved range. |
31
+
| google\_compute\_global\_address\_name | URL of the reserved range. |
32
+
| peering\_completed | Use for enforce ordering between resource creation |
* Licensed under the Apache License, Version 2.0 (the "License");
5
+
* you may not use this file except in compliance with the License.
6
+
* You may obtain a copy of the License at
7
+
*
8
+
* http://www.apache.org/licenses/LICENSE-2.0
9
+
*
10
+
* Unless required by applicable law or agreed to in writing, software
11
+
* distributed under the License is distributed on an "AS IS" BASIS,
12
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+
* See the License for the specific language governing permissions and
14
+
* limitations under the License.
15
+
*/
16
+
17
+
variable"project_id" {
18
+
description="The project ID of the VPC network to peer. This can be a shared VPC host projec."
19
+
}
20
+
21
+
variable"vpc_network" {
22
+
description="Name of the VPC network to peer."
23
+
}
24
+
25
+
variable"address" {
26
+
description="First IP address of the IP range to allocate to CLoud SQL instances and other Private Service Access services. If not set, GCP will pick a valid one for you."
27
+
default=""
28
+
}
29
+
30
+
variable"prefix_length" {
31
+
description="Prefix length of the IP range reserved for Cloud SQL instances and other Private Service Access services. Defaults to /16."
32
+
default="16"
33
+
}
34
+
35
+
variable"ip_version" {
36
+
description="IP Version for the allocation. Can be IPV4 or IPV6."
37
+
default=""
38
+
}
39
+
40
+
variable"labels" {
41
+
description="The key/value labels for the IP range allocated to the peered network."
Copy file name to clipboardExpand all lines: modules/safer_mysql/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,7 +168,7 @@ mysql -S $HOME/mysql_sockets/myproject:region:instance -u user -p
168
168
| activation\_policy | The activation policy for the master instance. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`. | string |`"ALWAYS"`| no |
169
169
| additional\_databases | A list of databases to be created in your cluster | list |`<list>`| no |
170
170
| additional\_users | A list of users to be created in your cluster | list |`<list>`| no |
171
-
| assign\_public\_ip | Set tp true if the master instance should also have a public IP. | string |`"false"`| no |
171
+
| assign\_public\_ip | Set to true if the master instance should also have a public IP (less secure). | string |`"false"`| no |
172
172
| authorized\_gae\_applications | The list of authorized App Engine project names | list |`<list>`| no |
173
173
| backup\_configuration | The backup configuration block of the Cloud SQL resources This argument will be passed through the master instance directrly.<br><br>See [more details](https://www.terraform.io/docs/providers/google/r/sql_database_instance.html). | map |`<map>`| no |
174
174
| create\_timeout | The optional timout that is applied to limit long database creates. | string |`"15m"`| no |
@@ -199,8 +199,9 @@ mysql -S $HOME/mysql_sockets/myproject:region:instance -u user -p
199
199
| failover\_replica\_zone | The zone for the failover replica instance, it should be something like: `a`, `c`. | string |`""`| no |
200
200
| maintenance\_window\_day | The day of week (1-7) for the master instance maintenance. | string |`"1"`| no |
201
201
| maintenance\_window\_hour | The hour of day (0-23) maintenance window for the master instance maintenance. | string |`"23"`| no |
202
-
| maintenance\_window\_update\_track | The update track of maintenance window for the master instance maintenance. Can be either `canary` or `stable`. | string |`"canary"`| no |
202
+
| maintenance\_window\_update\_track | The update track of maintenance window for the master instance maintenance. Can be either `canary` or `stable`. | string |`"stable"`| no |
203
203
| name | The name of the Cloud SQL resources | string | n/a | yes |
204
+
| peering\_completed | Optional. This is used to ensure that resources are created in the proper order when using private IPs and service network peering. | string |`""`| no |
204
205
| pricing\_plan | The pricing plan for the master instance. | string |`"PER_USE"`| no |
205
206
| project\_id | The project ID to manage the Cloud SQL resources | string | n/a | yes |
206
207
| read\_replica\_activation\_policy | The activation policy for the read replica instances. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`. | string |`"ALWAYS"`| no |
@@ -219,14 +220,13 @@ mysql -S $HOME/mysql_sockets/myproject:region:instance -u user -p
219
220
| read\_replica\_tier | The tier for the read replica instances. | string |`""`| no |
220
221
| read\_replica\_user\_labels | The key/value labels for the read replica instances. | map |`<map>`| no |
221
222
| read\_replica\_zones | The zones for the read replica instancess, it should be something like: `a,b,c`. Given zones are used rotationally for creating read replicas. | string |`""`| no |
222
-
| region | The region of the Cloud SQL resources | string |`"us-central1"`|no|
223
+
| region | The region of the Cloud SQL resources | string |n/a|yes|
223
224
| tier | The tier for the master instance. | string |`"db-n1-standard-1"`| no |
224
225
| update\_timeout | The optional timout that is applied to limit long database updates. | string |`"15m"`| no |
225
226
| user\_labels | The key/value labels for the master instances. | map |`<map>`| no |
226
227
| user\_name | The name of the default user | string |`"default"`| no |
227
228
| user\_password | The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable. | string |`""`| no |
228
229
| vpc\_network | Existing VPC network to which instances are connected. The networks needs to be configured with https://cloud.google.com/vpc/docs/configure-private-services-access.| string | n/a | yes |
229
-
| vpc\_peering | google_service_networking_connection object identifying the peering between the producer network and the project subnet. This is not used, but needed to ensure that elements are created in the proper order | string | n/a | yes |
230
230
| zone | The zone for the master instance, it should be something like: `a`, `c`. | string | n/a | yes |
231
231
232
232
## Outputs
@@ -247,4 +247,4 @@ mysql -S $HOME/mysql_sockets/myproject:region:instance -u user -p
247
247
| replicas\_instance\_self\_links | The URIs of the replica instances |
248
248
| replicas\_instance\_service\_account\_email\_addresses | The service account email addresses assigned to the replica instances |
Copy file name to clipboardExpand all lines: modules/safer_mysql/variables.tf
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,9 @@ variable "vpc_network" {
37
37
description="Existing VPC network to which instances are connected. The networks needs to be configured with https://cloud.google.com/vpc/docs/configure-private-services-access."
38
38
}
39
39
40
-
variable"vpc_peering" {
41
-
description="google_service_networking_connection object identifying the peering between the producer network and the project subnet. This is not used, but needed to ensure that elements are created in the proper order"
40
+
variable"peering_completed" {
41
+
description="Optional. This is used to ensure that resources are created in the proper order when using private IPs and service network peering."
0 commit comments