-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add resource for
project_environment_variables
This resource can manage many environment variables for a project together. This allows users to avoid hitting the API rate limits when using the terraform provider.
- Loading branch information
1 parent
551f0f4
commit b1370a3
Showing
12 changed files
with
560 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "vercel_project_environment_variables Resource - terraform-provider-vercel" | ||
subcategory: "" | ||
description: |- | ||
Provides a resource for managing a number of Project Environment Variables. | ||
This resource defines multiple Environment Variables on a Vercel Project. | ||
For more detailed information, please see the Vercel documentation https://vercel.com/docs/concepts/projects/environment-variables. | ||
~> Terraform currently provides this Project Environment Variables resource (multiple Environment Variables), a single Project Environment Variable Resource, and a Project resource with Environment Variables defined in-line via the environment field. | ||
At this time you cannot use a Vercel Project resource with in-line environment in conjunction with any vercel_project_environment_variables or vercel_project_environment_variable resources. Doing so will cause a conflict of settings and will overwrite Environment Variables. | ||
--- | ||
|
||
# vercel_project_environment_variables (Resource) | ||
|
||
Provides a resource for managing a number of Project Environment Variables. | ||
|
||
This resource defines multiple Environment Variables on a Vercel Project. | ||
|
||
For more detailed information, please see the [Vercel documentation](https://vercel.com/docs/concepts/projects/environment-variables). | ||
|
||
~> Terraform currently provides this Project Environment Variables resource (multiple Environment Variables), a single Project Environment Variable Resource, and a Project resource with Environment Variables defined in-line via the `environment` field. | ||
At this time you cannot use a Vercel Project resource with in-line `environment` in conjunction with any `vercel_project_environment_variables` or `vercel_project_environment_variable` resources. Doing so will cause a conflict of settings and will overwrite Environment Variables. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "vercel_project" "example" { | ||
name = "example-project" | ||
git_repository = { | ||
type = "github" | ||
repo = "vercel/some-repo" | ||
} | ||
} | ||
resource "vercel_project_environment_variables" "example" { | ||
project_id = vercel_project.test.id | ||
variables = [ | ||
{ | ||
key = "SOME_VARIABLE" | ||
value = "some_value" | ||
target = ["production", "preview"] | ||
}, | ||
{ | ||
key = "ANOTHER_VARIABLE" | ||
value = "another_value" | ||
git_branch = "staging" | ||
target = ["preview"] | ||
}, | ||
{ | ||
key = "SENSITIVE_VARIABLE" | ||
value = "sensitive_value" | ||
target = ["production"] | ||
sensitive = true | ||
} | ||
] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `project_id` (String) The ID of the Vercel project. | ||
- `variables` (Attributes Set) A set of Environment Variables that should be configured for the project. (see [below for nested schema](#nestedatt--variables)) | ||
|
||
### Optional | ||
|
||
- `team_id` (String) The ID of the Vercel team. Required when configuring a team resource if a default team has not been set in the provider. | ||
|
||
<a id="nestedatt--variables"></a> | ||
### Nested Schema for `variables` | ||
|
||
Required: | ||
|
||
- `key` (String) The name of the Environment Variable. | ||
- `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. | ||
|
||
Optional: | ||
|
||
- `comment` (String) A comment explaining what the environment variable is for. | ||
- `git_branch` (String) The git branch of the Environment Variable. | ||
- `sensitive` (Boolean) Whether the Environment Variable is sensitive or not. | ||
|
||
Read-Only: | ||
|
||
- `id` (String) The ID of the Environment Variable. |
31 changes: 31 additions & 0 deletions
31
examples/resources/vercel_project_environment_variables/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
resource "vercel_project" "example" { | ||
name = "example-project" | ||
|
||
git_repository = { | ||
type = "github" | ||
repo = "vercel/some-repo" | ||
} | ||
} | ||
|
||
resource "vercel_project_environment_variables" "example" { | ||
project_id = vercel_project.test.id | ||
variables = [ | ||
{ | ||
key = "SOME_VARIABLE" | ||
value = "some_value" | ||
target = ["production", "preview"] | ||
}, | ||
{ | ||
key = "ANOTHER_VARIABLE" | ||
value = "another_value" | ||
git_branch = "staging" | ||
target = ["preview"] | ||
}, | ||
{ | ||
key = "SENSITIVE_VARIABLE" | ||
value = "sensitive_value" | ||
target = ["production"] | ||
sensitive = true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.