From 3ff5ea41b3c7e78f8fd16933877f171d27902bfb Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 13 Mar 2026 17:41:06 -0500 Subject: [PATCH] rename integration provider to provider_type "provider" is a reserved attribute name in Terraform. --- docs/index.md | 4 ++-- docs/resources/integration.md | 6 +++--- examples/main.tf | 2 +- examples/resources/towerops_integration/resource.tf | 2 +- internal/provider/integration_resource.go | 12 ++++++------ 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/index.md b/docs/index.md index b8d87dd..444a1bf 100644 --- a/docs/index.md +++ b/docs/index.md @@ -137,8 +137,8 @@ output "agent_token" { ```terraform resource "towerops_integration" "pagerduty" { - provider = "pagerduty" - enabled = true + provider_type = "pagerduty" + enabled = true } ``` diff --git a/docs/resources/integration.md b/docs/resources/integration.md index fabb41d..094bae5 100644 --- a/docs/resources/integration.md +++ b/docs/resources/integration.md @@ -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 diff --git a/examples/main.tf b/examples/main.tf index 94f3c1a..dac1a96 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -71,7 +71,7 @@ resource "towerops_agent" "remote" { # Create an integration resource "towerops_integration" "pagerduty" { - provider = "pagerduty" + provider_type = "pagerduty" enabled = true } diff --git a/examples/resources/towerops_integration/resource.tf b/examples/resources/towerops_integration/resource.tf index d0c0d38..eb2da01 100644 --- a/examples/resources/towerops_integration/resource.tf +++ b/examples/resources/towerops_integration/resource.tf @@ -1,5 +1,5 @@ resource "towerops_integration" "pagerduty" { - provider = "pagerduty" + provider_type = "pagerduty" enabled = true sync_interval_minutes = 5 } diff --git a/internal/provider/integration_resource.go b/internal/provider/integration_resource.go index ddda845..c23ce9a 100644 --- a/internal/provider/integration_resource.go +++ b/internal/provider/integration_resource.go @@ -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)