From 1a401f3e1b76d0328cc414eba03c8df5c3a3d9e4 Mon Sep 17 00:00:00 2001 From: Luke Phillips-Sheard Date: Thu, 12 Jun 2025 10:06:10 +0100 Subject: [PATCH 1/5] [project] Support build_machine_type in project declarations --- client/project.go | 2 ++ docs/data-sources/project.md | 25 ++++++++++++++----------- docs/resources/project.md | 25 ++++++++++++++----------- vercel/data_source_project.go | 10 ++++++++++ vercel/data_source_project_test.go | 2 ++ vercel/resource_project.go | 19 ++++++++++++++++--- vercel/resource_project_test.go | 3 +++ 7 files changed, 61 insertions(+), 25 deletions(-) diff --git a/client/project.go b/client/project.go index 9c84a9be..f650093e 100644 --- a/client/project.go +++ b/client/project.go @@ -231,6 +231,7 @@ type ResourceConfigResponse struct { FunctionDefaultTimeout *int64 `json:"functionDefaultTimeout"` Fluid bool `json:"fluid"` ElasticConcurrencyEnabled bool `json:"elasticConcurrencyEnabled"` + BuildMachineType string `json:"buildMachineType"` } type ResourceConfig struct { @@ -238,6 +239,7 @@ type ResourceConfig struct { FunctionDefaultTimeout *int64 `json:"functionDefaultTimeout,omitempty"` Fluid *bool `json:"fluid,omitempty"` ElasticConcurrencyEnabled *bool `json:"elasticConcurrencyEnabled,omitempty"` + BuildMachineType *string `json:"buildMachineType,omitempty"` } // GetProject retrieves information about an existing project from Vercel. diff --git a/docs/data-sources/project.md b/docs/data-sources/project.md index 1b8719c1..d56603f3 100644 --- a/docs/data-sources/project.md +++ b/docs/data-sources/project.md @@ -25,6 +25,7 @@ data "vercel_project" "example" { ``` + ## Schema ### Required @@ -34,6 +35,7 @@ data "vercel_project" "example" { ### Optional - `on_demand_concurrent_builds` (Boolean) Instantly scale build capacity to skip the queue, even if all build slots are in use. You can also choose a larger build machine; charges apply per minute if it exceeds your team's default. +- `build_machine_type` (String) The build machine type to use for this project. Must be one of "standard", "enhanced". - `team_id` (String) The team ID the project exists beneath. Required when configuring a team resource if a default team has not been set in the provider. ### Read-Only @@ -75,6 +77,7 @@ data "vercel_project" "example" { - `vercel_authentication` (Attributes) Ensures visitors to your Preview Deployments are logged into Vercel and have a minimum of Viewer access on your team. (see [below for nested schema](#nestedatt--vercel_authentication)) + ### Nested Schema for `environment` Read-Only: @@ -88,8 +91,8 @@ Read-Only: - `target` (Set of String) The environments that the environment variable should be present on. Valid targets are either `production`, `preview`, or `development`. - `value` (String) The value of the environment variable. - + ### Nested Schema for `git_comments` Required: @@ -97,8 +100,8 @@ Required: - `on_commit` (Boolean) Whether Commit comments are enabled - `on_pull_request` (Boolean) Whether Pull Request comments are enabled - + ### Nested Schema for `git_repository` Read-Only: @@ -109,6 +112,7 @@ Read-Only: - `type` (String) The git provider of the repository. Must be either `github`, `gitlab`, or `bitbucket`. + ### Nested Schema for `git_repository.deploy_hooks` Read-Only: @@ -118,9 +122,8 @@ Read-Only: - `ref` (String) The branch or commit hash that should be deployed. - `url` (String, Sensitive) A URL that, when a POST request is made to, will trigger a new deployment. - - + ### Nested Schema for `oidc_token_config` Optional: @@ -131,8 +134,8 @@ Read-Only: - `enabled` (Boolean, Deprecated) When true, Vercel issued OpenID Connect (OIDC) tokens will be available on the compute environments. See https://vercel.com/docs/security/secure-backend-access/oidc for more information. - + ### Nested Schema for `options_allowlist` Read-Only: @@ -140,23 +143,23 @@ Read-Only: - `paths` (List of Object) The allowed paths for the OPTIONS Allowlist. Incoming requests will bypass Deployment Protection if they have the method `OPTIONS` and **start with** one of the path values. (see [below for nested schema](#nestedatt--options_allowlist--paths)) + ### Nested Schema for `options_allowlist.paths` Read-Only: - `value` (String) - - + ### Nested Schema for `password_protection` Read-Only: - `deployment_type` (String) The deployment environment that will be protected. - + ### Nested Schema for `resource_config` Read-Only: @@ -165,8 +168,8 @@ Read-Only: - `function_default_cpu_type` (String) The amount of CPU available to your Serverless Functions. Should be one of 'standard_legacy' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs). - `function_default_timeout` (Number) The default timeout for Serverless Functions. - + ### Nested Schema for `trusted_ips` Read-Only: @@ -176,6 +179,7 @@ Read-Only: - `protection_mode` (String) Whether or not Trusted IPs is required or optional to access a deployment. + ### Nested Schema for `trusted_ips.addresses` Read-Only: @@ -183,9 +187,8 @@ Read-Only: - `note` (String) - `value` (String) - - + ### Nested Schema for `vercel_authentication` Read-Only: diff --git a/docs/resources/project.md b/docs/resources/project.md index 9eedbc8b..55770b21 100644 --- a/docs/resources/project.md +++ b/docs/resources/project.md @@ -47,6 +47,7 @@ resource "vercel_project" "example" { ``` + ## Schema ### Required @@ -76,6 +77,7 @@ resource "vercel_project" "example" { - `node_version` (String) The version of Node.js that is used in the Build Step and for Serverless Functions. A new Deployment is required for your changes to take effect. - `oidc_token_config` (Attributes) Configuration for OpenID Connect (OIDC) tokens. (see [below for nested schema](#nestedatt--oidc_token_config)) - `on_demand_concurrent_builds` (Boolean) Instantly scale build capacity to skip the queue, even if all build slots are in use. You can also choose a larger build machine; charges apply per minute if it exceeds your team's default. +- `build_machine_type` (String) The build machine type to use for this project. Must be one of "standard", "enhanced". - `options_allowlist` (Attributes) Disable Deployment Protection for CORS preflight `OPTIONS` requests for a list of paths. (see [below for nested schema](#nestedatt--options_allowlist)) - `output_directory` (String) The output directory of the project. If omitted, this value will be automatically detected. - `password_protection` (Attributes) Ensures visitors of your Preview Deployments must enter a password in order to gain access. (see [below for nested schema](#nestedatt--password_protection)) @@ -97,6 +99,7 @@ resource "vercel_project" "example" { - `id` (String) The ID of this resource. + ### Nested Schema for `environment` Required: @@ -116,8 +119,8 @@ Read-Only: - `id` (String) The ID of the Environment Variable. - + ### Nested Schema for `git_comments` Required: @@ -125,8 +128,8 @@ Required: - `on_commit` (Boolean) Whether Commit comments are enabled - `on_pull_request` (Boolean) Whether Pull Request comments are enabled - + ### Nested Schema for `git_repository` Required: @@ -140,6 +143,7 @@ Optional: - `production_branch` (String) By default, every commit pushed to the main branch will trigger a Production Deployment instead of the usual Preview Deployment. You can switch to a different branch here. + ### Nested Schema for `git_repository.deploy_hooks` Required: @@ -152,9 +156,8 @@ Read-Only: - `id` (String) The ID of the deploy hook. - `url` (String, Sensitive) A URL that, when a POST request is made to, will trigger a new deployment. - - + ### Nested Schema for `oidc_token_config` Optional: @@ -162,8 +165,8 @@ Optional: - `enabled` (Boolean, Deprecated) When true, Vercel issued OpenID Connect (OIDC) tokens will be available on the compute environments. See https://vercel.com/docs/security/secure-backend-access/oidc for more information. - `issuer_mode` (String) Configures the URL of the `iss` claim. `team` = `https://oidc.vercel.com/[team_slug]` `global` = `https://oidc.vercel.com` - + ### Nested Schema for `options_allowlist` Required: @@ -171,15 +174,15 @@ Required: - `paths` (Attributes Set) The allowed paths for the OPTIONS Allowlist. Incoming requests will bypass Deployment Protection if they have the method `OPTIONS` and **start with** one of the path values. (see [below for nested schema](#nestedatt--options_allowlist--paths)) + ### Nested Schema for `options_allowlist.paths` Required: - `value` (String) The path prefix to compare with the incoming request path. - - + ### Nested Schema for `password_protection` Required: @@ -187,8 +190,8 @@ Required: - `deployment_type` (String) The deployment environment to protect. Must be one of `standard_protection`, `all_deployments`, or `only_preview_deployments`. - `password` (String, Sensitive) The password that visitors must enter to gain access to your Preview Deployments. Drift detection is not possible for this field. - + ### Nested Schema for `resource_config` Optional: @@ -197,8 +200,8 @@ Optional: - `function_default_cpu_type` (String) The amount of CPU available to your Serverless Functions. Should be one of 'standard_legacy' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs). - `function_default_timeout` (Number) The default timeout for Serverless Functions. - + ### Nested Schema for `trusted_ips` Required: @@ -211,6 +214,7 @@ Optional: - `protection_mode` (String) Whether or not Trusted IPs is optional to access a deployment. Must be either `trusted_ip_required` or `trusted_ip_optional`. `trusted_ip_optional` is only available with Standalone Trusted IPs. + ### Nested Schema for `trusted_ips.addresses` Required: @@ -221,9 +225,8 @@ Optional: - `note` (String) A description for the value - - + ### Nested Schema for `vercel_authentication` Required: diff --git a/vercel/data_source_project.go b/vercel/data_source_project.go index 5c41af71..38673627 100644 --- a/vercel/data_source_project.go +++ b/vercel/data_source_project.go @@ -394,6 +394,14 @@ For more detailed information, please see the [Vercel documentation](https://ver Optional: true, Computed: true, }, + "build_machine_type": schema.StringAttribute{ + Description: "The build machine type to use for this project. Must be one of \"standard\", \"enhanced\".", + Optional: true, + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOf("standard", "enhanced"), + }, + }, }, } } @@ -438,6 +446,7 @@ type ProjectDataSource struct { ResourceConfig types.Object `tfsdk:"resource_config"` NodeVersion types.String `tfsdk:"node_version"` OnDemandConcurrentBuilds types.Bool `tfsdk:"on_demand_concurrent_builds"` + BuildMachineTYpe types.String `tfsdk:"build_machine_type"` } func convertResponseToProjectDataSource(ctx context.Context, response client.ProjectResponse, plan Project, environmentVariables []client.EnvironmentVariable) (ProjectDataSource, error) { @@ -504,6 +513,7 @@ func convertResponseToProjectDataSource(ctx context.Context, response client.Pro ResourceConfig: project.ResourceConfig, NodeVersion: project.NodeVersion, OnDemandConcurrentBuilds: project.OnDemandConcurrentBuilds, + BuildMachineTYpe: project.BuildMachineType, }, nil } diff --git a/vercel/data_source_project_test.go b/vercel/data_source_project_test.go index c38054b0..3c9fbe29 100644 --- a/vercel/data_source_project_test.go +++ b/vercel/data_source_project_test.go @@ -59,6 +59,7 @@ func TestAcc_ProjectDataSource(t *testing.T) { resource.TestCheckResourceAttr("data.vercel_project.test", "oidc_token_config.enabled", "true"), resource.TestCheckResourceAttr("data.vercel_project.test", "oidc_token_config.issuer_mode", "team"), resource.TestCheckResourceAttr("data.vercel_project.test", "on_demand_concurrent_builds", "true"), + resource.TestCheckResourceAttr("data.vercel_project.test", "build_machine_type", "enhanced"), ), }, }, @@ -141,6 +142,7 @@ resource "vercel_project" "test" { issuer_mode = "team" } on_demand_concurrent_builds = true + build_machine_type = "enhanced" } data "vercel_project" "test" { diff --git a/vercel/resource_project.go b/vercel/resource_project.go index 77b93548..d2ebe395 100644 --- a/vercel/resource_project.go +++ b/vercel/resource_project.go @@ -583,6 +583,14 @@ At this time you cannot use a Vercel Project resource with in-line ` + "`environ Computed: true, PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()}, }, + "build_machine_type": schema.StringAttribute{ + Description: "The build machine type to use for this project. Must be one of \"standard\", \"enhanced\".", + Optional: true, + Computed: true, + Validators: []validator.String{ + stringvalidator.OneOf("standard", "enhanced"), + }, + }, }, } } @@ -635,6 +643,7 @@ type Project struct { SkewProtection types.String `tfsdk:"skew_protection"` ResourceConfig types.Object `tfsdk:"resource_config"` OnDemandConcurrentBuilds types.Bool `tfsdk:"on_demand_concurrent_builds"` + BuildMachineType types.String `tfsdk:"build_machine_type"` } type GitComments struct { @@ -754,7 +763,7 @@ func (p *Project) toCreateProjectRequest(ctx context.Context, envs []Environment PublicSource: p.PublicSource.ValueBoolPointer(), RootDirectory: p.RootDirectory.ValueStringPointer(), ServerlessFunctionRegion: p.ServerlessFunctionRegion.ValueString(), - ResourceConfig: resourceConfig.toClientResourceConfig(p.OnDemandConcurrentBuilds), + ResourceConfig: resourceConfig.toClientResourceConfig(p.OnDemandConcurrentBuilds, p.BuildMachineType), EnablePreviewFeedback: oneBoolPointer(p.EnablePreviewFeedback, p.PreviewComments), EnableProductionFeedback: p.EnableProductionFeedback.ValueBoolPointer(), }, diags @@ -835,7 +844,7 @@ func (p *Project) toUpdateProjectRequest(ctx context.Context, oldName string) (r DirectoryListing: p.DirectoryListing.ValueBool(), SkewProtectionMaxAge: toSkewProtectionAge(p.SkewProtection), GitComments: gc.toUpdateProjectRequest(), - ResourceConfig: resourceConfig.toClientResourceConfig(p.OnDemandConcurrentBuilds), + ResourceConfig: resourceConfig.toClientResourceConfig(p.OnDemandConcurrentBuilds, p.BuildMachineType), NodeVersion: p.NodeVersion.ValueString(), }, nil } @@ -1087,7 +1096,7 @@ func (p *Project) resourceConfig(ctx context.Context) (rc *ResourceConfig, diags return rc, diags } -func (r *ResourceConfig) toClientResourceConfig(onDemandConcurrentBuilds types.Bool) *client.ResourceConfig { +func (r *ResourceConfig) toClientResourceConfig(onDemandConcurrentBuilds types.Bool, buildMachineType types.String) *client.ResourceConfig { if r == nil { return nil } @@ -1105,6 +1114,9 @@ func (r *ResourceConfig) toClientResourceConfig(onDemandConcurrentBuilds types.B if !onDemandConcurrentBuilds.IsUnknown() { resourceConfig.ElasticConcurrencyEnabled = onDemandConcurrentBuilds.ValueBoolPointer() } + if !buildMachineType.IsUnknown() { + resourceConfig.BuildMachineType = buildMachineType.ValueStringPointer() + } return resourceConfig } @@ -1476,6 +1488,7 @@ func convertResponseToProject(ctx context.Context, response client.ProjectRespon ResourceConfig: resourceConfig, NodeVersion: types.StringValue(response.NodeVersion), OnDemandConcurrentBuilds: types.BoolValue(response.ResourceConfig.ElasticConcurrencyEnabled), + BuildMachineType: types.StringValue(response.ResourceConfig.BuildMachineType), }, nil } diff --git a/vercel/resource_project_test.go b/vercel/resource_project_test.go index 8be8cfc8..f0c8d430 100644 --- a/vercel/resource_project_test.go +++ b/vercel/resource_project_test.go @@ -83,6 +83,7 @@ func TestAcc_Project(t *testing.T) { resource.TestCheckResourceAttr("vercel_project.test", "resource_config.function_default_cpu_type", "standard"), resource.TestCheckResourceAttr("vercel_project.test", "resource_config.function_default_timeout", "60"), resource.TestCheckResourceAttr("vercel_project.test", "on_demand_concurrent_builds", "true"), + resource.TestCheckResourceAttr("vercel_project.test", "build_machine_type", "enhanced"), ), }, // Update testing @@ -100,6 +101,7 @@ func TestAcc_Project(t *testing.T) { resource.TestCheckResourceAttr("vercel_project.test", "enable_preview_feedback", "false"), resource.TestCheckResourceAttr("vercel_project.test", "enable_production_feedback", "true"), resource.TestCheckResourceAttr("vercel_project.test", "on_demand_concurrent_builds", "false"), + resource.TestCheckResourceAttr("vercel_project.test", "build_machine_type", "standard"), ), }, // Test mutual exclusivity validation @@ -1066,6 +1068,7 @@ resource "vercel_project" "test" { } ] on_demand_concurrent_builds = true + build_machine_type = "enhanced" } `, projectSuffix) } From 23bcfaca14470709219ae7ecf678a3ec0c9c9961 Mon Sep 17 00:00:00 2001 From: Luke Phillips-Sheard Date: Thu, 12 Jun 2025 10:19:52 +0100 Subject: [PATCH 2/5] [docs] Run `task docs` --- docs/data-sources/project.md | 26 ++++++++++++-------------- docs/resources/project.md | 26 ++++++++++++-------------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/docs/data-sources/project.md b/docs/data-sources/project.md index d56603f3..d4c0c944 100644 --- a/docs/data-sources/project.md +++ b/docs/data-sources/project.md @@ -25,7 +25,6 @@ data "vercel_project" "example" { ``` - ## Schema ### Required @@ -34,8 +33,8 @@ data "vercel_project" "example" { ### Optional -- `on_demand_concurrent_builds` (Boolean) Instantly scale build capacity to skip the queue, even if all build slots are in use. You can also choose a larger build machine; charges apply per minute if it exceeds your team's default. - `build_machine_type` (String) The build machine type to use for this project. Must be one of "standard", "enhanced". +- `on_demand_concurrent_builds` (Boolean) Instantly scale build capacity to skip the queue, even if all build slots are in use. You can also choose a larger build machine; charges apply per minute if it exceeds your team's default. - `team_id` (String) The team ID the project exists beneath. Required when configuring a team resource if a default team has not been set in the provider. ### Read-Only @@ -77,7 +76,6 @@ data "vercel_project" "example" { - `vercel_authentication` (Attributes) Ensures visitors to your Preview Deployments are logged into Vercel and have a minimum of Viewer access on your team. (see [below for nested schema](#nestedatt--vercel_authentication)) - ### Nested Schema for `environment` Read-Only: @@ -91,8 +89,8 @@ Read-Only: - `target` (Set of String) The environments that the environment variable should be present on. Valid targets are either `production`, `preview`, or `development`. - `value` (String) The value of the environment variable. - + ### Nested Schema for `git_comments` Required: @@ -100,8 +98,8 @@ Required: - `on_commit` (Boolean) Whether Commit comments are enabled - `on_pull_request` (Boolean) Whether Pull Request comments are enabled - + ### Nested Schema for `git_repository` Read-Only: @@ -112,7 +110,6 @@ Read-Only: - `type` (String) The git provider of the repository. Must be either `github`, `gitlab`, or `bitbucket`. - ### Nested Schema for `git_repository.deploy_hooks` Read-Only: @@ -122,8 +119,9 @@ Read-Only: - `ref` (String) The branch or commit hash that should be deployed. - `url` (String, Sensitive) A URL that, when a POST request is made to, will trigger a new deployment. - + + ### Nested Schema for `oidc_token_config` Optional: @@ -134,8 +132,8 @@ Read-Only: - `enabled` (Boolean, Deprecated) When true, Vercel issued OpenID Connect (OIDC) tokens will be available on the compute environments. See https://vercel.com/docs/security/secure-backend-access/oidc for more information. - + ### Nested Schema for `options_allowlist` Read-Only: @@ -143,23 +141,23 @@ Read-Only: - `paths` (List of Object) The allowed paths for the OPTIONS Allowlist. Incoming requests will bypass Deployment Protection if they have the method `OPTIONS` and **start with** one of the path values. (see [below for nested schema](#nestedatt--options_allowlist--paths)) - ### Nested Schema for `options_allowlist.paths` Read-Only: - `value` (String) - + + ### Nested Schema for `password_protection` Read-Only: - `deployment_type` (String) The deployment environment that will be protected. - + ### Nested Schema for `resource_config` Read-Only: @@ -168,8 +166,8 @@ Read-Only: - `function_default_cpu_type` (String) The amount of CPU available to your Serverless Functions. Should be one of 'standard_legacy' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs). - `function_default_timeout` (Number) The default timeout for Serverless Functions. - + ### Nested Schema for `trusted_ips` Read-Only: @@ -179,7 +177,6 @@ Read-Only: - `protection_mode` (String) Whether or not Trusted IPs is required or optional to access a deployment. - ### Nested Schema for `trusted_ips.addresses` Read-Only: @@ -187,8 +184,9 @@ Read-Only: - `note` (String) - `value` (String) - + + ### Nested Schema for `vercel_authentication` Read-Only: diff --git a/docs/resources/project.md b/docs/resources/project.md index 55770b21..bff4bb6e 100644 --- a/docs/resources/project.md +++ b/docs/resources/project.md @@ -47,7 +47,6 @@ resource "vercel_project" "example" { ``` - ## Schema ### Required @@ -59,6 +58,7 @@ resource "vercel_project" "example" { - `auto_assign_custom_domains` (Boolean) Automatically assign custom production domains after each Production deployment via merge to the production branch or Vercel CLI deploy with --prod. Defaults to `true` - `automatically_expose_system_environment_variables` (Boolean) Vercel provides a set of Environment Variables that are automatically populated by the System, such as the URL of the Deployment or the name of the Git branch deployed. To expose them to your Deployments, enable this field - `build_command` (String) The build command for this project. If omitted, this value will be automatically detected. +- `build_machine_type` (String) The build machine type to use for this project. Must be one of "standard", "enhanced". - `customer_success_code_visibility` (Boolean) Allows Vercel Customer Support to inspect all Deployments' source code in this project to assist with debugging. - `dev_command` (String) The dev command for this project. If omitted, this value will be automatically detected. - `directory_listing` (Boolean) If no index file is present within a directory, the directory contents will be displayed. @@ -77,7 +77,6 @@ resource "vercel_project" "example" { - `node_version` (String) The version of Node.js that is used in the Build Step and for Serverless Functions. A new Deployment is required for your changes to take effect. - `oidc_token_config` (Attributes) Configuration for OpenID Connect (OIDC) tokens. (see [below for nested schema](#nestedatt--oidc_token_config)) - `on_demand_concurrent_builds` (Boolean) Instantly scale build capacity to skip the queue, even if all build slots are in use. You can also choose a larger build machine; charges apply per minute if it exceeds your team's default. -- `build_machine_type` (String) The build machine type to use for this project. Must be one of "standard", "enhanced". - `options_allowlist` (Attributes) Disable Deployment Protection for CORS preflight `OPTIONS` requests for a list of paths. (see [below for nested schema](#nestedatt--options_allowlist)) - `output_directory` (String) The output directory of the project. If omitted, this value will be automatically detected. - `password_protection` (Attributes) Ensures visitors of your Preview Deployments must enter a password in order to gain access. (see [below for nested schema](#nestedatt--password_protection)) @@ -99,7 +98,6 @@ resource "vercel_project" "example" { - `id` (String) The ID of this resource. - ### Nested Schema for `environment` Required: @@ -119,8 +117,8 @@ Read-Only: - `id` (String) The ID of the Environment Variable. - + ### Nested Schema for `git_comments` Required: @@ -128,8 +126,8 @@ Required: - `on_commit` (Boolean) Whether Commit comments are enabled - `on_pull_request` (Boolean) Whether Pull Request comments are enabled - + ### Nested Schema for `git_repository` Required: @@ -143,7 +141,6 @@ Optional: - `production_branch` (String) By default, every commit pushed to the main branch will trigger a Production Deployment instead of the usual Preview Deployment. You can switch to a different branch here. - ### Nested Schema for `git_repository.deploy_hooks` Required: @@ -156,8 +153,9 @@ Read-Only: - `id` (String) The ID of the deploy hook. - `url` (String, Sensitive) A URL that, when a POST request is made to, will trigger a new deployment. - + + ### Nested Schema for `oidc_token_config` Optional: @@ -165,8 +163,8 @@ Optional: - `enabled` (Boolean, Deprecated) When true, Vercel issued OpenID Connect (OIDC) tokens will be available on the compute environments. See https://vercel.com/docs/security/secure-backend-access/oidc for more information. - `issuer_mode` (String) Configures the URL of the `iss` claim. `team` = `https://oidc.vercel.com/[team_slug]` `global` = `https://oidc.vercel.com` - + ### Nested Schema for `options_allowlist` Required: @@ -174,15 +172,15 @@ Required: - `paths` (Attributes Set) The allowed paths for the OPTIONS Allowlist. Incoming requests will bypass Deployment Protection if they have the method `OPTIONS` and **start with** one of the path values. (see [below for nested schema](#nestedatt--options_allowlist--paths)) - ### Nested Schema for `options_allowlist.paths` Required: - `value` (String) The path prefix to compare with the incoming request path. - + + ### Nested Schema for `password_protection` Required: @@ -190,8 +188,8 @@ Required: - `deployment_type` (String) The deployment environment to protect. Must be one of `standard_protection`, `all_deployments`, or `only_preview_deployments`. - `password` (String, Sensitive) The password that visitors must enter to gain access to your Preview Deployments. Drift detection is not possible for this field. - + ### Nested Schema for `resource_config` Optional: @@ -200,8 +198,8 @@ Optional: - `function_default_cpu_type` (String) The amount of CPU available to your Serverless Functions. Should be one of 'standard_legacy' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs). - `function_default_timeout` (Number) The default timeout for Serverless Functions. - + ### Nested Schema for `trusted_ips` Required: @@ -214,7 +212,6 @@ Optional: - `protection_mode` (String) Whether or not Trusted IPs is optional to access a deployment. Must be either `trusted_ip_required` or `trusted_ip_optional`. `trusted_ip_optional` is only available with Standalone Trusted IPs. - ### Nested Schema for `trusted_ips.addresses` Required: @@ -225,8 +222,9 @@ Optional: - `note` (String) A description for the value - + + ### Nested Schema for `vercel_authentication` Required: From f3f7d35618d92ab5a565267b6529b5677d6f9a80 Mon Sep 17 00:00:00 2001 From: Luke Phillips-Sheard Date: Fri, 13 Jun 2025 07:20:23 +0100 Subject: [PATCH 3/5] Remove "standard" build_machine_type optio --- docs/data-sources/project.md | 2 +- docs/resources/project.md | 2 +- vercel/data_source_project.go | 5 +---- vercel/resource_project.go | 9 +++++---- vercel/resource_project_test.go | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/data-sources/project.md b/docs/data-sources/project.md index d4c0c944..c6cc396b 100644 --- a/docs/data-sources/project.md +++ b/docs/data-sources/project.md @@ -33,7 +33,7 @@ data "vercel_project" "example" { ### Optional -- `build_machine_type` (String) The build machine type to use for this project. Must be one of "standard", "enhanced". +- `build_machine_type` (String) The build machine type to use for this project. - `on_demand_concurrent_builds` (Boolean) Instantly scale build capacity to skip the queue, even if all build slots are in use. You can also choose a larger build machine; charges apply per minute if it exceeds your team's default. - `team_id` (String) The team ID the project exists beneath. Required when configuring a team resource if a default team has not been set in the provider. diff --git a/docs/resources/project.md b/docs/resources/project.md index bff4bb6e..cac30915 100644 --- a/docs/resources/project.md +++ b/docs/resources/project.md @@ -58,7 +58,7 @@ resource "vercel_project" "example" { - `auto_assign_custom_domains` (Boolean) Automatically assign custom production domains after each Production deployment via merge to the production branch or Vercel CLI deploy with --prod. Defaults to `true` - `automatically_expose_system_environment_variables` (Boolean) Vercel provides a set of Environment Variables that are automatically populated by the System, such as the URL of the Deployment or the name of the Git branch deployed. To expose them to your Deployments, enable this field - `build_command` (String) The build command for this project. If omitted, this value will be automatically detected. -- `build_machine_type` (String) The build machine type to use for this project. Must be one of "standard", "enhanced". +- `build_machine_type` (String) The build machine type to use for this project. Must be one of "enhanced". - `customer_success_code_visibility` (Boolean) Allows Vercel Customer Support to inspect all Deployments' source code in this project to assist with debugging. - `dev_command` (String) The dev command for this project. If omitted, this value will be automatically detected. - `directory_listing` (Boolean) If no index file is present within a directory, the directory contents will be displayed. diff --git a/vercel/data_source_project.go b/vercel/data_source_project.go index 38673627..107724bc 100644 --- a/vercel/data_source_project.go +++ b/vercel/data_source_project.go @@ -395,12 +395,9 @@ For more detailed information, please see the [Vercel documentation](https://ver Computed: true, }, "build_machine_type": schema.StringAttribute{ - Description: "The build machine type to use for this project. Must be one of \"standard\", \"enhanced\".", + Description: "The build machine type to use for this project.", Optional: true, Computed: true, - Validators: []validator.String{ - stringvalidator.OneOf("standard", "enhanced"), - }, }, }, } diff --git a/vercel/resource_project.go b/vercel/resource_project.go index d2ebe395..9c2927f1 100644 --- a/vercel/resource_project.go +++ b/vercel/resource_project.go @@ -584,11 +584,12 @@ At this time you cannot use a Vercel Project resource with in-line ` + "`environ PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()}, }, "build_machine_type": schema.StringAttribute{ - Description: "The build machine type to use for this project. Must be one of \"standard\", \"enhanced\".", - Optional: true, - Computed: true, + Description: "The build machine type to use for this project. Must be one of \"enhanced\".", + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, Validators: []validator.String{ - stringvalidator.OneOf("standard", "enhanced"), + stringvalidator.OneOf("enhanced"), }, }, }, diff --git a/vercel/resource_project_test.go b/vercel/resource_project_test.go index f0c8d430..0abe0775 100644 --- a/vercel/resource_project_test.go +++ b/vercel/resource_project_test.go @@ -101,7 +101,7 @@ func TestAcc_Project(t *testing.T) { resource.TestCheckResourceAttr("vercel_project.test", "enable_preview_feedback", "false"), resource.TestCheckResourceAttr("vercel_project.test", "enable_production_feedback", "true"), resource.TestCheckResourceAttr("vercel_project.test", "on_demand_concurrent_builds", "false"), - resource.TestCheckResourceAttr("vercel_project.test", "build_machine_type", "standard"), + resource.TestCheckNoResourceAttr("vercel_project.test", "build_machine_type"), ), }, // Test mutual exclusivity validation From 9a3fb1deb6997c3f101e3190a7f38329ec150a96 Mon Sep 17 00:00:00 2001 From: Luke Phillips-Sheard Date: Fri, 13 Jun 2025 10:34:40 +0100 Subject: [PATCH 4/5] do not use state for unknown --- vercel/resource_project.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vercel/resource_project.go b/vercel/resource_project.go index 9c2927f1..e626b5cd 100644 --- a/vercel/resource_project.go +++ b/vercel/resource_project.go @@ -584,10 +584,9 @@ At this time you cannot use a Vercel Project resource with in-line ` + "`environ PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()}, }, "build_machine_type": schema.StringAttribute{ - Description: "The build machine type to use for this project. Must be one of \"enhanced\".", - Optional: true, - Computed: true, - PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()}, + Description: "The build machine type to use for this project. Must be one of \"enhanced\".", + Optional: true, + Computed: true, Validators: []validator.String{ stringvalidator.OneOf("enhanced"), }, From 7bd65ee083fabdcc061286037a7e28efe0dcef62 Mon Sep 17 00:00:00 2001 From: Luke Phillips-Sheard Date: Fri, 13 Jun 2025 13:52:20 +0100 Subject: [PATCH 5/5] see what the value is --- vercel/resource_project_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vercel/resource_project_test.go b/vercel/resource_project_test.go index 0abe0775..2437d54f 100644 --- a/vercel/resource_project_test.go +++ b/vercel/resource_project_test.go @@ -101,7 +101,7 @@ func TestAcc_Project(t *testing.T) { resource.TestCheckResourceAttr("vercel_project.test", "enable_preview_feedback", "false"), resource.TestCheckResourceAttr("vercel_project.test", "enable_production_feedback", "true"), resource.TestCheckResourceAttr("vercel_project.test", "on_demand_concurrent_builds", "false"), - resource.TestCheckNoResourceAttr("vercel_project.test", "build_machine_type"), + resource.TestCheckResourceAttr("vercel_project.test", "build_machine_type", ""), ), }, // Test mutual exclusivity validation