Administrators create application templates to help ensure that their preferred architecture is used by each development team. This helps you govern the resources and configurations that developers use in their application deployments.
Once you create an application template, it is available to others in your space. You can also add a template to a catalog to share with other spaces.
Developers can use your application template to create an application instance. When developers create an instance, they can configure each component from the template, but they can't add or remove any components. The template generates Terraform code, which developers can download or deploy from App Design Center.
Before you begin
You must have one of the following roles:
- Application Design Center Admin (
roles/designcenter.admin
) - Application Design Center User (
roles/designcenter.user
)
Create an application template
Create application templates to share your architecture design with development teams. You can create a template from scratch or start from an existing template that was created by Google. You can add the following components to your template design:
Assets: High-level resources that help you control other resources. For example, service accounts.
Services: Network or API interfaces that are consumed over the network. Examples include Cloud Storage and Vertex AI.
Workloads: Binary deployments that perform business functions. Examples include Cloud Run and Compute Engine.
As you design your template, Terraform code is generated to reflect the design and configuration details.
Specify template details
Template details help you categorize your template and help developers decide whether to use your template. You can also specify default configuration values for application instances.
To enter details for your template, do the following:
From the navigation menu, click Templates.
Click Create template.
In the Template name field, enter a unique identifier for the template. This field is required.
In the Display name field, enter an identifier to display in the Google Cloud console.
In the Description field, enter a brief explanation of the application's purpose.
To specify default configuration values for application instances, enter the following:
From the Environment list, select the environment where you want to deploy this instance. For example, you might want to verify that your deployment works as expected in TEST.
From the Criticality list, select the degree of impact on your business. For example, Low or High.
To specify owners, click Add owner and enter a Display name and email for each of the following:
In the Business owners area, enter an owner who is responsible for quality and user expectations.
In the Developer owners area, enter an owner who is responsible for development and coding.
In the Operator owners area, enter an owner who is responsible for operating the application.
Click Create template. The design canvas is displayed.
Design your template
You can design your template by adding components to the canvas. You can start from a blank canvas or import a Google provided template as a starting point.
To design your template, do the following:
- From the design canvas, make sure Design is selected.
- To start from an existing template, click the template name in the canvas. The canvas is updated to reflect the template.
- From the Components area, click a component to add it to the canvas area.
- To create a communication channel between components, drag from a blue dot at the top or bottom of a component to a blue dot on another component. A line between the two components is created.
- To remove a component or connection, do the following:
- In the canvas, click the component or connection.
- In the Configuration area, click Delete.
- In the field, enter delete.
- Click Delete.
Configure components
For each asset, service or workload that you add to the canvas, specify configuration details such as name, project where the resource is created, and location. The configuration details that you specify in the template are used as default values for application instances.
- From the design canvas, click a component.
- In the Configuration area, from the Project ID list, select the project where you want to deploy the resource.
Configure settings for the resource. For example, for Cloud SQL, you might configure the following:
- Region
- Backup configuration
- Database flags
- IP configuration
For links to configuration documentation for each component, see Supported resources.
Click Save.
View Terraform code
As you design your application template, Terraform code is generated to reflect the design and configuration details. To view the Terraform code, do the following:
From the design canvas, click Code. The generated Terraform files are displayed.
In the Explorer area, click main.tf. The Terraform module for each component is displayed.
Delete a Template
If you no longer need a template, you can delete it.
- From the design canvas, click Actions.
- Click Delete.
Verify your template
Before you share your template with developers, make sure that it functions as you intended. To verify your template, do the following:
- Create an application
instance with
the following settings:
- From the Environment list, select TEST.
- From the Criticality list, select LOW.
- Deploy the instance. For steps to deploy an application instance, see Deploy an application instance.
- Test your infrastructure to make sure that it meets your requirements.
- To avoid recurring costs, delete the test deployment.
Share a template to a catalog
Once you have verified your template, you can publish the template to a catalog. The template can be used by application developers who have access to a space where the catalog is shared.
- From the design canvas, click Add to Catalog.
- To manage spaces where the catalog is shared, see Manage catalogs.
Revise and reshare your template
As you gain experience with your application and your business needs evolve, you might want to update your application template. For example, you might decide to improve performance for a backend service by adding a Memorystore service for caching.
If you make changes to a template, those changes are not automatically published to the catalog. To share the latest revision, publish the template to the catalog again.
To create a new revision, do the following:
From the navigation menu, click Templates.
Select the application template that you want to revise. The canvas opens.
Modify the template to fit your new requirements. For example, add and configure a new component.
To share the latest revision with other spaces, add the template to relevant catalogs again.
What's next
To share templates with other spaces, create and share a catalog.
Before you deploy your application, create an application instance.