Skip to content

Commit

Permalink
fix(rds): fix sub module no instance id specified and account name sp…
Browse files Browse the repository at this point in the history
…ecified error.
  • Loading branch information
Lexsss authored and xiaozhu36 committed Dec 3, 2019
1 parent abdda26 commit f74fb3a
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 41 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## 1.2.0 (December 3, 2019)

IMPROVEMENTS:

- imporve(rds): update the module to the format of the new version. ([GH-6](https://github.com/terraform-alicloud-modules/terraform-alicloud-rds/pull/6))

BUG FIXES:

- fix(rds): fix sub module no instance id specified and account name specified error. ([GH-7](https://github.com/terraform-alicloud-modules/terraform-alicloud-rds/pull/7))
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module "rds" {
#variables for db account
name = "dbuser"
account_name = "dbuser"
password = "testUser123"
type = "Normal"
Expand Down
8 changes: 4 additions & 4 deletions examples/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Note that this example may create resources which cost money. Run `terraform des
| this_db_instance_connection_string | intance public net connection string created |
| this_db_instance_port | instance connection port created |
| this_db_instance_security_ips | instance security ips configured |
| this_db_instance_databese_id | database ID created in this instance |
| this_db_instance_databese_name | database name created in this instance |
| this_db_instance_databese_account | database account associated in this instance |
| this_db_instance_databese_accountprivilege | database account privilege associated in this instance |
| this_db_instance_database_id | database ID created in this instance |
| this_db_instance_database_name | database name created in this instance |
| this_db_instance_database_account | database account associated in this instance |
| this_db_instance_database_accountprivilege | database account privilege associated in this instance |


<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
2 changes: 1 addition & 1 deletion examples/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ module "db_database_account" {
#variables for account_privilege
##############################################################
privilege = "ReadWrite"
db_names = module.db_database.this_db_instance_databese_name
db_names = module.db_database.this_db_instance_database_name
}

9 changes: 5 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ module "db_database_account" {
###############################################################
#variables for db account
##############################################################
name = var.name
password = var.password
type = var.type
name = var.account_name
password = var.password
type = var.type
instance_id = module.db_instance.this_db_instance_id

##############################################################
#variables for account_privilege
##############################################################
privilege = var.privilege
db_names = module.db_database.this_db_instance_databese_name
db_names = module.db_database.this_db_instance_database_name
}

4 changes: 2 additions & 2 deletions modules/db_database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

| Name | Description |
|------|-------------|
| this_db_instance_databese_id | database ID created in this instance |
| this_db_instance_databese_name | database name created in this instance |
| this_db_instance_database_id | database ID created in this instance |
| this_db_instance_database_name | database name created in this instance |
12 changes: 6 additions & 6 deletions modules/db_database/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
locals {
this_db_instance_databese_id = alicloud_db_database.this_db_database.*.id
this_db_instance_databese_name = alicloud_db_database.this_db_database.*.name
this_db_instance_database_id = alicloud_db_database.this_db_database.*.id
this_db_instance_database_name = alicloud_db_database.this_db_database.*.name
}

output "this_db_instance_databese_id" {
value = local.this_db_instance_databese_id
output "this_db_instance_database_id" {
value = local.this_db_instance_database_id
}

output "this_db_instance_databese_name" {
value = local.this_db_instance_databese_name
output "this_db_instance_database_name" {
value = local.this_db_instance_database_name
}

4 changes: 2 additions & 2 deletions modules/db_database_account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

| Name | Description |
|------|-------------|
| this_db_instance_databese_account | database account associated in this instance |
| this_db_instance_databese_accountprivilege | database account privilege associated in this instance |
| this_db_instance_database_account | database account associated in this instance |
| this_db_instance_database_accountprivilege | database account privilege associated in this instance |
12 changes: 6 additions & 6 deletions modules/db_database_account/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
locals {
this_db_instance_databese_account = alicloud_db_account_privilege.this_db_database_privilege.*.account_name
this_db_instance_databese_accountprivilege = alicloud_db_account_privilege.this_db_database_privilege.*.privilege
this_db_instance_database_account = alicloud_db_account_privilege.this_db_database_privilege.*.account_name
this_db_instance_database_accountprivilege = alicloud_db_account_privilege.this_db_database_privilege.*.privilege
}

output "this_db_instance_databese_account" {
value = local.this_db_instance_databese_account
output "this_db_instance_database_account" {
value = local.this_db_instance_database_account
}

output "this_db_instance_databese_accountprivilege" {
value = local.this_db_instance_databese_accountprivilege
output "this_db_instance_database_accountprivilege" {
value = local.this_db_instance_database_accountprivilege
}

16 changes: 8 additions & 8 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ output "this_db_instance_security_ips" {
value = module.db_instance.this_db_instance_security_ips
}

output "this_db_databese_id" {
value = module.db_database.this_db_instance_databese_id
output "this_db_database_id" {
value = module.db_database.this_db_instance_database_id
}

output "this_db_databese_name" {
value = module.db_database.this_db_instance_databese_name
output "this_db_database_name" {
value = module.db_database.this_db_instance_database_name
}

output "this_db_databese_account" {
value = module.db_database_account.this_db_instance_databese_account
output "this_db_database_account" {
value = module.db_database_account.this_db_instance_database_account
}

output "this_db_databese_accountprivilege" {
value = module.db_database_account.this_db_instance_databese_accountprivilege
output "this_db_database_accountprivilege" {
value = module.db_database_account.this_db_instance_database_accountprivilege
}

10 changes: 3 additions & 7 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ variable "character_set" {
#variables for alicloud_db_account
##############################################################

variable "name" {
description = "Operation account requiring a uniqueness check. It may consist of lower case letters, numbers, and underlines, and must start with a letter and have no more than 16 characters."
variable "account_name" {
description = "A specified account name."
default = ""
}

variable "password" {
Expand All @@ -138,11 +139,6 @@ variable "type" {
#variables for alicloud_db_account_privilege
##############################################################

variable "account_name" {
description = "A specified account name."
default = ""
}

variable "privilege" {
description = "The privilege of one account access database."
default = "ReadOnly"
Expand Down

0 comments on commit f74fb3a

Please sign in to comment.