From 96e45e93b5621843c0cfe834ca9eda464d390dac Mon Sep 17 00:00:00 2001 From: Douglas Parsons Date: Tue, 24 Oct 2023 12:03:42 +0100 Subject: [PATCH] team_id should not be computed Team IDs are optionally set on a per-resource basis. However, when omitted, they should not be set as 'computed', because they can never be anything other than Null/Unknown. Computed makes them show as unknown, expecting the value to later be set. This causes a weird churn when creating resources under a personal Vercel account. Closes #136 --- vercel/data_source_alias.go | 1 - vercel/data_source_project.go | 1 - vercel/resource_alias.go | 1 - vercel/resource_deployment.go | 1 - vercel/resource_dns_record.go | 1 - vercel/resource_project.go | 1 - vercel/resource_project_domain.go | 1 - vercel/resource_project_environment_variable.go | 1 - vercel/resource_shared_environment_variable.go | 1 - 9 files changed, 9 deletions(-) diff --git a/vercel/data_source_alias.go b/vercel/data_source_alias.go index 14fe8704..7e443829 100644 --- a/vercel/data_source_alias.go +++ b/vercel/data_source_alias.go @@ -55,7 +55,6 @@ An Alias allows a ` + "`vercel_deployment` to be accessed through a different UR Attributes: map[string]schema.Attribute{ "team_id": schema.StringAttribute{ Optional: true, - Computed: true, Description: "The ID of the team the Alias and Deployment exist under. Required when configuring a team resource if a default team has not been set in the provider.", }, "alias": schema.StringAttribute{ diff --git a/vercel/data_source_project.go b/vercel/data_source_project.go index 2c6bb7b4..a114aa41 100644 --- a/vercel/data_source_project.go +++ b/vercel/data_source_project.go @@ -61,7 +61,6 @@ For more detailed information, please see the [Vercel documentation](https://ver Attributes: map[string]schema.Attribute{ "team_id": schema.StringAttribute{ Optional: true, - Computed: true, Description: "The team ID the project exists beneath. Required when configuring a team resource if a default team has not been set in the provider.", }, "name": schema.StringAttribute{ diff --git a/vercel/resource_alias.go b/vercel/resource_alias.go index 533e92d5..07da776e 100644 --- a/vercel/resource_alias.go +++ b/vercel/resource_alias.go @@ -68,7 +68,6 @@ An Alias allows a ` + "`vercel_deployment` to be accessed through a different UR }, "team_id": schema.StringAttribute{ Optional: true, - Computed: true, Description: "The ID of the team the Alias and Deployment exist under. Required when configuring a team resource if a default team has not been set in the provider.", PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace()}, }, diff --git a/vercel/resource_deployment.go b/vercel/resource_deployment.go index d99f11fa..c7fe4678 100644 --- a/vercel/resource_deployment.go +++ b/vercel/resource_deployment.go @@ -92,7 +92,6 @@ terraform to your Deployment. "team_id": schema.StringAttribute{ Description: "The team ID to add the deployment to. Required when configuring a team resource if a default team has not been set in the provider.", Optional: true, - Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace(), stringplanmodifier.UseStateForUnknown()}, }, "project_id": schema.StringAttribute{ diff --git a/vercel/resource_dns_record.go b/vercel/resource_dns_record.go index 3e0b364d..81f8cdaf 100644 --- a/vercel/resource_dns_record.go +++ b/vercel/resource_dns_record.go @@ -66,7 +66,6 @@ For more detailed information, please see the [Vercel documentation](https://ver }, "team_id": schema.StringAttribute{ Optional: true, - Computed: true, Description: "The team ID that the domain and DNS records belong to. Required when configuring a team resource if a default team has not been set in the provider.", PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace(), stringplanmodifier.UseStateForUnknown()}, }, diff --git a/vercel/resource_project.go b/vercel/resource_project.go index 5b135916..ce7f1e37 100644 --- a/vercel/resource_project.go +++ b/vercel/resource_project.go @@ -69,7 +69,6 @@ At this time you cannot use a Vercel Project resource with in-line ` + "`environ Attributes: map[string]schema.Attribute{ "team_id": schema.StringAttribute{ Optional: true, - Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace(), stringplanmodifier.UseStateForUnknown()}, Description: "The team ID to add the project to. Required when configuring a team resource if a default team has not been set in the provider.", }, diff --git a/vercel/resource_project_domain.go b/vercel/resource_project_domain.go index 28abb258..e6a6fa56 100644 --- a/vercel/resource_project_domain.go +++ b/vercel/resource_project_domain.go @@ -66,7 +66,6 @@ By default, Project Domains will be automatically applied to any ` + "`productio }, "team_id": schema.StringAttribute{ Optional: true, - Computed: true, PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace(), stringplanmodifier.UseStateForUnknown()}, Description: "The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.", }, diff --git a/vercel/resource_project_environment_variable.go b/vercel/resource_project_environment_variable.go index f9f49ca0..8fbb7acf 100644 --- a/vercel/resource_project_environment_variable.go +++ b/vercel/resource_project_environment_variable.go @@ -94,7 +94,6 @@ At this time you cannot use a Vercel Project resource with in-line ` + "`environ }, "team_id": schema.StringAttribute{ Optional: true, - Computed: true, Description: "The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.", PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace(), stringplanmodifier.UseStateForUnknown()}, }, diff --git a/vercel/resource_shared_environment_variable.go b/vercel/resource_shared_environment_variable.go index 95bde157..9dbbfc21 100644 --- a/vercel/resource_shared_environment_variable.go +++ b/vercel/resource_shared_environment_variable.go @@ -87,7 +87,6 @@ For more detailed information, please see the [Vercel documentation](https://ver }, "team_id": schema.StringAttribute{ Optional: true, - Computed: true, Description: "The ID of the Vercel team. Shared environment variables require a team.", PlanModifiers: []planmodifier.String{stringplanmodifier.RequiresReplace(), stringplanmodifier.UseStateForUnknown()}, },