Skip to content

Commit

Permalink
Merge pull request #180 from volcengine/Feat/rocketmq
Browse files Browse the repository at this point in the history
Feat/rocketmq
  • Loading branch information
msq177 authored Jan 7, 2025
2 parents 7ea4175 + 557ec32 commit e4c2457
Show file tree
Hide file tree
Showing 55 changed files with 5,615 additions and 32 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.155"
TerraformProviderVersion = "0.0.156"
)
1 change: 1 addition & 0 deletions docgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ var resourceKeys = map[string]string{
"private_zone": "PRIVATE_ZONE",
"vepfs": "VEPFS",
"vedb_mysql": "VEDB_MYSQL",
"rocketmq": "ROCKETMQ",
}

type Products struct {
Expand Down
5 changes: 3 additions & 2 deletions example/cloudMonitorRule/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ resource "volcengine_cloud_monitor_rule" "foo" {
effect_end_at = "22:55"
silence_time = 5
alert_methods = ["Email", "Webhook"]
web_hook = "http://alert.volc.com/callback"
# web_hook = "http://alert.volc.com/callback"
webhook_ids = ["187655704106731****", "187655712542447****"]
contact_group_ids = ["174284616403161****"]
multiple_conditions = true
condition_operator = "||"
regions = ["cn-beijing"]
regions = ["cn-beijing", "cn-shanghai"]
original_dimensions {
key = "ResourceID"
value = ["*"]
Expand Down
3 changes: 3 additions & 0 deletions example/dataRocketmqAccessKeys/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "volcengine_rocketmq_access_keys" "foo" {
instance_id = "rocketmq-cnoeea6b32118fc2"
}
3 changes: 3 additions & 0 deletions example/dataRocketmqAllowLists/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "volcengine_rocketmq_allow_lists" "foo" {

}
3 changes: 3 additions & 0 deletions example/dataRocketmqGroups/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "volcengine_rocketmq_groups" "foo" {
instance_id = "rocketmq-cnoeea6b32118fc2"
}
3 changes: 3 additions & 0 deletions example/dataRocketmqInstances/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "volcengine_rocketmq_instances" "foo" {
instance_id = "rocketmq-cnoeea6b32118fc2"
}
3 changes: 3 additions & 0 deletions example/dataRocketmqTopics/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "volcengine_rocketmq_topics" "foo" {
instance_id = "rocketmq-cnoeea6b32118fc2"
}
40 changes: 40 additions & 0 deletions example/rocketmqAccessKey/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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_rocketmq_instance" "foo" {
zone_ids = [data.volcengine_zones.foo.zones[0].id]
subnet_id = volcengine_subnet.foo.id
version = "4.8"
compute_spec = "rocketmq.n1.x2.micro"
storage_space = 300
auto_scale_queue = true
file_reserved_time = 10
instance_name = "acc-test-rocketmq"
instance_description = "acc-test"
project_name = "default"
charge_info {
charge_type = "PostPaid"
}
tags {
key = "k1"
value = "v1"
}
}

resource "volcengine_rocketmq_access_key" "foo" {
instance_id = volcengine_rocketmq_instance.foo.id
description = "acc-test-key"
all_authority = "SUB"
}
5 changes: 5 additions & 0 deletions example/rocketmqAllowList/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "volcengine_rocketmq_allow_list" "foo" {
allow_list_name = "acc-test-allow-list"
allow_list_desc = "acc-test"
allow_list = ["192.168.0.0/24", "192.168.2.0/24"]
}
45 changes: 45 additions & 0 deletions example/rocketmqAllowListAssociate/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[0].id
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_rocketmq_instance" "foo" {
zone_ids = [data.volcengine_zones.foo.zones[0].id]
subnet_id = volcengine_subnet.foo.id
version = "4.8"
compute_spec = "rocketmq.n1.x2.micro"
storage_space = 300
auto_scale_queue = true
file_reserved_time = 10
instance_name = "acc-test-rocketmq"
instance_description = "acc-test"
project_name = "default"
charge_info {
charge_type = "PostPaid"
}
tags {
key = "k1"
value = "v1"
}
}

resource "volcengine_rocketmq_allow_list" "foo" {
allow_list_name = "acc-test-allow-list"
allow_list_desc = "acc-test"
allow_list = ["192.168.0.0/24", "192.168.2.0/24"]
}

resource "volcengine_rocketmq_allow_list_associate" "foo" {
instance_id = volcengine_rocketmq_instance.foo.id
allow_list_id = volcengine_rocketmq_allow_list.foo.id
}
40 changes: 40 additions & 0 deletions example/rocketmqGroup/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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_rocketmq_instance" "foo" {
zone_ids = [data.volcengine_zones.foo.zones[0].id]
subnet_id = volcengine_subnet.foo.id
version = "4.8"
compute_spec = "rocketmq.n1.x2.micro"
storage_space = 300
auto_scale_queue = true
file_reserved_time = 10
instance_name = "acc-test-rocketmq"
instance_description = "acc-test"
project_name = "default"
charge_info {
charge_type = "PostPaid"
}
tags {
key = "k1"
value = "v1"
}
}

resource "volcengine_rocketmq_group" "foo" {
instance_id = volcengine_rocketmq_instance.foo.id
group_id = "acc-test-rocketmq-group"
description = "acc-test"
}
34 changes: 34 additions & 0 deletions example/rocketmqInstance/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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_rocketmq_instance" "foo" {
zone_ids = [data.volcengine_zones.foo.zones[0].id]
subnet_id = volcengine_subnet.foo.id
version = "4.8"
compute_spec = "rocketmq.n1.x2.micro"
storage_space = 300
auto_scale_queue = true
file_reserved_time = 10
instance_name = "acc-test-rocketmq"
instance_description = "acc-test"
project_name = "default"
charge_info {
charge_type = "PostPaid"
}
tags {
key = "k1"
value = "v1"
}
}
49 changes: 49 additions & 0 deletions example/rocketmqPublicAddress/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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_rocketmq_instance" "foo" {
zone_ids = [data.volcengine_zones.foo.zones[0].id]
subnet_id = volcengine_subnet.foo.id
version = "4.8"
compute_spec = "rocketmq.n1.x2.micro"
storage_space = 300
auto_scale_queue = true
file_reserved_time = 10
instance_name = "acc-test-rocketmq"
instance_description = "acc-test"
project_name = "default"
charge_info {
charge_type = "PostPaid"
}
tags {
key = "k1"
value = "v1"
}
}

resource "volcengine_eip_address" "foo" {
billing_type = "PostPaidByBandwidth"
bandwidth = 1
isp = "BGP"
name = "acc-test-eip"
description = "acc-test"
project_name = "default"
}

resource "volcengine_rocketmq_public_address" "foo" {
instance_id = volcengine_rocketmq_instance.foo.id
eip_id = volcengine_eip_address.foo.id
ssl_mode = "permissive"
}
52 changes: 52 additions & 0 deletions example/rocketmqTopic/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[0].id
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_rocketmq_instance" "foo" {
zone_ids = [data.volcengine_zones.foo.zones[0].id]
subnet_id = volcengine_subnet.foo.id
version = "4.8"
compute_spec = "rocketmq.n1.x2.micro"
storage_space = 300
auto_scale_queue = true
file_reserved_time = 10
instance_name = "acc-test-rocketmq"
instance_description = "acc-test"
project_name = "default"
charge_info {
charge_type = "PostPaid"
}
tags {
key = "k1"
value = "v1"
}
}

resource "volcengine_rocketmq_access_key" "foo" {
instance_id = volcengine_rocketmq_instance.foo.id
description = "acc-test-key"
all_authority = "SUB"
}

resource "volcengine_rocketmq_topic" "foo" {
instance_id = volcengine_rocketmq_instance.foo.id
topic_name = "acc-test-rocketmq-topic"
description = "acc-test"
queue_number = 2
message_type = 1
access_policies {
access_key = volcengine_rocketmq_access_key.foo.access_key
authority = "PUB"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ func DataSourceVolcengineCloudMonitorRules() *schema.Resource {
Computed: true,
Description: "The web hook of the cloud monitor rule.",
},
"webhook_ids": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "The webhook id list of the cloud monitor rule.",
},
"alert_state": {
Type: schema.TypeString,
Computed: true,
Expand Down
Loading

0 comments on commit e4c2457

Please sign in to comment.