Skip to content

Commit 8d22beb

Browse files
author
Adrian Lopez
committed
dbinstance resource name changed to default instead of master
1 parent b768562 commit 8d22beb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
resource "google_sql_database_instance" "master" {
17+
resource "google_sql_database_instance" "default" {
1818
name = "${var.name}"
1919
project = "${var.project}"
2020
region = "${var.region}"
@@ -44,7 +44,7 @@ resource "google_sql_database" "default" {
4444
count = "${var.master_instance_name == "" ? 1 : 0}"
4545
name = "${var.db_name}"
4646
project = "${var.project}"
47-
instance = "${google_sql_database_instance.master.name}"
47+
instance = "${google_sql_database_instance.default.name}"
4848
charset = "${var.db_charset}"
4949
collation = "${var.db_collation}"
5050
}
@@ -57,7 +57,7 @@ resource "google_sql_user" "default" {
5757
count = "${var.master_instance_name == "" ? 1 : 0}"
5858
name = "${var.user_name}"
5959
project = "${var.project}"
60-
instance = "${google_sql_database_instance.master.name}"
60+
instance = "${google_sql_database_instance.default.name}"
6161
host = "${var.user_host}"
6262
password = "${var.user_password == "" ? random_id.user-password.hex : var.user_password}"
6363
}

outputs.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@
1616

1717
output instance_name {
1818
description = "The name of the database instance"
19-
value = "${google_sql_database_instance.master.name}"
19+
value = "${google_sql_database_instance.default.name}"
2020
}
2121

2222
output instance_address {
2323
description = "The IPv4 address of the master database instnace"
24-
value = "${google_sql_database_instance.master.ip_address.0.ip_address}"
24+
value = "${google_sql_database_instance.default.ip_address.0.ip_address}"
2525
}
2626

2727
output instance_address_time_to_retire {
2828
description = "The time the master instance IP address will be reitred. RFC 3339 format."
29-
value = "${google_sql_database_instance.master.ip_address.0.time_to_retire}"
29+
value = "${google_sql_database_instance.default.ip_address.0.time_to_retire}"
3030
}
3131

3232
output self_link {
3333
description = "Self link to the master instance"
34-
value = "${google_sql_database_instance.master.self_link}"
34+
value = "${google_sql_database_instance.default.self_link}"
3535
}
3636

3737
output generated_user_password {

0 commit comments

Comments
 (0)