-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from volcengine/feat/rds
Feat/rds
- Loading branch information
Showing
36 changed files
with
2,153 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,58 @@ | ||
data "volcengine_rds_mysql_accounts" "default"{ | ||
instance_id="mysql-47d6bc58762b" | ||
account_name="" | ||
data "volcengine_zones" "foo"{ | ||
} | ||
|
||
resource "volcengine_vpc" "foo" { | ||
vpc_name = "acc-test-vpc" | ||
cidr_block = "172.16.0.0/16" | ||
} | ||
|
||
resource "volcengine_subnet" "foo" { | ||
subnet_name = "acc-test-subnet" | ||
cidr_block = "172.16.0.0/24" | ||
zone_id = data.volcengine_zones.foo.zones[0].id | ||
vpc_id = volcengine_vpc.foo.id | ||
} | ||
|
||
resource "volcengine_rds_mysql_instance" "foo" { | ||
instance_name = "acc-test-rds-mysql" | ||
db_engine_version = "MySQL_5_7" | ||
node_spec = "rds.mysql.1c2g" | ||
primary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
secondary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
storage_space = 80 | ||
subnet_id = volcengine_subnet.foo.id | ||
lower_case_table_names = "1" | ||
charge_info { | ||
charge_type = "PostPaid" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_increment" | ||
parameter_value = "2" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_offset" | ||
parameter_value = "4" | ||
} | ||
} | ||
|
||
resource "volcengine_rds_mysql_database" "foo" { | ||
db_name = "acc-test-db" | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
} | ||
|
||
resource "volcengine_rds_mysql_account" "foo" { | ||
account_name = "acc-test-account" | ||
account_password = "93f0cb0614Aab12" | ||
account_type = "Normal" | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
account_privileges { | ||
db_name = volcengine_rds_mysql_database.foo.db_name | ||
account_privilege = "Custom" | ||
account_privilege_detail = "SELECT,INSERT" | ||
} | ||
} | ||
|
||
data "volcengine_rds_mysql_accounts" "foo"{ | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
account_name = volcengine_rds_mysql_account.foo.account_name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,51 @@ | ||
data "volcengine_rds_mysql_allowlists" "default" { | ||
region_id = "cn-guilin-boe" | ||
data "volcengine_zones" "foo"{ | ||
} | ||
|
||
resource "volcengine_vpc" "foo" { | ||
vpc_name = "acc-test-vpc" | ||
cidr_block = "172.16.0.0/16" | ||
} | ||
|
||
resource "volcengine_subnet" "foo" { | ||
subnet_name = "acc-test-subnet" | ||
cidr_block = "172.16.0.0/24" | ||
zone_id = data.volcengine_zones.foo.zones[0].id | ||
vpc_id = volcengine_vpc.foo.id | ||
} | ||
|
||
resource "volcengine_rds_mysql_allowlist" "foo" { | ||
allow_list_name = "acc-test-allowlist-${count.index}" | ||
allow_list_desc = "acc-test" | ||
allow_list_type = "IPv4" | ||
allow_list = ["192.168.0.0/24", "192.168.1.0/24"] | ||
count = 3 | ||
} | ||
|
||
resource "volcengine_rds_mysql_instance" "foo" { | ||
instance_name = "acc-test-rds-mysql" | ||
db_engine_version = "MySQL_5_7" | ||
node_spec = "rds.mysql.1c2g" | ||
primary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
secondary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
storage_space = 80 | ||
subnet_id = volcengine_subnet.foo.id | ||
lower_case_table_names = "1" | ||
charge_info { | ||
charge_type = "PostPaid" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_increment" | ||
parameter_value = "2" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_offset" | ||
parameter_value = "4" | ||
} | ||
|
||
allow_list_ids = volcengine_rds_mysql_allowlist.foo[*].id | ||
} | ||
|
||
data "volcengine_rds_mysql_allowlists" "foo"{ | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
region_id = "cn-beijing" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,47 @@ | ||
data "volcengine_rds_mysql_databases" "default"{ | ||
instance_id="" | ||
db_name="" | ||
data "volcengine_zones" "foo"{ | ||
} | ||
|
||
resource "volcengine_vpc" "foo" { | ||
vpc_name = "acc-test-project1" | ||
cidr_block = "172.16.0.0/16" | ||
} | ||
|
||
resource "volcengine_subnet" "foo" { | ||
subnet_name = "acc-subnet-test-2" | ||
cidr_block = "172.16.0.0/24" | ||
zone_id = data.volcengine_zones.foo.zones[0].id | ||
vpc_id = volcengine_vpc.foo.id | ||
} | ||
|
||
resource "volcengine_rds_mysql_instance" "foo" { | ||
db_engine_version = "MySQL_5_7" | ||
node_spec = "rds.mysql.1c2g" | ||
primary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
secondary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
storage_space = 80 | ||
subnet_id = volcengine_subnet.foo.id | ||
instance_name = "acc-test" | ||
lower_case_table_names = "1" | ||
|
||
charge_info { | ||
charge_type = "PostPaid" | ||
} | ||
|
||
parameters { | ||
parameter_name = "auto_increment_increment" | ||
parameter_value = "2" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_offset" | ||
parameter_value = "4" | ||
} | ||
} | ||
|
||
resource "volcengine_rds_mysql_database" "foo" { | ||
db_name = "acc-test" | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
} | ||
data "volcengine_rds_mysql_databases" "foo"{ | ||
db_name = "acc-test" | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,42 @@ | ||
data "volcengine_rds_mysql_instances" "default" { | ||
instance_id = "mysql-72da4258c2c7" | ||
data "volcengine_zones" "foo"{ | ||
} | ||
|
||
resource "volcengine_vpc" "foo" { | ||
vpc_name = "acc-test-project1" | ||
cidr_block = "172.16.0.0/16" | ||
} | ||
|
||
resource "volcengine_subnet" "foo" { | ||
subnet_name = "acc-subnet-test-2" | ||
cidr_block = "172.16.0.0/24" | ||
zone_id = data.volcengine_zones.foo.zones[0].id | ||
vpc_id = volcengine_vpc.foo.id | ||
} | ||
|
||
resource "volcengine_rds_mysql_instance" "foo" { | ||
db_engine_version = "MySQL_5_7" | ||
node_spec = "rds.mysql.1c2g" | ||
primary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
secondary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
storage_space = 80 | ||
subnet_id = volcengine_subnet.foo.id | ||
instance_name = "acc-test" | ||
lower_case_table_names = "1" | ||
|
||
charge_info { | ||
charge_type = "PostPaid" | ||
} | ||
|
||
parameters { | ||
parameter_name = "auto_increment_increment" | ||
parameter_value = "2" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_offset" | ||
parameter_value = "4" | ||
} | ||
} | ||
|
||
data "volcengine_rds_mysql_instances" "foo"{ | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,53 @@ | ||
resource "volcengine_rds_mysql_account" "default"{ | ||
instance_id="mysql-e9293705eed6" | ||
account_name="test" | ||
account_password="xdjsuiahHUH@" | ||
account_type="Normal" | ||
# account_privileges{ | ||
# db_name="tf-test-dbdddddd" | ||
# account_privilege="ReadOnly" | ||
# account_privilege_detail="SELECT,UPDATE,INSERT" | ||
# } | ||
# account_privileges{ | ||
# db_name="test-xx" | ||
# account_privilege="ReadOnly" | ||
# account_privilege_detail="SELECT,UPDATE,INSERT" | ||
# } | ||
data "volcengine_zones" "foo"{ | ||
} | ||
|
||
resource "volcengine_vpc" "foo" { | ||
vpc_name = "acc-test-vpc" | ||
cidr_block = "172.16.0.0/16" | ||
} | ||
|
||
resource "volcengine_subnet" "foo" { | ||
subnet_name = "acc-test-subnet" | ||
cidr_block = "172.16.0.0/24" | ||
zone_id = data.volcengine_zones.foo.zones[0].id | ||
vpc_id = volcengine_vpc.foo.id | ||
} | ||
|
||
resource "volcengine_rds_mysql_instance" "foo" { | ||
instance_name = "acc-test-rds-mysql" | ||
db_engine_version = "MySQL_5_7" | ||
node_spec = "rds.mysql.1c2g" | ||
primary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
secondary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
storage_space = 80 | ||
subnet_id = volcengine_subnet.foo.id | ||
lower_case_table_names = "1" | ||
charge_info { | ||
charge_type = "PostPaid" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_increment" | ||
parameter_value = "2" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_offset" | ||
parameter_value = "4" | ||
} | ||
} | ||
|
||
resource "volcengine_rds_mysql_database" "foo" { | ||
db_name = "acc-test-db" | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
} | ||
|
||
resource "volcengine_rds_mysql_account" "foo" { | ||
account_name = "acc-test-account" | ||
account_password = "93f0cb0614Aab12" | ||
account_type = "Normal" | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
account_privileges { | ||
db_name = volcengine_rds_mysql_database.foo.db_name | ||
account_privilege = "Custom" | ||
account_privilege_detail = "SELECT,INSERT" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
resource "volcengine_rds_mysql_allowlist" "foo" { | ||
allow_list_name = "tf-test-opt" | ||
allow_list_desc = "terraform test zzm" | ||
allow_list = [ | ||
"127.0.0.1" | ||
] | ||
allow_list_name = "acc-test-allowlist" | ||
allow_list_desc = "acc-test" | ||
allow_list_type = "IPv4" | ||
allow_list = ["192.168.0.0/24", "192.168.1.0/24"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,48 @@ | ||
data "volcengine_zones" "foo"{ | ||
} | ||
|
||
resource "volcengine_vpc" "foo" { | ||
vpc_name = "acc-test-vpc" | ||
cidr_block = "172.16.0.0/16" | ||
} | ||
|
||
resource "volcengine_subnet" "foo" { | ||
subnet_name = "acc-test-subnet" | ||
cidr_block = "172.16.0.0/24" | ||
zone_id = data.volcengine_zones.foo.zones[0].id | ||
vpc_id = volcengine_vpc.foo.id | ||
} | ||
|
||
resource "volcengine_rds_mysql_instance" "foo" { | ||
instance_name = "acc-test-rds-mysql" | ||
db_engine_version = "MySQL_5_7" | ||
node_spec = "rds.mysql.1c2g" | ||
primary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
secondary_zone_id = data.volcengine_zones.foo.zones[0].id | ||
storage_space = 80 | ||
subnet_id = volcengine_subnet.foo.id | ||
lower_case_table_names = "1" | ||
charge_info { | ||
charge_type = "PostPaid" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_increment" | ||
parameter_value = "2" | ||
} | ||
parameters { | ||
parameter_name = "auto_increment_offset" | ||
parameter_value = "4" | ||
} | ||
} | ||
|
||
resource "volcengine_rds_mysql_allowlist" "foo" { | ||
allow_list_name = "acc-test-allowlist" | ||
allow_list_desc = "acc-test" | ||
allow_list_type = "IPv4" | ||
allow_list = ["192.168.0.0/24", "192.168.1.0/24"] | ||
} | ||
|
||
resource "volcengine_rds_mysql_allowlist_associate" "foo" { | ||
instance_id = "mysql-1b2c7b2d7583" | ||
allow_list_id = "acl-15451212dcfa473baeda24be4baa02fe" | ||
allow_list_id = volcengine_rds_mysql_allowlist.foo.id | ||
instance_id = volcengine_rds_mysql_instance.foo.id | ||
} |
Oops, something went wrong.