Skip to content

Commit

Permalink
azurerm_automation_software_update_configuration - fix `expiry_time…
Browse files Browse the repository at this point in the history
…` is optional/computed (#19774)

Fixes #19738
  • Loading branch information
wuxu92 authored Jan 3, 2023
1 parent 80fec02 commit 5b8647e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ func (s *Schedule) ToSDKModel() *automation.SUCScheduleProperties {
}

parseTime := func(s string) *date.Time {
if s == "" {
return nil
}
t, _ := time.Parse(time.RFC3339, s)
return &date.Time{Time: t}
}
Expand Down Expand Up @@ -728,6 +731,7 @@ func (m SoftwareUpdateConfigurationResource) Arguments() map[string]*pluginsdk.S
"expiry_time": {
Type: pluginsdk.TypeString,
Optional: true,
Computed: true,
DiffSuppressFunc: suppress.RFC3339MinuteTime,
ValidateFunc: validation.IsRFC3339Time,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ resource "azurerm_automation_software_update_configuration" "test" {
schedule {
description = "foo-schedule"
start_time = "%[3]s"
expiry_time = "%[4]s"
is_enabled = true
interval = 1
frequency = "Hour"
Expand Down

0 comments on commit 5b8647e

Please sign in to comment.