Skip to content

Commit

Permalink
resource/alicloud_ess_scheduled_task: update launch_expiration_time r…
Browse files Browse the repository at this point in the history
…ange.
  • Loading branch information
fuliu-zln committed Dec 26, 2024
1 parent aa9768e commit e2eac3d
Show file tree
Hide file tree
Showing 4 changed files with 309 additions and 478 deletions.
34 changes: 20 additions & 14 deletions alicloud/resource_alicloud_ess_scheduled_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func resourceAlicloudEssScheduledTask() *schema.Resource {
Type: schema.TypeInt,
Default: 600,
Optional: true,
ValidateFunc: validation.IntBetween(0, 21600),
ValidateFunc: IntBetween(0, 1800),
},
"min_value": {
Type: schema.TypeInt,
Expand Down Expand Up @@ -119,19 +119,25 @@ func resourceAliyunEssScheduledTaskRead(d *schema.ResourceData, meta interface{}
return WrapError(err)
}

d.Set("scheduled_action", object.ScheduledAction)
d.Set("launch_time", object.LaunchTime)
d.Set("scheduled_task_name", object.ScheduledTaskName)
d.Set("description", object.Description)
d.Set("launch_expiration_time", object.LaunchExpirationTime)
d.Set("recurrence_type", object.RecurrenceType)
d.Set("recurrence_value", object.RecurrenceValue)
d.Set("recurrence_end_time", object.RecurrenceEndTime)
d.Set("task_enabled", object.TaskEnabled)
d.Set("min_value", object.MinValue)
d.Set("max_value", object.MaxValue)
d.Set("desired_capacity", object.DesiredCapacity)
d.Set("scaling_group_id", object.ScalingGroupId)
d.Set("scheduled_action", object["ScheduledAction"])
d.Set("launch_time", object["LaunchTime"])
d.Set("scheduled_task_name", object["ScheduledTaskName"])
d.Set("description", object["Description"])
d.Set("launch_expiration_time", object["LaunchExpirationTime"])
d.Set("recurrence_type", object["RecurrenceType"])
d.Set("recurrence_value", object["RecurrenceValue"])
d.Set("recurrence_end_time", object["RecurrenceEndTime"])
d.Set("task_enabled", object["TaskEnabled"])
if object["MinValue"] != nil {
d.Set("min_value", object["MinValue"])
}
if object["MaxValue"] != nil {
d.Set("max_value", object["MaxValue"])
}
if object["DesiredCapacity"] != nil {
d.Set("desired_capacity", object["DesiredCapacity"])
}
d.Set("scaling_group_id", object["ScalingGroupId"])

return nil
}
Expand Down
Loading

0 comments on commit e2eac3d

Please sign in to comment.