Skip to content

fix(rocketmq): [118085722] support more specifications of param sku_code for create instance #2688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/2688.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_trocket_rocketmq_instance: support more specifications of param `sku_code` for create instance
```
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ require (
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.860
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.860
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.932
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.945
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.762
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.692
Expand Down Expand Up @@ -92,7 +92,7 @@ require (
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tem v1.0.578
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo v1.0.912
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.916
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.756
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.945
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.857
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tsf v1.0.674
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.860
Expand Down
5 changes: 4 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,6 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.888 h1:FqVc
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.888/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.910 h1:u+rAnHhLixQaNYy8vtnuClj4kYWs77VAHEbi9jl8k/4=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.910/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.910/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.912 h1:BDqRmR+2vLLHqKWYdgfUl0CDr9+augDBOEOEScLyQ80=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.912/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.916 h1:30u2fFUGxaPB0VFpVtomiziXATxm/MjG53HCobM8KGI=
Expand All @@ -933,6 +932,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.920 h1:Kmm4
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.920/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.932 h1:MB1+Ll6JxWTpZw/v0dMRvMEJhlcDKxK/JMQ8O5owRVc=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.932/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.945 h1:+8B+2Bit7qPgmjdZPaA5NGjkGnYTzP5DOi/sICubde8=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.945/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860 h1:F3esKBIT3HW9+7Gt8cVgf8X06VdGIczpgLBUECzSEzU=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860/go.mod h1:NZo1WplQcC314kMlCRUoy8NQju2BnolIJj7NAWgsuhY=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 h1:nEZqsoqt1pEoaP9JjkHQy3/H00suCfzlHW1qOm2nYD8=
Expand Down Expand Up @@ -1041,6 +1042,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.916 h1:/ERZ1hN
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.916/go.mod h1:fhRshMGZ9Y+yDte3knOAlXhUQApfhhq5reebRFHi6VA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.756 h1:89M6uA8Y/FC1b88TFxvRManGW+i62Isqg1lW8HjHDvU=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.756/go.mod h1:AJAItBOTaarpDpUF7pNp0tuz2Y6H2oFuMcyKouPs1IE=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.945 h1:YZyuYwhXARBTyZD4b2TwD8OEf1Gf16JKb27WyI6HjqA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/trocket v1.0.945/go.mod h1:9dJBGOlcveY6tY9HCYMtHOvhe+ttlYcehk7/M5tbr5E=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.857 h1:TkJnvSeRSXsRCwOwcwXSvruSK9s/kw8LC3FLeccw+A0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.857/go.mod h1:CSGh7HSEzUoY09G67XTABi/aqNy3dSLCSuenb1i5x6k=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tsf v1.0.674 h1:VsMV1/vsgVzespG7jUzraZS/AbAUllVQjmtVAlA9W/M=
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/acctest/tke_basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ locals {
}
`

//InstanceType
// InstanceType
const TkeDatasourceInstanceTypeTestCase = DefaultInstanceVariable + `
data "tencentcloud_instance_types" "ins_type" {
filter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
Description: "API authentication type. Possible values are SECRET (key pair authentication), NONE (authentication-free), and OAUTH.",
},
"api_business_type": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,

Check failure on line 98 in tencentcloud/services/apigateway/data_source_tc_api_gateway_api_app_api.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
Computed: true,
Description: "Type of OAUTH API. Possible values are NORMAL (Business API), OAUTH (Authorization API).",
},
"auth_relation_api_id": {
Expand Down
3 changes: 2 additions & 1 deletion tencentcloud/services/cam/data_source_tc_user_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package cam
import (
"context"
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"log"
"math/rand"
"strconv"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"

cam "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"sale_status": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,

Check failure on line 74 in tencentcloud/services/cfs/data_source_tc_cfs_available_zone.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
Computed: true,
Description: " Sale status. Valid values: sale_out (sold out), saling (purchasable), no_saling (non-purchasable).",
},
"protocol": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
},
},
"optional_fields": {
Type: schema.TypeList,
Optional: true,
Type: schema.TypeList,

Check failure on line 81 in tencentcloud/services/cos/data_source_tc_cos_bucket_inventorys.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
Optional: true,
Description: "Analysis items to include in the inventory result .",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down
6 changes: 3 additions & 3 deletions tencentcloud/services/cos/resource_tc_cos_bucket_inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
},
},
"optional_fields": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Type: schema.TypeList,

Check failure on line 86 in tencentcloud/services/cos/resource_tc_cos_bucket_inventory.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
MaxItems: 1,
Optional: true,
Description: "Analysis items to include in the inventory result .",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@
Description: "Statistical period in seconds. The valid values can be queried via DescribeAlarmMetricsNote: this field may return null, indicating that no valid value is obtained.",
},
"operator": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,

Check failure on line 429 in tencentcloud/services/monitor/data_source_tc_monitor_alarm_policy.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
Computed: true,
Description: "Statistical period in seconds. The valid values can be queried via DescribeAlarmMetrics.Note: this field may return null, indicating that no valid value is obtained.Operator String No Operatorintelligent = intelligent detection without thresholdeq = equal toge = greater than or equal togt = greater thanle = less than or equal tolt = less thanne = not equal today_increase = day-on-day increaseday_decrease = day-on-day decreaseday_wave = day-on-day fluctuationweek_increase = week-on-week increaseweek_decrease = week-on-week decreaseweek_wave = week-on-week fluctuationcycle_increase = cyclical increasecycle_decrease = cyclical decreasecycle_wave = cyclical fluctuationre = regex matchThe valid values can be queried via DescribeAlarmMetrics.Note: this field may return null, indicating that no valid value is obtained.",
},
"value": {
Expand Down
6 changes: 3 additions & 3 deletions tencentcloud/services/mps/data_source_tc_mps_schedules.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@
Description: "The region of the AWS S3 bucket.",
},
"dir": {
Type: schema.TypeString,
Computed: true,
Type: schema.TypeString,

Check failure on line 121 in tencentcloud/services/mps/data_source_tc_mps_schedules.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
Computed: true,
Description: "The bucket directory bound. It must be an absolute path that starts and ends with `/`, such as `/movie/201907/`. If you do not specify this, the root directory will be bound. .",
},
"formats": {
Type: schema.TypeSet,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Computed: true,
Computed: true,
Description: "The file formats that will trigger the scheme, such as [mp4, flv, mov]. If you do not specify this, the upload of files in any format will trigger the scheme. .",
},
"s3_secret_id": {
Expand Down
6 changes: 3 additions & 3 deletions tencentcloud/services/mps/resource_tc_mps_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@
Description: "The region of the AWS S3 bucket.",
},
"dir": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,

Check failure on line 95 in tencentcloud/services/mps/resource_tc_mps_schedule.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

工具检查不通过

Optional: true,
Description: "The bucket directory bound. It must be an absolute path that starts and ends with `/`, such as `/movie/201907/`. If you do not specify this, the root directory will be bound. .",
},
"formats": {
Type: schema.TypeSet,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Optional: true,
Optional: true,
Description: "The file formats that will trigger the scheme, such as [mp4, flv, mov]. If you do not specify this, the upload of files in any format will trigger the scheme. .",
},
"s3_secret_id": {
Expand Down
4 changes: 2 additions & 2 deletions tencentcloud/services/rum/resource_tc_rum_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
},

"desc": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,

Check failure on line 71 in tencentcloud/services/rum/resource_tc_rum_project.go

View workflow job for this annotation

GitHub Actions / golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
Optional: true,
Description: " Description of the created project (optional and up to 1,000 characters).",
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func ResourceTencentCloudTrocketRocketmqInstance() *schema.Resource {
"sku_code": {
Required: true,
Type: schema.TypeString,
Description: "SKU code. Available specifications are as follows: experiment_500, basic_1k, basic_2k, basic_4k, basic_6k.",
Description: "SKU code. Available specifications are as follows: experiment_500, basic_1k, basic_2k, basic_3k, basic_4k, basic_5k, basic_6k, basic_7k, basic_8k, basic_9k, basic_10k, pro_4k, pro_6k, pro_8k, pro_1w, pro_15k, pro_2w, pro_25k, pro_3w, pro_35k, pro_4w, pro_45k, pro_5w, pro_55k, pro_60k, pro_65k, pro_70k, pro_75k, pro_80k, pro_85k, pro_90k, pro_95k, pro_100k, platinum_1w, platinum_2w, platinum_3w, platinum_4w, platinum_5w, platinum_6w, platinum_7w, platinum_8w, platinum_9w, platinum_10w, platinum_12w, platinum_14w, platinum_16w, platinum_18w, platinum_20w, platinum_25w, platinum_30w, platinum_35w, platinum_40w, platinum_45w, platinum_50w, platinum_60w, platinum_70w, platinum_80w, platinum_90w, platinum_100w.",
},

"remark": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,74 @@
Provides a resource to create a rocketmq 5.x instance

~> **NOTE:** It only support create postpaid rocketmq 5.x instance.
~> **NOTE:** It only supports create postpaid rocketmq 5.x instance.

Example Usage

Basic Instance
Create Basic Instance

```hcl
resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance" {
instance_type = "EXPERIMENT"
name = "rocketmq-instance"
sku_code = "experiment_500"
remark = "remark"
vpc_id = "vpc-xxxxxx"
subnet_id = "subnet-xxxxxx"
# create vpc
resource "tencentcloud_vpc" "vpc" {
name = "vpc"
cidr_block = "10.0.0.0/16"
}

# create vpc subnet
resource "tencentcloud_subnet" "subnet" {
name = "subnet"
vpc_id = tencentcloud_vpc.vpc.id
availability_zone = "ap-guangzhou-6"
cidr_block = "10.0.20.0/28"
is_multicast = false
}

# create rocketmq instance
resource "tencentcloud_trocket_rocketmq_instance" "example" {
name = "tf-example"
instance_type = "PRO"
sku_code = "pro_4k"
remark = "remark"
vpc_id = tencentcloud_vpc.vpc.id
subnet_id = tencentcloud_subnet.subnet.id
tags = {
tag_key = "rocketmq"
tag_key = "rocketmq"
tag_value = "5.x"
}
}
```

Enable Public Instance
Create Enable Public Network Instance

```hcl
resource "tencentcloud_trocket_rocketmq_instance" "rocketmq_instance_public" {
instance_type = "EXPERIMENT"
name = "rocketmq-enable-public-instance"
sku_code = "experiment_500"
remark = "remark"
vpc_id = "vpc-xxxxxx"
subnet_id = "subnet-xxxxxx"
# create vpc
resource "tencentcloud_vpc" "vpc" {
name = "vpc"
cidr_block = "10.0.0.0/16"
}

# create vpc subnet
resource "tencentcloud_subnet" "subnet" {
name = "subnet"
vpc_id = tencentcloud_vpc.vpc.id
availability_zone = "ap-guangzhou-6"
cidr_block = "10.0.20.0/28"
is_multicast = false
}

# create rocketmq instance
resource "tencentcloud_trocket_rocketmq_instance" "example" {
name = "tf-example"
instance_type = "PRO"
sku_code = "pro_4k"
remark = "remark"
vpc_id = tencentcloud_vpc.vpc.id
subnet_id = tencentcloud_subnet.subnet.id
enable_public = true
bandwidth = 10
tags = {
tag_key = "rocketmq"
tag_key = "rocketmq"
tag_value = "5.x"
}
enable_public = true
bandwidth = 1
}
```

Expand All @@ -43,5 +77,5 @@ Import
trocket rocketmq_instance can be imported using the id, e.g.

```
terraform import tencentcloud_trocket_rocketmq_instance.rocketmq_instance rocketmq_instance_id
terraform import tencentcloud_trocket_rocketmq_instance.rocketmq_instance rmq-n5qado7m
```
Loading
Loading