Skip to content

Commit

Permalink
resource/alicloud_ess_scaling: Adds SecurityOptions.ConfidentialCompu…
Browse files Browse the repository at this point in the history
…tingMode support
  • Loading branch information
yuguorui committed Dec 24, 2024
1 parent 5c80281 commit d025f7f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions alicloud/resource_alicloud_ess_scaling_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")
}
Expand Down Expand Up @@ -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"])
}
Expand Down

0 comments on commit d025f7f

Please sign in to comment.