rename integration provider to provider_type

"provider" is a reserved attribute name in Terraform.
This commit is contained in:
Graham McIntire 2026-03-13 17:41:06 -05:00
parent 4960adaf37
commit 3ff5ea41b3
No known key found for this signature in database
5 changed files with 13 additions and 13 deletions

View file

@ -137,8 +137,8 @@ output "agent_token" {
```terraform
resource "towerops_integration" "pagerduty" {
provider = "pagerduty"
enabled = true
provider_type = "pagerduty"
enabled = true
}
```

View file

@ -14,7 +14,7 @@ Manages a TowerOps integration with third-party services such as PagerDuty, Slac
```terraform
resource "towerops_integration" "pagerduty" {
provider = "pagerduty"
provider_type ="pagerduty"
enabled = true
}
```
@ -33,7 +33,7 @@ resource "towerops_integration" "webhook" {
```terraform
resource "towerops_integration" "slack" {
provider = "slack"
provider_type ="slack"
enabled = false
}
```
@ -42,7 +42,7 @@ resource "towerops_integration" "slack" {
### Required
- `provider` (String) - The integration provider type (e.g. `pagerduty`, `slack`, `webhook`).
- `provider_type` (String) - The integration provider type (e.g. `pagerduty`, `slack`, `webhook`).
### Optional

View file

@ -71,7 +71,7 @@ resource "towerops_agent" "remote" {
# Create an integration
resource "towerops_integration" "pagerduty" {
provider = "pagerduty"
provider_type = "pagerduty"
enabled = true
}

View file

@ -1,5 +1,5 @@
resource "towerops_integration" "pagerduty" {
provider = "pagerduty"
provider_type = "pagerduty"
enabled = true
sync_interval_minutes = 5
}

View file

@ -25,7 +25,7 @@ type IntegrationResource struct {
// IntegrationResourceModel describes the resource data model.
type IntegrationResourceModel struct {
ID types.String `tfsdk:"id"`
Provider types.String `tfsdk:"provider"`
ProviderType types.String `tfsdk:"provider_type"`
Enabled types.Bool `tfsdk:"enabled"`
SyncIntervalMinutes types.Int64 `tfsdk:"sync_interval_minutes"`
InsertedAt types.String `tfsdk:"inserted_at"`
@ -51,7 +51,7 @@ func (r *IntegrationResource) Schema(ctx context.Context, req resource.SchemaReq
stringplanmodifier.UseStateForUnknown(),
},
},
"provider": schema.StringAttribute{
"provider_type": schema.StringAttribute{
Description: "The integration provider type (e.g. pagerduty, slack, webhook).",
Required: true,
},
@ -102,7 +102,7 @@ func (r *IntegrationResource) Create(ctx context.Context, req resource.CreateReq
}
integration := integrationWithCredentials{
Provider: data.Provider.ValueString(),
Provider: data.ProviderType.ValueString(),
}
if !data.Enabled.IsNull() {
@ -152,7 +152,7 @@ func (r *IntegrationResource) Read(ctx context.Context, req resource.ReadRequest
return
}
data.Provider = types.StringValue(integration.Provider)
data.ProviderType = types.StringValue(integration.Provider)
data.InsertedAt = types.StringValue(integration.InsertedAt)
if integration.Enabled != nil {
@ -176,7 +176,7 @@ func (r *IntegrationResource) Update(ctx context.Context, req resource.UpdateReq
}
integration := integrationWithCredentials{
Provider: data.Provider.ValueString(),
Provider: data.ProviderType.ValueString(),
}
if !data.Enabled.IsNull() {
@ -212,7 +212,7 @@ func (r *IntegrationResource) Update(ctx context.Context, req resource.UpdateReq
return
}
data.Provider = types.StringValue(updated.Provider)
data.ProviderType = types.StringValue(updated.Provider)
if updated.Enabled != nil {
data.Enabled = types.BoolValue(*updated.Enabled)