HashiCorp Cloud Platform
Create and manage templates
This page describes how to create and delete HCP Waypoint templates. Platform engineers often perform these tasks. Refer to Templates for additional information.
Overview
The following steps describe the procedure for creating templates:
- For each template you want to create, define a no-code module in HCP Terraform that specifies a common infrastructure pattern.
- Use the HCP Waypoint UI to create the template.
After creating a template, application developers can begin using it to deploy their applications.
Prerequisites
- An HCP account with HCP Waypoint enabled. Refer to HCP Account for information about creating an account.
- an HCP Terraform organization with Plus tier. HCP Terraform must be Plus tier to use HCP Terraform no-code modules and the private module registry.
Create a no-code module
Define the common infrastructure pattern in an HCP Terraform no-code module. Refer to Designing No-Code Ready Modules for instructions on how to create no-code modules.
You can also declare the waypoint_application
variable in your no-code module. The variable specifies the name of the HCP Waypoint application. HCP Waypoint defines this value when the application developer uses the template. Refer to Input Variables for instructions on how to define variables in Terraform.
You may need to create global variable sets within your HCP Terraform organization so your no-code modules can authenticate and interact with your cloud provider.
You can use the variable to label infrastructure resources in the no-code module so you can associate them with the HCP Waypoint application.
Create a template
After creating the no-code module, complete the following steps in the HCP Waypoint UI:
- From the HCP Waypoint overview, go to the Templates menu.
- Click Create a Template.
- Specify a unique identifier for the template in the Name field. The name can be up to 24 characters.
- Add a short description of the template in the Summary field. This field can be up to 110 characters. HCP Waypoint presents the description when users create a new application from a template.
- Choose a no-code module to use as the source for the template from the Terraform no-code module drop-down menu. No-code modules published in your organization's private registry appear in the menu.
- Choose a HCP Terraform Project.
- Enter a value for the input variables. Optionally, check the Enable this value to be defined when the application is created checkbox to choose a value when the addon is installed.
- Click Next.
- Add a full-length description of the template in the Description field. This field can be up ot 500 characters. HCP Waypoint presents the description in the template detail screen.
- Specify instructions for application developers on how to use the template in the Developer instructions field. HCP Waypoint exposes the following variables so you can reference them in the developer instructions. This field supports Markdown.
{{ .ApplicationName }}
: Populates the name of the developer's application in the instructions.{{ .TfcOrgName }}
: Populates the name of the HCP Terraform organization in the instructions.
- Specify arbitrary metadata as labels to associate with your template in the Labels field.
- Click Publish.
Edit a template
Modifying a template does not impact existing applications or underlying resources that were created by the template. Changes only apply to new applications.
To edit a template, complete the following steps:
- From the HCP Waypoint overview, click on the Templates menu.
- Click on the template you want to modify.
- Click the Manage button and choose Edit template.
- Update the desired fields.
- Click Save.
Delete a template
Deleting a template does not remove applications that were created from the template. To do so, you must delete the application in HCP Waypoint or delete the Terraform resources and the HCP Terraform workspace associated with the HCP Waypoint application. Refer to Destruction and Deletion for instructions.
To delete a template, complete the following steps:
- From the HCP Waypoint overview, click on the Templates menu.
- Click on the template you want to delete.
- Click the Manage button and choose Delete template.
- In the modal, enter "DELETE" and click Delete.
Next steps
To learn more about what you can do with HCP Waypoint after you created a template, refer to the following topics: