Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add input validation and drift detection during deletion for service_dependency #530

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add input validation for service_dependency type
  • Loading branch information
imjaroiswebdev committed Jul 11, 2022
commit f170fcd1aa29fd6a944ba5bef3a8a98891472efc
8 changes: 8 additions & 0 deletions pagerduty/resource_pagerduty_service_dependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func resourcePagerDutyServiceDependency() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validateValueFunc([]string{
"business_service",
"service",
}),
},
},
},
Expand All @@ -60,6 +64,10 @@ func resourcePagerDutyServiceDependency() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validateValueFunc([]string{
"business_service",
"service",
}),
},
},
},
Expand Down
9 changes: 7 additions & 2 deletions website/docs/r/service_dependency.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ resource "pagerduty_service_dependency" "bar" {
The following arguments are supported:

* `dependency` - (Required) The relationship between the `supporting_service` and `dependent_service`. One and only one dependency block must be defined.
* `supporting_service` - (Required) The service that supports the dependent service.
* `dependent_service` - (Required) The service that dependents on the supporting service.
* `supporting_service` - (Required) The service that supports the dependent service. Dependency supporting service documented below.
* `dependent_service` - (Required) The service that dependents on the supporting service. Dependency dependent service documented below.

Dependency supporting and dependent service supports the following:

* `id` - (Required) The ID of the service dependency.
* `type` - (Required) Can be `business_service` or `service`.

## Attributes Reference

Expand Down