Terraform
Manage projects
This topic describes how to create and manage projects in HCP Terraform and Terraform Enterprise. A project is a folder containing one or more workspaces.
Requirements
You must have the following permissions to manage projects:
- You must be a member of a team with the Manage all Projects permissions enabled to create a project. Refer to Organization Permissions for additional information.
- You must be a member of a team with the Visible option enabled under Visibility in the organization settings to configure a new team's access to the project. Refer to Team Visibility for additional information.
- You must be a member of a team with update and delete permissions to be able to update and delete teams respectively.
To delete tags on a project, you must be member of a team with the Admin permission group enabled for the project.
To create tags for a project, you must be member of a team with the Write permission group enabled for the project.
View a project
To view your organization's projects:
- Click Projects.
- Search for a project that you want to view. You can use the following methods:
- Sort by column header.
- Use the search bar to search on the name of a project or a tag.
- Click on a project's name to view more details.
Create a project
Click Projects.
Click + New project.
Specify a name for the project. The name must be unique within the organization and can only include letters, numbers, inner spaces, hyphens, and underscores.
Add a description for the project. This field is optional.
Adding project tags is in private beta and unavailable for some users. Skip to step 8 if your interface does not include elements for adding tags. Contact your HashiCorp representative for information about participating in the private beta.
Open the Add key value tags menu to add tags to your project. Tags are optional key-value pairs that you can use to organize projects. Any workspaces you create within the project inherit project tags. Refer to Define project tags for additional information.
Click +Add tag and specify a tag key and tag value. If your organization has defined reserved tag keys, they appear in the Tag key field as suggestions. Refer to Create and manage reserved tags for additional information.
Click +add another tag to attach any additional tags.
Click Create to finish creating the project.
HCP Terraform returns a new project page displaying all the project information.
Edit a project
- Click Projects.
- Click on a project name of the project you want to edit.
- Click Settings.
On this General settings page, you can update the project name, project description, and delete the project. On the Team access page, you can modify team access to the project.
Automatically destroy inactive workspaces
Note: Ephemeral workspace (automatic destroy runs) functionality is available in HCP Terraform Plus Edition. Refer to HCP Terraform pricing for details.
You can configure HCP Terraform to automatically destroy each workspace's infrastructure in a project after a period of inactivity. A workspace is inactive if the workspace's state has not changed within your designated time period.
If you configure a project to auto-destroy its infrastructure when inactive, any run that updates Terraform state further delays the scheduled auto-destroy time by the length of your designated timeframe.
Warning: Automatic destroy plans do not prompt you for apply approval in the HCP Terraform user interface. We recommend only using this setting for development environments.
To schedule an auto-destroy run after a period of workspace inactivity:
- Navigate to the project's Settings > Auto-destroy Workspaces page.
- Click Set up default.
- Select or customize a desired timeframe of inactivity.
- Click Confirm default.
You can configure an individual workspace's auto-destroy settings to override this default configuration. Refer to automatically destroy workspaces for more information.
Delete a project
You can only delete projects that do not contain workspaces.
To delete an empty project:
- Click Projects.
- Search for a project that you want to review by scrolling down the table or searching for a project name in the search bar above the project table.
- Click Settings. The settings view for the selected project appears.
- Click the Delete button. A Delete project modal appears.
- Click the Delete button to confirm the deletion.
HCP Terraform returns to the Projects view with the deleted project removed from the list.
Define project tags
Adding project tags is in private beta and unavailable for some users. Contact your HashiCorp representative for information about participating in the private beta.
You can define tags stored as key-value pairs to help you organize your projects and track resource consumption. HCP Terraform applies tags that you attach to projects to the workspaces created inside the project.
Workspace administrators with appropriate permissions can attach new key-value pairs to their workspaces to override inherited tags. Refer to Create workspace tags for additional information about using tags in workspaces.
Tags that you create appear in the tags management screen in the organization settings. Refer to Organizations for additional information.
The following rules apply to tag keys and values:
- Tags must be one or more characters.
- Tags have a 255 character limit.
- Tags can include letters, numbers, colons, hyphens, and underscores.
- Tag values are optional.
- You can create up to 10 unique tags per workspace and 10 unique tags per project. As a result, each workspace can have up to 20 tags.
- You cannot use the following strings at the beginning of a tag key: