diff --git a/builtin/providers/pagerduty/data_source_pagerduty_vendor.go b/builtin/providers/pagerduty/data_source_pagerduty_vendor.go index d3fca6db4..0469482bd 100644 --- a/builtin/providers/pagerduty/data_source_pagerduty_vendor.go +++ b/builtin/providers/pagerduty/data_source_pagerduty_vendor.go @@ -14,15 +14,15 @@ func dataSourcePagerDutyVendor() *schema.Resource { Read: dataSourcePagerDutyVendorRead, Schema: map[string]*schema.Schema{ - "name_regex": &schema.Schema{ + "name_regex": { Type: schema.TypeString, Required: true, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Computed: true, }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Computed: true, }, diff --git a/builtin/providers/pagerduty/provider.go b/builtin/providers/pagerduty/provider.go index a2231f0ed..93a09ebb0 100644 --- a/builtin/providers/pagerduty/provider.go +++ b/builtin/providers/pagerduty/provider.go @@ -11,7 +11,7 @@ import ( func Provider() terraform.ResourceProvider { return &schema.Provider{ Schema: map[string]*schema.Schema{ - "token": &schema.Schema{ + "token": { Type: schema.TypeString, Required: true, DefaultFunc: schema.EnvDefaultFunc("PAGERDUTY_TOKEN", nil), diff --git a/builtin/providers/pagerduty/resource_pagerduty_escalation_policy.go b/builtin/providers/pagerduty/resource_pagerduty_escalation_policy.go index 35d74e8d0..d6fb1a69c 100644 --- a/builtin/providers/pagerduty/resource_pagerduty_escalation_policy.go +++ b/builtin/providers/pagerduty/resource_pagerduty_escalation_policy.go @@ -17,50 +17,50 @@ func resourcePagerDutyEscalationPolicy() *schema.Resource { State: resourcePagerDutyEscalationPolicyImport, }, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Default: "Managed by Terraform", }, - "num_loops": &schema.Schema{ + "num_loops": { Type: schema.TypeInt, Optional: true, }, - "teams": &schema.Schema{ + "teams": { Type: schema.TypeList, Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, }, }, - "rule": &schema.Schema{ + "rule": { Type: schema.TypeList, Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, }, - "escalation_delay_in_minutes": &schema.Schema{ + "escalation_delay_in_minutes": { Type: schema.TypeInt, Required: true, }, - "target": &schema.Schema{ + "target": { Type: schema.TypeList, Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Optional: true, Default: "user_reference", }, - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Required: true, }, diff --git a/builtin/providers/pagerduty/resource_pagerduty_schedule.go b/builtin/providers/pagerduty/resource_pagerduty_schedule.go index e8ef10916..d2236df63 100644 --- a/builtin/providers/pagerduty/resource_pagerduty_schedule.go +++ b/builtin/providers/pagerduty/resource_pagerduty_schedule.go @@ -17,35 +17,35 @@ func resourcePagerDutySchedule() *schema.Resource { State: resourcePagerDutyScheduleImport, }, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, }, - "time_zone": &schema.Schema{ + "time_zone": { Type: schema.TypeString, Required: true, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Default: "Managed by Terraform", }, - "layer": &schema.Schema{ + "layer": { Type: schema.TypeList, Required: true, ForceNew: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ + "id": { Type: schema.TypeString, Computed: true, }, - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, Computed: true, }, - "start": &schema.Schema{ + "start": { Type: schema.TypeString, Optional: true, Computed: true, @@ -56,11 +56,11 @@ func resourcePagerDutySchedule() *schema.Resource { return true }, }, - "end": &schema.Schema{ + "end": { Type: schema.TypeString, Optional: true, }, - "rotation_virtual_start": &schema.Schema{ + "rotation_virtual_start": { Type: schema.TypeString, Optional: true, Computed: true, @@ -71,31 +71,31 @@ func resourcePagerDutySchedule() *schema.Resource { return true }, }, - "rotation_turn_length_seconds": &schema.Schema{ + "rotation_turn_length_seconds": { Type: schema.TypeInt, Required: true, }, - "users": &schema.Schema{ + "users": { Type: schema.TypeList, Required: true, Elem: &schema.Schema{ Type: schema.TypeString, }, }, - "restriction": &schema.Schema{ + "restriction": { Optional: true, Type: schema.TypeList, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Required: true, }, - "start_time_of_day": &schema.Schema{ + "start_time_of_day": { Type: schema.TypeString, Required: true, }, - "duration_seconds": &schema.Schema{ + "duration_seconds": { Type: schema.TypeInt, Required: true, }, diff --git a/builtin/providers/pagerduty/resource_pagerduty_service.go b/builtin/providers/pagerduty/resource_pagerduty_service.go index bb4979474..26e43ce6b 100644 --- a/builtin/providers/pagerduty/resource_pagerduty_service.go +++ b/builtin/providers/pagerduty/resource_pagerduty_service.go @@ -17,36 +17,36 @@ func resourcePagerDutyService() *schema.Resource { State: resourcePagerDutyServiceImport, }, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Default: "Managed by Terraform", }, - "auto_resolve_timeout": &schema.Schema{ + "auto_resolve_timeout": { Type: schema.TypeInt, Optional: true, }, - "last_incident_timestamp": &schema.Schema{ + "last_incident_timestamp": { Type: schema.TypeString, Computed: true, }, - "created_at": &schema.Schema{ + "created_at": { Type: schema.TypeString, Computed: true, }, - "status": &schema.Schema{ + "status": { Type: schema.TypeString, Computed: true, }, - "acknowledgement_timeout": &schema.Schema{ + "acknowledgement_timeout": { Type: schema.TypeInt, Optional: true, }, - "escalation_policy": &schema.Schema{ + "escalation_policy": { Type: schema.TypeString, Required: true, }, diff --git a/builtin/providers/pagerduty/resource_pagerduty_service_integration.go b/builtin/providers/pagerduty/resource_pagerduty_service_integration.go index d53c3f91d..942e3b0c1 100644 --- a/builtin/providers/pagerduty/resource_pagerduty_service_integration.go +++ b/builtin/providers/pagerduty/resource_pagerduty_service_integration.go @@ -16,15 +16,15 @@ func resourcePagerDutyServiceIntegration() *schema.Resource { // Therefore it needs to be manually removed from the Web UI. Delete: resourcePagerDutyServiceIntegrationDelete, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Optional: true, }, - "service": &schema.Schema{ + "service": { Type: schema.TypeString, Optional: true, }, - "type": &schema.Schema{ + "type": { Type: schema.TypeString, Required: true, ForceNew: true, @@ -40,17 +40,17 @@ func resourcePagerDutyServiceIntegration() *schema.Resource { "sql_monitor_inbound_integration", }), }, - "vendor": &schema.Schema{ + "vendor": { Type: schema.TypeString, ForceNew: true, Optional: true, }, - "integration_key": &schema.Schema{ + "integration_key": { Type: schema.TypeString, Optional: true, Computed: true, }, - "integration_email": &schema.Schema{ + "integration_email": { Type: schema.TypeString, Optional: true, Computed: true, diff --git a/builtin/providers/pagerduty/resource_pagerduty_team.go b/builtin/providers/pagerduty/resource_pagerduty_team.go index 076e98920..f322890b1 100644 --- a/builtin/providers/pagerduty/resource_pagerduty_team.go +++ b/builtin/providers/pagerduty/resource_pagerduty_team.go @@ -17,11 +17,11 @@ func resourcePagerDutyTeam() *schema.Resource { State: resourcePagerDutyTeamImport, }, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Default: "Managed by Terraform", diff --git a/builtin/providers/pagerduty/resource_pagerduty_user.go b/builtin/providers/pagerduty/resource_pagerduty_user.go index 4ffcb171e..b88681b19 100644 --- a/builtin/providers/pagerduty/resource_pagerduty_user.go +++ b/builtin/providers/pagerduty/resource_pagerduty_user.go @@ -17,20 +17,20 @@ func resourcePagerDutyUser() *schema.Resource { State: resourcePagerDutyUserImport, }, Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ + "name": { Type: schema.TypeString, Required: true, }, - "email": &schema.Schema{ + "email": { Type: schema.TypeString, Required: true, }, - "color": &schema.Schema{ + "color": { Type: schema.TypeString, Optional: true, Computed: true, }, - "role": &schema.Schema{ + "role": { Type: schema.TypeString, Optional: true, Default: "user", @@ -42,15 +42,15 @@ func resourcePagerDutyUser() *schema.Resource { "user", }), }, - "job_title": &schema.Schema{ + "job_title": { Type: schema.TypeString, Optional: true, }, - "avatar_url": &schema.Schema{ + "avatar_url": { Type: schema.TypeString, Computed: true, }, - "teams": &schema.Schema{ + "teams": { Type: schema.TypeSet, Optional: true, Elem: &schema.Schema{ @@ -58,19 +58,19 @@ func resourcePagerDutyUser() *schema.Resource { }, Set: schema.HashString, }, - "time_zone": &schema.Schema{ + "time_zone": { Type: schema.TypeString, Computed: true, }, - "html_url": &schema.Schema{ + "html_url": { Type: schema.TypeString, Computed: true, }, - "invitation_sent": &schema.Schema{ + "invitation_sent": { Type: schema.TypeBool, Computed: true, }, - "description": &schema.Schema{ + "description": { Type: schema.TypeString, Optional: true, Default: "Managed by Terraform",