From 7cc4f71620bc952c3057e1ff0f20202cb7d973dd Mon Sep 17 00:00:00 2001 From: xuyaming Date: Tue, 29 Aug 2023 12:04:24 +0800 Subject: [PATCH] feat: support auto check ebm with hack --- common/common_volcengine_version.go | 2 +- .../resource_volcengine_ecs_instance.go | 17 +++++++- website/docs/d/tos_objects.html.markdown | 2 +- website/docs/r/ecs_instance.html.markdown | 4 +- website/docs/r/tos_object.html.markdown | 2 +- website/volcengine.erb | 39 +++++++++++++++++++ 6 files changed, 59 insertions(+), 7 deletions(-) diff --git a/common/common_volcengine_version.go b/common/common_volcengine_version.go index 9c4eee99..8359a36d 100644 --- a/common/common_volcengine_version.go +++ b/common/common_volcengine_version.go @@ -2,5 +2,5 @@ package common const ( TerraformProviderName = "terraform-provider-volcengine" - TerraformProviderVersion = "0.0.103" + TerraformProviderVersion = "0.0.104" ) diff --git a/volcengine/ecs/ecs_instance/resource_volcengine_ecs_instance.go b/volcengine/ecs/ecs_instance/resource_volcengine_ecs_instance.go index 7e35ff41..8398c069 100644 --- a/volcengine/ecs/ecs_instance/resource_volcengine_ecs_instance.go +++ b/volcengine/ecs/ecs_instance/resource_volcengine_ecs_instance.go @@ -271,14 +271,27 @@ func ResourceVolcengineEcsInstance() *schema.Resource { Computed: true, MaxItems: 1, MinItems: 1, - Description: "The option of cpu.", + Description: "The option of cpu,only support for ebm.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "threads_per_core": { Type: schema.TypeInt, Required: true, ForceNew: true, - Description: "The per core of threads.", + Description: "The per core of threads,only support for ebm.", + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + //暂时增加这个逻辑 在不包含ebm的情况下 忽略掉这个变化 目前这个方式比较hack 后续接口能力完善后改变一下 + if it, ok := d.Get("instance_type").(string); ok { + its := strings.Split(it, ".") + if len(its) == 3 && !strings.Contains(strings.ToLower(its[1]), "ebm") { + return true + } else { + return false + } + } else { + return true + } + }, }, }, }, diff --git a/website/docs/d/tos_objects.html.markdown b/website/docs/d/tos_objects.html.markdown index b01f4744..89061ef7 100644 --- a/website/docs/d/tos_objects.html.markdown +++ b/website/docs/d/tos_objects.html.markdown @@ -24,7 +24,7 @@ The following arguments are supported: ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `objects` - The collection of TOS Object query. - * `content` - The content the TOS Object when content type is json or text. + * `content` - The content the TOS Object when content type is json or text and xml. * `name` - The name the TOS Object. * `size` - The name the TOS Object size. * `storage_class` - The name the TOS Object storage class. diff --git a/website/docs/r/ecs_instance.html.markdown b/website/docs/r/ecs_instance.html.markdown index b3ca0323..5d519cfd 100644 --- a/website/docs/r/ecs_instance.html.markdown +++ b/website/docs/r/ecs_instance.html.markdown @@ -82,7 +82,7 @@ The following arguments are supported: * `system_volume_type` - (Required, ForceNew) The type of system volume, the value is `PTSSD` or `ESSD_PL0` or `ESSD_PL1` or `ESSD_PL2` or `ESSD_FlexPL`. * `auto_renew_period` - (Optional) The auto renew period of ECS instance.Only effective when instance_charge_type is PrePaid. Default is 1.When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields. * `auto_renew` - (Optional) The auto renew flag of ECS instance.Only effective when instance_charge_type is PrePaid. Default is true.When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields. -* `cpu_options` - (Optional) The option of cpu. +* `cpu_options` - (Optional) The option of cpu,only support for ebm. * `data_volumes` - (Optional) The data volumes collection of ECS instance. * `deployment_set_id` - (Optional) The ID of Ecs Deployment Set. * `description` - (Optional) The description of ECS instance. @@ -110,7 +110,7 @@ The following arguments are supported: The `cpu_options` object supports the following: -* `threads_per_core` - (Required, ForceNew) The per core of threads. +* `threads_per_core` - (Required, ForceNew) The per core of threads,only support for ebm. The `data_volumes` object supports the following: diff --git a/website/docs/r/tos_object.html.markdown b/website/docs/r/tos_object.html.markdown index 63b548a7..26b373df 100644 --- a/website/docs/r/tos_object.html.markdown +++ b/website/docs/r/tos_object.html.markdown @@ -52,7 +52,7 @@ The `account_acl` object supports the following: ## Attributes Reference In addition to all arguments above, the following attributes are exported: * `id` - ID of the resource. -* `content` - The content the TOS Object when content type is json or text. +* `content` - The content the TOS Object when content type is json or text and xml. * `enable_version` - The flag of enable tos version. * `version_ids` - The version ids of the object if exist. diff --git a/website/volcengine.erb b/website/volcengine.erb index 921c0139..cc8663ae 100644 --- a/website/volcengine.erb +++ b/website/volcengine.erb @@ -214,6 +214,45 @@ +
  • + CLOUDFS + +
  • CR