From 5c80281bd02fea2f0abb0173932eadc03c770fd0 Mon Sep 17 00:00:00 2001 From: "GuoRui.Yu" Date: Tue, 24 Dec 2024 18:32:35 +0800 Subject: [PATCH 1/2] resource/alicloud_instance: Adds SecurityOptions.ConfidentialComputingMode support --- alicloud/resource_alicloud_instance.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/alicloud/resource_alicloud_instance.go b/alicloud/resource_alicloud_instance.go index 2829026eff3a..4e33aee4ca8a 100644 --- a/alicloud/resource_alicloud_instance.go +++ b/alicloud/resource_alicloud_instance.go @@ -489,6 +489,20 @@ func resourceAliCloudInstance() *schema.Resource { string(DeactiveSecurityEnhancementStrategy), }, false), }, + "security_options": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "confidential_computing_mode": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + }, + }, + }, "tags": tagsSchemaWithIgnore(), "volume_tags": tagsSchemaComputed(), "auto_release_time": { @@ -884,6 +898,16 @@ func resourceAliCloudInstanceCreate(d *schema.ResourceData, meta interface{}) er request["SecurityEnhancementStrategy"] = v } + if v, ok := d.GetOk("security_options"); ok { + securityOptions := v.(*schema.Set).List() + for _, securityOption := range securityOptions { + securityOptionMap := securityOption.(map[string]interface{}) + if v, ok := securityOptionMap["confidential_computing_mode"]; ok { + request["SecurityOptions.ConfidentialComputingMode"] = v + } + } + } + if v, ok := d.GetOk("auto_release_time"); ok && v.(string) != "" { request["AutoReleaseTime"] = v } From d025f7f2ef631374166aecc2add9b74a06b56c16 Mon Sep 17 00:00:00 2001 From: "GuoRui.Yu" Date: Tue, 24 Dec 2024 18:33:11 +0800 Subject: [PATCH 2/2] resource/alicloud_ess_scaling: Adds SecurityOptions.ConfidentialComputingMode support --- ...urce_alicloud_ess_scaling_configuration.go | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/alicloud/resource_alicloud_ess_scaling_configuration.go b/alicloud/resource_alicloud_ess_scaling_configuration.go index 72843c70c8d6..ad91ac29ad84 100644 --- a/alicloud/resource_alicloud_ess_scaling_configuration.go +++ b/alicloud/resource_alicloud_ess_scaling_configuration.go @@ -214,6 +214,20 @@ func resourceAlicloudEssScalingConfiguration() *schema.Resource { ForceNew: true, ValidateFunc: StringInSlice([]string{"Active", "Deactive"}, false), }, + "security_options": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "confidential_computing_mode": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + }, + }, + }, "system_disk_size": { Type: schema.TypeInt, Optional: true, @@ -581,6 +595,16 @@ func resourceAliyunEssScalingConfigurationCreate(d *schema.ResourceData, meta in request["SecurityEnhancementStrategy"] = v } + if v, ok := d.GetOk("security_options"); ok { + securityOptions := v.(*schema.Set).List() + for _, securityOption := range securityOptions { + securityOptionMap := securityOption.(map[string]interface{}) + if v, ok := securityOptionMap["confidential_computing_mode"]; ok { + request["SecurityOptions.ConfidentialComputingMode"] = v + } + } + } + if v := d.Get("internet_max_bandwidth_in").(int); v != 0 { request["InternetMaxBandwidthIn"] = d.Get("internet_max_bandwidth_in") } @@ -1320,6 +1344,7 @@ func resourceAliyunEssScalingConfigurationRead(d *schema.ResourceData, meta inte } d.Set("system_disk_category", response["SystemDiskCategory"]) d.Set("security_enhancement_strategy", response["SecurityEnhancementStrategy"]) + d.Set("security_options", response["SecurityOptions"]) if response["InternetMaxBandwidthIn"] != nil { d.Set("internet_max_bandwidth_in", response["InternetMaxBandwidthIn"]) }