From cd2e5652647f11495de57087708ec59652f90b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Reyes?= Date: Fri, 8 Sep 2023 18:33:44 -0300 Subject: [PATCH] execute `pagerduty_custom_field` planned deprecation --- .../data_source_pagerduty_custom_field.go | 46 -------- ...data_source_pagerduty_custom_field_test.go | 34 ------ .../data_source_pagerduty_field_schema.go | 30 ----- ...data_source_pagerduty_field_schema_test.go | 34 ------ pagerduty/provider.go | 7 -- pagerduty/resource_pagerduty_custom_field.go | 52 --------- .../resource_pagerduty_custom_field_option.go | 37 ------- ...urce_pagerduty_custom_field_option_test.go | 38 ------- .../resource_pagerduty_custom_field_schema.go | 34 ------ ...agerduty_custom_field_schema_assignment.go | 34 ------ ...uty_custom_field_schema_assignment_test.go | 32 ------ ...custom_field_schema_field_configuration.go | 51 --------- ...m_field_schema_field_configuration_test.go | 33 ------ ...urce_pagerduty_custom_field_schema_test.go | 36 ------ .../resource_pagerduty_custom_field_test.go | 39 ------- website/docs/d/custom_field.html.markdown | 46 -------- .../docs/d/custom_field_schema.html.markdown | 45 -------- website/docs/r/custom_field.html.markdown | 63 ----------- .../docs/r/custom_field_option.html.markdown | 61 ---------- .../docs/r/custom_field_schema.html.markdown | 53 --------- ...stom_field_schema_assignment.html.markdown | 54 --------- ...d_schema_field_configuration.html.markdown | 104 ------------------ 22 files changed, 963 deletions(-) delete mode 100644 pagerduty/data_source_pagerduty_custom_field.go delete mode 100644 pagerduty/data_source_pagerduty_custom_field_test.go delete mode 100644 pagerduty/data_source_pagerduty_field_schema.go delete mode 100644 pagerduty/data_source_pagerduty_field_schema_test.go delete mode 100644 pagerduty/resource_pagerduty_custom_field.go delete mode 100644 pagerduty/resource_pagerduty_custom_field_option.go delete mode 100644 pagerduty/resource_pagerduty_custom_field_option_test.go delete mode 100644 pagerduty/resource_pagerduty_custom_field_schema.go delete mode 100644 pagerduty/resource_pagerduty_custom_field_schema_assignment.go delete mode 100644 pagerduty/resource_pagerduty_custom_field_schema_assignment_test.go delete mode 100644 pagerduty/resource_pagerduty_custom_field_schema_field_configuration.go delete mode 100644 pagerduty/resource_pagerduty_custom_field_schema_field_configuration_test.go delete mode 100644 pagerduty/resource_pagerduty_custom_field_schema_test.go delete mode 100644 pagerduty/resource_pagerduty_custom_field_test.go delete mode 100644 website/docs/d/custom_field.html.markdown delete mode 100644 website/docs/d/custom_field_schema.html.markdown delete mode 100644 website/docs/r/custom_field.html.markdown delete mode 100644 website/docs/r/custom_field_option.html.markdown delete mode 100644 website/docs/r/custom_field_schema.html.markdown delete mode 100644 website/docs/r/custom_field_schema_assignment.html.markdown delete mode 100644 website/docs/r/custom_field_schema_field_configuration.html.markdown diff --git a/pagerduty/data_source_pagerduty_custom_field.go b/pagerduty/data_source_pagerduty_custom_field.go deleted file mode 100644 index 19974117b..000000000 --- a/pagerduty/data_source_pagerduty_custom_field.go +++ /dev/null @@ -1,46 +0,0 @@ -package pagerduty - -import ( - "context" - "errors" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourcePagerDutyField() *schema.Resource { - depMsg := "The standalone custom field feature has been removed from PagerDuty's Public API. The incident_custom_field data source provides similar, but not identical, functionality." - - return &schema.Resource{ - DeprecationMessage: depMsg, - ReadContext: func(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errors.New(depMsg)) - }, - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "display_name": { - Type: schema.TypeString, - Computed: true, - }, - "description": { - Type: schema.TypeString, - Computed: true, - }, - "datatype": { - Type: schema.TypeString, - Computed: true, - }, - "multi_value": { - Type: schema.TypeBool, - Computed: true, - }, - "fixed_options": { - Type: schema.TypeBool, - Computed: true, - }, - }, - } -} diff --git a/pagerduty/data_source_pagerduty_custom_field_test.go b/pagerduty/data_source_pagerduty_custom_field_test.go deleted file mode 100644 index dc3b9718c..000000000 --- a/pagerduty/data_source_pagerduty_custom_field_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package pagerduty - -import ( - "fmt" - "regexp" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccDataSourcePagerDutyCustomField(t *testing.T) { - fieldName := fmt.Sprintf("tf_%s", acctest.RandString(5)) - resource.Test(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - ProviderFactories: testAccProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccDataSourcePagerDutyCustomFieldConfig(fieldName), - ExpectError: regexp.MustCompile("The standalone custom field feature has been removed"), - }, - }, - }) -} - -func testAccDataSourcePagerDutyCustomFieldConfig(name string) string { - return fmt.Sprintf(` -data "pagerduty_custom_field" "%[1]s" { - name = "%[1]s" -} -`, name) -} diff --git a/pagerduty/data_source_pagerduty_field_schema.go b/pagerduty/data_source_pagerduty_field_schema.go deleted file mode 100644 index b40f670d7..000000000 --- a/pagerduty/data_source_pagerduty_field_schema.go +++ /dev/null @@ -1,30 +0,0 @@ -package pagerduty - -import ( - "context" - "errors" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func dataSourcePagerDutyFieldSchema() *schema.Resource { - depMsg := "The custom field schema feature has been removed from PagerDuty's Public API." - - return &schema.Resource{ - DeprecationMessage: depMsg, - ReadContext: func(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics { - return diag.FromErr(errors.New(depMsg)) - }, - Schema: map[string]*schema.Schema{ - "title": { - Type: schema.TypeString, - Required: true, - }, - "description": { - Type: schema.TypeString, - Computed: true, - }, - }, - } -} diff --git a/pagerduty/data_source_pagerduty_field_schema_test.go b/pagerduty/data_source_pagerduty_field_schema_test.go deleted file mode 100644 index 5c588e698..000000000 --- a/pagerduty/data_source_pagerduty_field_schema_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package pagerduty - -import ( - "fmt" - "regexp" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccDataSourcePagerDutyCustomFieldSchema(t *testing.T) { - schemaTitle := fmt.Sprintf("tf-%s", acctest.RandString(5)) - resource.Test(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - ProviderFactories: testAccProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccDataSourcePagerDutyFieldSchemaConfig(schemaTitle), - ExpectError: regexp.MustCompile("The custom field schema feature has been removed"), - }, - }, - }) -} - -func testAccDataSourcePagerDutyFieldSchemaConfig(title string) string { - return fmt.Sprintf(` -data "pagerduty_custom_field_schema" "%[1]s" { - title = "%[1]s" -} -`, title) -} diff --git a/pagerduty/provider.go b/pagerduty/provider.go index ef6b53fb2..1e8fb8bcd 100644 --- a/pagerduty/provider.go +++ b/pagerduty/provider.go @@ -97,8 +97,6 @@ func Provider() *schema.Provider { "pagerduty_automation_actions_runner": dataSourcePagerDutyAutomationActionsRunner(), "pagerduty_automation_actions_action": dataSourcePagerDutyAutomationActionsAction(), "pagerduty_incident_workflow": dataSourcePagerDutyIncidentWorkflow(), - "pagerduty_custom_field": dataSourcePagerDutyField(), // deprecated - "pagerduty_custom_field_schema": dataSourcePagerDutyFieldSchema(), // deprecated "pagerduty_incident_custom_field": dataSourcePagerDutyIncidentCustomField(), }, @@ -141,11 +139,6 @@ func Provider() *schema.Provider { "pagerduty_incident_workflow": resourcePagerDutyIncidentWorkflow(), "pagerduty_incident_workflow_trigger": resourcePagerDutyIncidentWorkflowTrigger(), "pagerduty_automation_actions_action_service_association": resourcePagerDutyAutomationActionsActionServiceAssociation(), - "pagerduty_custom_field": resourcePagerDutyCustomField(), // deprecated - "pagerduty_custom_field_option": resourcePagerDutyCustomFieldOption(), // deprecated - "pagerduty_custom_field_schema": resourcePagerDutyCustomFieldSchema(), // deprecated - "pagerduty_custom_field_schema_field_configuration": resourcePagerDutyCustomFieldSchemaFieldConfiguration(), // deprecated - "pagerduty_custom_field_schema_assignment": resourcePagerDutyCustomFieldSchemaAssignment(), // deprecated "pagerduty_incident_custom_field": resourcePagerDutyIncidentCustomField(), "pagerduty_incident_custom_field_option": resourcePagerDutyIncidentCustomFieldOption(), }, diff --git a/pagerduty/resource_pagerduty_custom_field.go b/pagerduty/resource_pagerduty_custom_field.go deleted file mode 100644 index d5da6cba6..000000000 --- a/pagerduty/resource_pagerduty_custom_field.go +++ /dev/null @@ -1,52 +0,0 @@ -package pagerduty - -import ( - "context" - "errors" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourcePagerDutyCustomField() *schema.Resource { - depMsg := "The standalone custom field feature has been removed from PagerDuty's Public API. The incident_custom_field resource provides similar, but not identical, functionality." - - f := func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return diag.FromErr(errors.New(depMsg)) - } - - return &schema.Resource{ - DeprecationMessage: depMsg, - ReadContext: f, - UpdateContext: f, - DeleteContext: f, - CreateContext: f, - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "display_name": { - Type: schema.TypeString, - Required: true, - }, - "description": { - Type: schema.TypeString, - Optional: true, - }, - "datatype": { - Type: schema.TypeString, - Required: true, - }, - "multi_value": { - Type: schema.TypeBool, - Default: false, - Optional: true, - }, - "fixed_options": { - Type: schema.TypeBool, - Default: false, - Optional: true, - }, - }, - } -} diff --git a/pagerduty/resource_pagerduty_custom_field_option.go b/pagerduty/resource_pagerduty_custom_field_option.go deleted file mode 100644 index 65a3a84e9..000000000 --- a/pagerduty/resource_pagerduty_custom_field_option.go +++ /dev/null @@ -1,37 +0,0 @@ -package pagerduty - -import ( - "context" - "errors" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourcePagerDutyCustomFieldOption() *schema.Resource { - depMsg := "The standalone custom field feature has been removed from PagerDuty's Public API. The incident_custom_field_option resource provides similar, but not identical, functionality." - - f := func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return diag.FromErr(errors.New(depMsg)) - } - - return &schema.Resource{ - ReadContext: f, - UpdateContext: f, - DeleteContext: f, - CreateContext: f, - Schema: map[string]*schema.Schema{ - "field": { - Type: schema.TypeString, - Required: true, - }, - "datatype": { - Type: schema.TypeString, - Required: true, - }, - "value": { - Type: schema.TypeString, - Required: true, - }, - }, - } -} diff --git a/pagerduty/resource_pagerduty_custom_field_option_test.go b/pagerduty/resource_pagerduty_custom_field_option_test.go deleted file mode 100644 index 361fb984b..000000000 --- a/pagerduty/resource_pagerduty_custom_field_option_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package pagerduty - -import ( - "fmt" - "regexp" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccPagerDutyCustomFieldOptions_Basic(t *testing.T) { - fieldName := fmt.Sprintf("tf_%s", acctest.RandString(5)) - fieldOptionValue := fmt.Sprintf("tf_%s", acctest.RandString(5)) - resource.Test(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - ProviderFactories: testAccProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccCheckPagerDutyCustomFieldOptionConfig(fieldName, fieldOptionValue), - ExpectError: regexp.MustCompile("The standalone custom field feature has been removed"), - }, - }, - }) -} - -func testAccCheckPagerDutyCustomFieldOptionConfig(name string, fieldOptionValue string) string { - return fmt.Sprintf(` -resource "pagerduty_custom_field_option" "test" { - field = "%s" - datatype = "string" - value = "%s" -} - -`, name, fieldOptionValue) -} diff --git a/pagerduty/resource_pagerduty_custom_field_schema.go b/pagerduty/resource_pagerduty_custom_field_schema.go deleted file mode 100644 index eb2897fb7..000000000 --- a/pagerduty/resource_pagerduty_custom_field_schema.go +++ /dev/null @@ -1,34 +0,0 @@ -package pagerduty - -import ( - "context" - "errors" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourcePagerDutyCustomFieldSchema() *schema.Resource { - depMsg := "The standalone custom field schema feature has been removed from PagerDuty's Public API." - - f := func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return diag.FromErr(errors.New(depMsg)) - } - - return &schema.Resource{ - ReadContext: f, - UpdateContext: f, - DeleteContext: f, - CreateContext: f, - Schema: map[string]*schema.Schema{ - "title": { - Type: schema.TypeString, - Required: true, - }, - "description": { - Type: schema.TypeString, - Optional: true, - }, - }, - } -} diff --git a/pagerduty/resource_pagerduty_custom_field_schema_assignment.go b/pagerduty/resource_pagerduty_custom_field_schema_assignment.go deleted file mode 100644 index 8d88cbd9e..000000000 --- a/pagerduty/resource_pagerduty_custom_field_schema_assignment.go +++ /dev/null @@ -1,34 +0,0 @@ -package pagerduty - -import ( - "context" - "errors" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourcePagerDutyCustomFieldSchemaAssignment() *schema.Resource { - depMsg := "The custom field schema feature has been removed from PagerDuty's Public API." - - f := func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return diag.FromErr(errors.New(depMsg)) - } - - return &schema.Resource{ - ReadContext: f, - CreateContext: f, - DeleteContext: f, - Schema: map[string]*schema.Schema{ - "schema": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "service": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - }, - } -} diff --git a/pagerduty/resource_pagerduty_custom_field_schema_assignment_test.go b/pagerduty/resource_pagerduty_custom_field_schema_assignment_test.go deleted file mode 100644 index 2b4f0ddba..000000000 --- a/pagerduty/resource_pagerduty_custom_field_schema_assignment_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package pagerduty - -import ( - "regexp" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccPagerDutyCustomFieldSchemaAssignment(t *testing.T) { - resource.Test(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - ProviderFactories: testAccProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccCheckPagerDutyCustomFieldSchemaAssignment(), - ExpectError: regexp.MustCompile("The custom field schema feature has been removed"), - }, - }, - }) -} - -func testAccCheckPagerDutyCustomFieldSchemaAssignment() string { - return ` -resource "pagerduty_custom_field_schema_assignment" "test" { - schema = "test1" - service = "test2" -} -` -} diff --git a/pagerduty/resource_pagerduty_custom_field_schema_field_configuration.go b/pagerduty/resource_pagerduty_custom_field_schema_field_configuration.go deleted file mode 100644 index 9145ed00f..000000000 --- a/pagerduty/resource_pagerduty_custom_field_schema_field_configuration.go +++ /dev/null @@ -1,51 +0,0 @@ -package pagerduty - -import ( - "context" - "errors" - - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourcePagerDutyCustomFieldSchemaFieldConfiguration() *schema.Resource { - depMsg := "The standalone custom field schema feature has been removed from PagerDuty's Public API." - - f := func(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - return diag.FromErr(errors.New(depMsg)) - } - - return &schema.Resource{ - ReadContext: f, - UpdateContext: f, - DeleteContext: f, - CreateContext: f, - Schema: map[string]*schema.Schema{ - "schema": { - Type: schema.TypeString, - Required: true, - }, - "field": { - Type: schema.TypeString, - Required: true, - }, - "required": { - Type: schema.TypeBool, - Optional: true, - }, - "default_value": { - Type: schema.TypeString, - Optional: true, - }, - "default_value_multi_value": { - Type: schema.TypeBool, - Default: false, - Optional: true, - }, - "default_value_datatype": { - Type: schema.TypeString, - Optional: true, - }, - }, - } -} diff --git a/pagerduty/resource_pagerduty_custom_field_schema_field_configuration_test.go b/pagerduty/resource_pagerduty_custom_field_schema_field_configuration_test.go deleted file mode 100644 index b15043d4c..000000000 --- a/pagerduty/resource_pagerduty_custom_field_schema_field_configuration_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package pagerduty - -import ( - "regexp" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccPagerDutyCustomFieldConfiguration_Basic(t *testing.T) { - - resource.Test(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - ProviderFactories: testAccProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccCheckPagerDutyCustomFieldConfigurationConfigBasic(), - ExpectError: regexp.MustCompile("The standalone custom field schema feature"), - }, - }, - }) -} - -func testAccCheckPagerDutyCustomFieldConfigurationConfigBasic() string { - return ` -resource "pagerduty_custom_field_schema_field_configuration" "test" { - field = "foo" - schema = "bar" -} -` -} diff --git a/pagerduty/resource_pagerduty_custom_field_schema_test.go b/pagerduty/resource_pagerduty_custom_field_schema_test.go deleted file mode 100644 index 95f134101..000000000 --- a/pagerduty/resource_pagerduty_custom_field_schema_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package pagerduty - -import ( - "fmt" - "regexp" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccPagerDutyCustomFieldSchemas_Basic(t *testing.T) { - schemaTitle := fmt.Sprintf("tf-%s", acctest.RandString(5)) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - ProviderFactories: testAccProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccCheckPagerDutyCustomFieldSchemaConfigBasic(schemaTitle), - ExpectError: regexp.MustCompile("The standalone custom field schema feature"), - }, - }, - }) -} - -func testAccCheckPagerDutyCustomFieldSchemaConfigBasic(title string) string { - return fmt.Sprintf(` -resource "pagerduty_custom_field_schema" "test" { - title = "%[1]s" - description = "some description" -} -`, title) -} diff --git a/pagerduty/resource_pagerduty_custom_field_test.go b/pagerduty/resource_pagerduty_custom_field_test.go deleted file mode 100644 index f948d8ee5..000000000 --- a/pagerduty/resource_pagerduty_custom_field_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package pagerduty - -import ( - "fmt" - "regexp" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -func TestAccPagerDutyCustomFields_Basic(t *testing.T) { - fieldName := fmt.Sprintf("tf_%s", acctest.RandString(5)) - description1 := acctest.RandString(10) - - resource.Test(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - ProviderFactories: testAccProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccCheckPagerDutyCustomFieldConfig(fieldName, description1, "string"), - ExpectError: regexp.MustCompile("The standalone custom field feature"), - }, - }, - }) -} - -func testAccCheckPagerDutyCustomFieldConfig(name, description, datatype string) string { - return fmt.Sprintf(` -resource "pagerduty_custom_field" "input" { - name = "%[1]s" - display_name = "%[1]s" - description = "%[2]s" - datatype = "%[3]s" -} -`, name, description, datatype) -} diff --git a/website/docs/d/custom_field.html.markdown b/website/docs/d/custom_field.html.markdown deleted file mode 100644 index 02096d579..000000000 --- a/website/docs/d/custom_field.html.markdown +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: "pagerduty" -page_title: "PagerDuty: pagerduty_custom_field" -sidebar_current: "docs-pagerduty-datasource-custom-field" -description: |- - Get information about a custom field that you can add to a custom field schema. ---- - -# pagerduty\_custom\_field - -!> This Data Source is no longer functional. Documentation is left here for the purpose of documenting migration steps. - -Use this data source to get information about a specific [Custom Field](https://support.pagerduty.com/docs/custom-fields) that you can add to a custom field schema. - -## Migration - -The [`incident_custom_field`](./incident_custom_field.html.markdown) data source provides similar functionality -with the same arguments and attributes. The key distinction is that while custom fields returned by this data source -may have only applied to a subset of incidents within the account, custom fields returned by the `incident_custom_field` -data source are applied to all incidents in the account. - -## Example Usage - -```hcl -data "pagerduty_custom_field" "sre_environment" { - name = "environment" -} - -resource "pagerduty_custom_field_schema" "foo" { - title = "myschema" - description = "some description" - field { - field = data.pagerduty_custom_field.sre_environment.id - } -} -``` - -## Argument Reference - -The following arguments are supported: - -* `name` - (Required) The name of the field. - -## Attributes Reference - -* `id` - The ID of the found field. diff --git a/website/docs/d/custom_field_schema.html.markdown b/website/docs/d/custom_field_schema.html.markdown deleted file mode 100644 index 64d5514ef..000000000 --- a/website/docs/d/custom_field_schema.html.markdown +++ /dev/null @@ -1,45 +0,0 @@ ---- -layout: "pagerduty" -page_title: "PagerDuty: pagerduty_custom_field_schema" -sidebar_current: "docs-pagerduty-datasource-custom-field_schema" -description: |- - Get information about a custom field schema that you can assign to services. ---- - -# pagerduty\_custom\_field\_schema - -!> This Data Source is no longer functional. Documentation is left here for the purpose of documenting migration steps. - -Use this data source to get information about a specific [Custom Field Schema](https://support.pagerduty.com/docs/custom-fields#schemas) that you can assign to a service. - -## Migration - -This data source has no currently functional counterpart. Custom Fields on Incidents are now applied globally -to incidents within an account and have no notion of a Field Schema. - -## Example Usage - -```hcl -data "pagerduty_custom_field_schema" "myschema" { - title = "myschema title" -} - -data "pagerduty_service" "first_service" { - name = "My Service" -} - -resource "pagerduty_custom_field_schema_assignment" "foo" { - schema = data.pagerduty_custom_field_schema.myschema.id - service = data.pagerduty_service.first_service.id -} -``` - -## Argument Reference - -The following arguments are supported: - -* `title` - (Required) The title of the field schema. - -## Attributes Reference - -* `id` - The ID of the found field schema. diff --git a/website/docs/r/custom_field.html.markdown b/website/docs/r/custom_field.html.markdown deleted file mode 100644 index a1b24cda8..000000000 --- a/website/docs/r/custom_field.html.markdown +++ /dev/null @@ -1,63 +0,0 @@ ---- -layout: "pagerduty" -page_title: "PagerDuty: pagerduty_custom_field" -sidebar_current: "docs-pagerduty-resource-custom-field" -description: |- - Creates and manages a custom field in PagerDuty. ---- - -# pagerduty\_custom\_field - -!> This Resource is no longer functional. Documentation is left here for the purpose of documenting migration steps. - -A [Custom Field](https://support.pagerduty.com/docs/custom-fields) is a resuable element which can be added to Custom Field Schemas. - -## Migration - -The [`incident_custom_field`](./incident_custom_field.html.markdown) resource provides similar functionality -with largely the same arguments and attributes. The key distinction is that while custom fields created by this data source -may have only applied to a subset of incidents within the account after being added to a schema and assigned to a service, -custom fields managed by the `incident_custom_field` resource are applied to all incidents in the account. - -Additionally: -* The separate `multi_value` and `fixed_options` arguments have been merged into a single argument -named `field_type`. -* The `datatype` argument has been renamed `data_type` to match the Public API for the Custom Fields on Incidents feature. - -## Example Usage - -```hcl -resource "pagerduty_custom_field" "cs_impact" { - name = "impact" - datatype = "string" -} - -resource "pagerduty_custom_field" "sre_environment" { - name = "environment" - datatype = "string" - fixed_options = true -} -``` - -## Argument Reference - -The following arguments are supported: - - * `name` - (Required) The name of the field. - * `datatype` - (Required) The datatype of the field. Must be one of `string`, `integer`, `float`, `boolean`, `datetime`, or `url`. - * `multi_value` - (Optional) True if the field can accept multiple values. - * `fixed_options` - (Optional) True if the field can only accept values from a set of options. - -## Attributes Reference - -The following attributes are exported: - - * `id` - The ID of the field. - -## Import - -Fields can be imported using the `id`, e.g. - -``` -$ terraform import pagerduty_custom_field.sre_environment PLBP09X -``` diff --git a/website/docs/r/custom_field_option.html.markdown b/website/docs/r/custom_field_option.html.markdown deleted file mode 100644 index 3594b1475..000000000 --- a/website/docs/r/custom_field_option.html.markdown +++ /dev/null @@ -1,61 +0,0 @@ ---- -layout: "pagerduty" -page_title: "PagerDuty: pagerduty_custom_field_option" -sidebar_current: "docs-pagerduty-resource-custom-field-option" -description: |- - Creates and manages a custom field option in PagerDuty. ---- - -# pagerduty\_custom\_field\_option - -!> This Resource is no longer functional. Documentation is left here for the purpose of documenting migration steps. - -A Custom Field Option is a specific value that can be used for [Custom Fields](https://support.pagerduty.com/docs/custom-fields) that only allow values from a set of fixed option. - -## Migration - -The [`incident_custom_field_option`](./incident_custom_field_option.html.markdown) resource provides similar functionality -with largely the same arguments and attributes. The only significant change is that the `datatype` argument has been renamed `data_type` -to match the Public API for the Custom Fields on Incidents feature. - -## Example Usage - -```hcl -resource "pagerduty_custom_field" "sre_environment" { - name = "environment" - datatype = "string" - fixed_options = true -} - -resource "pagerduty_custom_field_option" "dev_environment" { - field = pagerduty_custom_field.sre_environment.id - datatype = "string" - value = "dev" -} - -resource "pagerduty_custom_field_option" "stage_environment" { - field = pagerduty_custom_field.sre_environment.id - datatype = "string" - value = "stage" -} - -resource "pagerduty_custom_field_option" "prod_environment" { - field = pagerduty_custom_field.sre_environment.id - datatype = "string" - value = "prod" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `field` - (Required) The ID of the field. -* `datatype` - (Required) The datatype of the field option. Must be one of `string`, `integer`, `float`, `boolean`, `datetime`, or `url`. -* `value` - (Required) The allowed value. - -## Attributes Reference - -The following attributes are exported: - - * `id` - The ID of the field option. diff --git a/website/docs/r/custom_field_schema.html.markdown b/website/docs/r/custom_field_schema.html.markdown deleted file mode 100644 index 1b7837980..000000000 --- a/website/docs/r/custom_field_schema.html.markdown +++ /dev/null @@ -1,53 +0,0 @@ ---- -layout: "pagerduty" -page_title: "PagerDuty: pagerduty_custom_field_schema" -sidebar_current: "docs-pagerduty-resource-custom-field-schema" -description: |- - Creates and manages a custom field schema in PagerDuty. ---- - -# pagerduty\_custom\_field\_schema - -!> This Resource is no longer functional. Documentation is left here for the purpose of documenting migration steps. - -A [Custom Field Schema](https://support.pagerduty.com/docs/custom-fields#schemas) is a set of Custom Fields which can be set on an incident. - -## Migration - -This resource has no currently functional counterpart. Custom Fields on Incidents are now applied globally -to incidents within an account and have no notion of a Field Schema. - -## Example Usage - -```hcl -resource "pagerduty_custom_field" "cs_impact" { - name = "impact" - datatype = "string" -} - -resource "pagerduty_custom_field_schema" "my_schema" { - title = "My Schema" - description = "Fields used on incidents" -} -``` - -## Argument Reference - -The following arguments are supported: - - * `title` - (Required) The title of the field schema. - * `description` - (Optional) The description of the field schema. - -## Attributes Reference - -The following attributes are exported: - - * `id` - The ID of the field schema. - -## Import - -Fields schemas can be imported using the `id`, e.g. - -``` -$ terraform import pagerduty_custom_field_schema.my_schema PLBP09X -``` diff --git a/website/docs/r/custom_field_schema_assignment.html.markdown b/website/docs/r/custom_field_schema_assignment.html.markdown deleted file mode 100644 index d04aa78b8..000000000 --- a/website/docs/r/custom_field_schema_assignment.html.markdown +++ /dev/null @@ -1,54 +0,0 @@ ---- -layout: "pagerduty" -page_title: "PagerDuty: pagerduty_custom_field_schema_assignment" -sidebar_current: "docs-pagerduty-resource-custom-field-schema-assignment" -description: |- - Creates and manages a custom field schema assignment in PagerDuty. ---- - -# pagerduty\_custom\_field\_schema\_assignment - -!> This Resource is no longer functional. Documentation is left here for the purpose of documenting migration steps. - -A [Custom Field Schema Assignment](https://support.pagerduty.com/docs/custom-fields#associate-schemas-with-services) is a relationship between a Custom Field Schema and a Service. - -## Migration - -This resource has no currently functional counterpart. Custom Fields on Incidents are now applied globally -to incidents within an account and have no notion of a Field Schema. - -## Example Usage - -```hcl -resource "pagerduty_custom_field" "cs_impact" { - name = "impact" - datatype = "string" -} - -resource "pagerduty_custom_field_schema" "my_schema" { - title = "My Schema" - description = "Fields used on incidents" -} - -data "pagerduty_service" "first_service" { - name = "My First Service" -} - -resource "pagerduty_custom_field_schema_assignment" "assignment" { - schema = pagerduty_custom_field_schema.my_schema.id - service = data.pagerduty_service.first_service.id -} -``` - -## Argument Reference - -The following arguments are supported: - - * `schema` - (Required) The id of the field schema. - * `service` - (Required) The id of the service. - -## Attributes Reference - -The following attributes are exported: - - * `id` - The ID of the field schema assignment. diff --git a/website/docs/r/custom_field_schema_field_configuration.html.markdown b/website/docs/r/custom_field_schema_field_configuration.html.markdown deleted file mode 100644 index d58070c45..000000000 --- a/website/docs/r/custom_field_schema_field_configuration.html.markdown +++ /dev/null @@ -1,104 +0,0 @@ ---- -layout: "pagerduty" -page_title: "PagerDuty: pagerduty_custom_field_schema_field_configuration" -sidebar_current: "docs-pagerduty-resource-custom-field-schema-field-configuration" -description: |- - Creates and manages a custom field configuration in PagerDuty. ---- - -# pagerduty\_custom\_field\_schema\_field\_configuration - -!> This Resource is no longer functional. Documentation is left here for the purpose of documenting migration steps. - -A [Custom Field Configuration](https://support.pagerduty.com/docs/custom-fields#associate-schemas-with-services) is a declaration of a specific Custom Field in a specific Custom Field Schema. - -## Migration - -This resource has no currently functional counterpart. Custom Fields on Incidents are now applied globally -to incidents within an account and have no notion of a Field Schema. - -## Example Usage - -```hcl -resource "pagerduty_custom_field" "cs_impact" { - name = "impact" - datatype = "string" -} - -resource "pagerduty_custom_field_schema" "my_schema" { - title = "My Schema" - description = "Fields used on incidents" -} - -resource "pagerduty_custom_field_schema_field_configuration" "first_field_configuration" { - schema = pagerduty_custom_field_schema.my_schema.id - field = pagerduty_custom_field.cs_impact.id - required = true - default_value = "none" - default_value_datatype = "string" -} -``` - -## Argument Reference - -The following arguments are supported: - -* `field` - (Required) The ID of the field. -* `schema` - (Required) The ID of the schema. -* `required` - (Optional) True if the field is required -* `default_value` - (Optional) The default value for the field. -* `default_value_datatype` - (Optional) The datatype of the default value. -* `default_value_multi_value` - (Optional) Whether or not the default value is multi-valued. - -#### Required and Default Value - -Although `required`, `default_value`, and `default_value_datatype` are all -technically optional, they must be provided together, i.e. if `required` is `true`, -there **must** be a `default_value` and a `default_value_datatype`. - -The `default_value_multi_value` attribute is only required if it is `true`, i.e. these two fragments -are semantically identical: - -```hcl - field = "ID1" - schema = "ID2" - required = true - default_value = "foo" - default_value_datatype = "string" -``` - -```hcl - field = "ID1" - schema = "ID2" - required = true - default_value = "foo" - default_value_datatype = "string" - default_value_multi_value = false -``` - -Default values are always strings. When providing a default value for a multi-valued field, the default value -needs to be a JSON-encoded array, e.g. - -```hcl - field = "ID1" - required = true - default_value = jsonencode(["foo", "bar"]) - default_value_datatype = "string" - default_value_multi_value = true -``` - - -```hcl - field = "ID1" - required = true - default_value = jsonencode([50, 60]) - default_value_datatype = "string" - default_value_multi_value = true -``` - -## Attributes Reference - -The following attributes are exported: - - * `id` - The ID of the field configuration. -