forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
automation_variable_datetime_resource.go
44 lines (35 loc) · 1.56 KB
/
automation_variable_datetime_resource.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package automation
import (
"time"
"github.com/kevinklinger/terraform-provider-azurerm/v2/internal/services/automation/parse"
"github.com/kevinklinger/terraform-provider-azurerm/v2/internal/tf/pluginsdk"
"github.com/kevinklinger/terraform-provider-azurerm/v2/internal/tf/validation"
)
func resourceAutomationVariableDateTime() *pluginsdk.Resource {
return &pluginsdk.Resource{
Create: resourceAutomationVariableDateTimeCreateUpdate,
Read: resourceAutomationVariableDateTimeRead,
Update: resourceAutomationVariableDateTimeCreateUpdate,
Delete: resourceAutomationVariableDateTimeDelete,
Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error {
_, err := parse.VariableID(id)
return err
}),
Timeouts: &pluginsdk.ResourceTimeout{
Create: pluginsdk.DefaultTimeout(30 * time.Minute),
Read: pluginsdk.DefaultTimeout(5 * time.Minute),
Update: pluginsdk.DefaultTimeout(30 * time.Minute),
Delete: pluginsdk.DefaultTimeout(30 * time.Minute),
},
Schema: resourceAutomationVariableCommonSchema(pluginsdk.TypeString, validation.IsRFC3339Time),
}
}
func resourceAutomationVariableDateTimeCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error {
return resourceAutomationVariableCreateUpdate(d, meta, "Datetime")
}
func resourceAutomationVariableDateTimeRead(d *pluginsdk.ResourceData, meta interface{}) error {
return resourceAutomationVariableRead(d, meta, "Datetime")
}
func resourceAutomationVariableDateTimeDelete(d *pluginsdk.ResourceData, meta interface{}) error {
return resourceAutomationVariableDelete(d, meta, "Datetime")
}