Skip to content

Commit

Permalink
Merge pull request #178 from volcengine/Feat/vedb
Browse files Browse the repository at this point in the history
Feat/vedb
  • Loading branch information
msq177 authored Dec 6, 2024
2 parents e6e528f + 9fad8eb commit 7ea4175
Show file tree
Hide file tree
Showing 60 changed files with 7,018 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/common_volcengine_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package common

const (
TerraformProviderName = "terraform-provider-volcengine"
TerraformProviderVersion = "0.0.154"
TerraformProviderVersion = "0.0.155"
)
1 change: 1 addition & 0 deletions docgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ var resourceKeys = map[string]string{
"kafka": "KAFKA",
"private_zone": "PRIVATE_ZONE",
"vepfs": "VEPFS",
"vedb_mysql": "VEDB_MYSQL",
}

type Products struct {
Expand Down
4 changes: 2 additions & 2 deletions example/dataTlsProjects/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
data "volcengine_tls_projects" "default" {
project_id = "e020c978-4f05-40e1-9167-0113d3ef****"
}
#project_id = "e020c978-4f05-40e1-9167-0113d3ef****"
}
57 changes: 57 additions & 0 deletions example/dataVedbMysqlAccounts/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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[2].id
vpc_id = volcengine_vpc.foo.id
}


resource "volcengine_vedb_mysql_instance" "foo" {
charge_type = "PostPaid"
storage_charge_type = "PostPaid"
db_engine_version = "MySQL_8_0"
db_minor_version = "3.0"
node_number = 2
node_spec = "vedb.mysql.x4.large"
subnet_id = volcengine_subnet.foo.id
instance_name = "tf-test"
project_name = "testA"
tags {
key = "tftest"
value = "tftest"
}
tags {
key = "tftest2"
value = "tftest2"
}
}

resource "volcengine_vedb_mysql_database" "foo" {
db_name = "tf-table"
instance_id = volcengine_vedb_mysql_instance.foo.id
}

resource "volcengine_vedb_mysql_account" "foo" {
account_name = "tftest"
account_password = "93f0cb0614Aab12"
account_type = "Normal"
instance_id = volcengine_vedb_mysql_instance.foo.id
account_privileges {
db_name = volcengine_vedb_mysql_database.foo.db_name
account_privilege = "Custom"
account_privilege_detail = "SELECT,INSERT,DELETE"
}
}

data "volcengine_vedb_mysql_accounts" "foo"{
account_name = volcengine_vedb_mysql_account.foo.account_name
instance_id = volcengine_vedb_mysql_instance.foo.id
}
51 changes: 51 additions & 0 deletions example/dataVedbMysqlAllowlists/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
resource "volcengine_vedb_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", "192.168.2.0/24"]
}

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[2].id
vpc_id = volcengine_vpc.foo.id
}


resource "volcengine_vedb_mysql_instance" "foo" {
charge_type = "PostPaid"
storage_charge_type = "PostPaid"
db_engine_version = "MySQL_8_0"
db_minor_version = "3.0"
node_number = 2
node_spec = "vedb.mysql.x4.large"
subnet_id = volcengine_subnet.foo.id
instance_name = "tf-test"
project_name = "testA"
tags {
key = "tftest"
value = "tftest"
}
tags {
key = "tftest2"
value = "tftest2"
}
}

resource "volcengine_vedb_mysql_allowlist_associate" "foo" {
allow_list_id = volcengine_vedb_mysql_allowlist.foo.id
instance_id = volcengine_vedb_mysql_instance.foo.id
}

data "volcengine_vedb_mysql_allowlists" "foo"{
instance_id = volcengine_vedb_mysql_instance.foo.id
}
48 changes: 48 additions & 0 deletions example/dataVedbMysqlBackups/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +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[2].id
vpc_id = volcengine_vpc.foo.id
}


resource "volcengine_vedb_mysql_instance" "foo" {
charge_type = "PostPaid"
storage_charge_type = "PostPaid"
db_engine_version = "MySQL_8_0"
db_minor_version = "3.0"
node_number = 2
node_spec = "vedb.mysql.x4.large"
subnet_id = volcengine_subnet.foo.id
instance_name = "tf-test"
project_name = "testA"
tags {
key = "tftest"
value = "tftest"
}
tags {
key = "tftest2"
value = "tftest2"
}
}

resource "volcengine_vedb_mysql_backup" "foo" {
instance_id = volcengine_vedb_mysql_instance.foo.id
backup_policy {
backup_time = "18:00Z-20:00Z"
full_backup_period = "Monday,Tuesday,Wednesday"
backup_retention_period = 8
}
}

data "volcengine_vedb_mysql_backups" "foo"{
instance_id = volcengine_vedb_mysql_instance.foo.id
}
45 changes: 45 additions & 0 deletions example/dataVedbMysqlDatabases/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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[2].id
vpc_id = volcengine_vpc.foo.id
}


resource "volcengine_vedb_mysql_instance" "foo" {
charge_type = "PostPaid"
storage_charge_type = "PostPaid"
db_engine_version = "MySQL_8_0"
db_minor_version = "3.0"
node_number = 2
node_spec = "vedb.mysql.x4.large"
subnet_id = volcengine_subnet.foo.id
instance_name = "tf-test"
project_name = "testA"
tags {
key = "tftest"
value = "tftest"
}
tags {
key = "tftest2"
value = "tftest2"
}
}

resource "volcengine_vedb_mysql_database" "foo" {
db_name = "tf-table"
instance_id = volcengine_vedb_mysql_instance.foo.id
}

data "volcengine_vedb_mysql_databases" "foo"{
db_name = volcengine_vedb_mysql_database.foo.db_name
instance_id = volcengine_vedb_mysql_instance.foo.id
}
57 changes: 57 additions & 0 deletions example/dataVedbMysqlEndpoints/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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[2].id
vpc_id = volcengine_vpc.foo.id
}


resource "volcengine_vedb_mysql_instance" "foo" {
charge_type = "PostPaid"
storage_charge_type = "PostPaid"
db_engine_version = "MySQL_8_0"
db_minor_version = "3.0"
node_number = 2
node_spec = "vedb.mysql.x4.large"
subnet_id = volcengine_subnet.foo.id
instance_name = "tf-test"
project_name = "testA"
tags {
key = "tftest"
value = "tftest"
}
tags {
key = "tftest2"
value = "tftest2"
}
}
data "volcengine_vedb_mysql_instances" "foo"{
instance_id = volcengine_vedb_mysql_instance.foo.id
}

resource "volcengine_vedb_mysql_endpoint" "foo" {
endpoint_type = "Custom"
instance_id = volcengine_vedb_mysql_instance.foo.id
node_ids = [data.volcengine_vedb_mysql_instances.foo.instances[0].nodes[0].node_id, data.volcengine_vedb_mysql_instances.foo.instances[0].nodes[1].node_id]
read_write_mode = "ReadWrite"
endpoint_name = "tf-test"
description = "tf test"
master_accept_read_requests = true
distributed_transaction = true
consist_level = "Session"
consist_timeout = 100000
consist_timeout_action = "ReadMaster"
}

data "volcengine_vedb_mysql_endpoints" "foo"{
endpoint_id = volcengine_vedb_mysql_endpoint.foo.endpoint_id
instance_id = volcengine_vedb_mysql_instance.foo.id
}
39 changes: 39 additions & 0 deletions example/dataVedbMysqlInstances/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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[2].id
vpc_id = volcengine_vpc.foo.id
}


resource "volcengine_vedb_mysql_instance" "foo" {
charge_type = "PostPaid"
storage_charge_type = "PostPaid"
db_engine_version = "MySQL_8_0"
db_minor_version = "3.0"
node_number = 2
node_spec = "vedb.mysql.x4.large"
subnet_id = volcengine_subnet.foo.id
instance_name = "tf-test"
project_name = "testA"
tags {
key = "tftest"
value = "tftest"
}
tags {
key = "tftest2"
value = "tftest2"
}
}

data "volcengine_vedb_mysql_instances" "foo"{
instance_id = volcengine_vedb_mysql_instance.foo.id
}
52 changes: 52 additions & 0 deletions example/vedbMysqlAccount/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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[2].id
vpc_id = volcengine_vpc.foo.id
}


resource "volcengine_vedb_mysql_instance" "foo" {
charge_type = "PostPaid"
storage_charge_type = "PostPaid"
db_engine_version = "MySQL_8_0"
db_minor_version = "3.0"
node_number = 2
node_spec = "vedb.mysql.x4.large"
subnet_id = volcengine_subnet.foo.id
instance_name = "tf-test"
project_name = "testA"
tags {
key = "tftest"
value = "tftest"
}
tags {
key = "tftest2"
value = "tftest2"
}
}

resource "volcengine_vedb_mysql_database" "foo" {
db_name = "tf-table"
instance_id = volcengine_vedb_mysql_instance.foo.id
}

resource "volcengine_vedb_mysql_account" "foo" {
account_name = "tftest"
account_password = "93f0cb0614Aab12"
account_type = "Normal"
instance_id = volcengine_vedb_mysql_instance.foo.id
account_privileges {
db_name = volcengine_vedb_mysql_database.foo.db_name
account_privilege = "Custom"
account_privilege_detail = "SELECT,INSERT,DELETE"
}
}
6 changes: 6 additions & 0 deletions example/vedbMysqlAllowlist/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "volcengine_vedb_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", "192.168.2.0/24"]
}
Loading

0 comments on commit 7ea4175

Please sign in to comment.