This page describes how to model and package units of deployment for a SaaS offering. In SaaS Runtime, a unit of deployment is called a unit kind.
Create one unit kind for each component of the SaaS offering that you want to manage independently. For more details, see the following section Determine the model of the SaaS offering.
If desired, you can create a SaaS offering using a single unit kind for the entire SaaS offering.
Unit kinds are defined by a blueprint, which is a Terraform configuration packaged as an OCI image. Before creating a unit kind you need to have a blueprint created for each unit kind. For details about creating blueprints, see Create and upload a blueprint.
Before you begin
- Ensure you have defined a SaaS offering for your SaaS application.
- Ensure you have created an Artifact Registry repository.
- Ensure you have the service accounts with the required permissions. For details, see SaaS Runtime service accounts.
- For each unit kind you are creating, ensure you have a Terraform configuration and have prepared the blueprint. For details, see the following section Determine the model of the SaaS offering.
Determine the model of the SaaS offering
To model the SaaS offering, you need to determine how many unit kinds to create, and the relationship between these unit kinds.
For example, you might create two unit kinds: one unit kind for the infrastructure such as a VM, and one unit kind for the application deployed onto the infrastructure. If desired, you can create a SaaS offering using a single unit kind for the entire SaaS offering.
To decide how to model the SaaS offering using unit kinds, consider the following:
- Review the dependencies between components of the SaaS offering. For example, if a SaaS offering includes an application deployed onto a shared kubernetes cluster, then consider using a unit kind to model this shared cluster.
- Consider the release and maintenance cycle of the components of the SaaS offering. If there are components that are managed together, such as the infrastructure, then consider modeling these components with one unit kind.
Once you have determined this model, you need to create a blueprint for each unit kind. To do so, you need to:
- Identify the Terraform configuration to connect to this unit kind. For more details about the Terraform configurations needed, see Blueprints in SaaS Runtime.
- Ensure the Terraform configuration is packaged as an OCI image and pushed to the Artifact Registry, or is in a zip archive or Git repository. For more details, see Create and upload a blueprint.
When you have a blueprint for each unit kind, then you can follow the instructions on this page to create the unit kinds.
Create a unit kind
You can create a unit kind by using a Terraform configuration provided in the following ways:
- In a zip archive.
- In a Git repository.
- Packaged as an OCI image.
Create a unit kind using a zip archive
To create a unit kind using a Terraform configuration that is in a zip archive, complete the following instructions.
For details about preparing a zip archive, see Upload a zip archive.
To create a unit kind:
In the console, go to SaaS Runtime > Unit Kinds.
Select Create.
For Create blueprint, select Upload to upload a zip archive that contains the Terraform configuration.
Click Browse and find the zip archive with the Terraform configuration that defines the resources or application that is part of this unit kind.
Click Next: Configure blueprint.
On the page Store blueprint:
For Select repository from Artifact Registry, click Browse and select the repository you created.
For Artifact image name, enter a name for the OCI image.
For Infrastructure Manager terraform version, select the version of Terraform to use for deployments. For a list of supported Terraform versions, see Supported Terraform versions.
For the Cloud Build service account, select the service account that has the permissions to build the image. For details, see Artifact creation service account.
Click Next: Unit kind details.
On the page Configure unit kind properties, do the following:
For Unit kind name, enter a name for the unit kind. The name must contain only lowercase letters, numbers, or hyphens.
For SaaS Offering, select the SaaS offering that you want to associate with this unit kind.
For Dependencies:
If this is the first or only unit kind that you are creating for the SaaS offering, then don't add a dependency.
If you have created other other unit kinds that are dependent on this unit kind, then select Add deppendency.
For Unit kind, select the existing unit kind that is dependent on the unit kind that you are creating.
For Alias, type a name that you can use for input variable mapping.
Click Done.
If you want to define variables mapping, do the following steps. For details about variable mapping, see Variable mapping.
Select Define input and output variable mappings.
For Input variable mappings:
- Select Add input variable mapping.
- For Variable, type the name of the input variable.
- For Mapping type, select:
- From to map from the other unit kind.
- To to map to the other unit kind.
- For Dependency, Select the existing unit kind to which you are mapping variables.
- For Output variable, type the name of the output variable.
- Select Done.
To add another input variable, select Add input variable mapping and repeat the steps.
To add output variable mappings:
- Select the tab Output variable mappings.
- Select Add output variable mapping, and repeat the steps that you followed for the input variable mapping.
Click Next: Release configuration
For Release name, type a name for the release.
Optional: Add a label to the resources that you are deploying. For more details about labels, see the Labels overview.
To add a label:
Under Labels select Add labels.
For Key 1 and for Value 1, enter the desired key-value pair.
Repeat the steps for each label that you want add.
Click Create.
You have now created a unit kind. To create another unit kind, repeat the same steps and use the zip archive that contains the Terraform configuration for this next unit kind.
If you have created all of the unit kinds that are needed for the SaaS offering, then you can deploy a unit instance.
Create a unit kind using a Git repository
To create a unit kind using a Terraform configuration that is in a Git repository, complete the following instructions.
For details about using a Git repository for the Terraform files, see Connect to a Git repository.
In the console, go to SaaS Runtime > Unit Kinds.
Select Create.
For Create blueprint, select Link external repository.
For Repository, select the Git repository that has the Terraform configuration:
If the Git repository is linked, select it from the list.
If the repository is not linked, then clink Link new repository to use Developer Connect to link the repository.
Select Create new connection.
For Region, select the a region for the Developer Connect connection. We recommend using the same region as the region used for the Artifact Registry repository.
Optional: For KMS key, you can specify a KMS key for encryption.
For Branch, specify the Git branch that has the Terraform configuration that you want to associate with this unit kind.
On the page Store blueprint:
For Select repository from Artifact Registry, click Browse and select the Artifact Registry repository you are using for the SaaS offering.
For Artifact image name, enter a name for the OCI image.
For Infrastructure Manager terraform version, select the version of Terraform to use for deployments. For a list of supported Terraform versions, see Supported Terraform versions.
For the Cloud Build service account, select the service account that has the permissions to build the image. For details, see Artifact creation service account.
Click Next: Unit kind details.
On the page Configure unit kind properties, do the following:
For Unit kind name, enter a name for the unit kind. The name must contain only lowercase letters, numbers, or hyphens.
For SaaS Offering, select the SaaS offering that you want to associate with this unit kind.
For Dependencies:
If this is the first or only unit kind that you are creating for the SaaS offering, then don't add a dependency.
If you have created other other unit kinds that are dependent on this unit kind, then select Add deppendency.
For Unit kind, select the existing unit kind that is dependent on the unit kind that you are creating.
For Alias, type a name that you can use for input variable mapping.
Click Done.
If you want to define variables mapping, do the following steps. For details about variable mapping, see Variable mapping.
Select Define input and output variable mappings.
For Input variable mappings:
- Select Add input variable mapping.
- For Variable, type the name of the input variable.
- For Mapping type, select:
- From to map from the other unit kind.
- To to map to the other unit kind.
- For Dependency, Select the existing unit kind to which you are mapping variables.
- For Output variable, type the name of the output variable.
- Select Done.
To add another input variable, select Add input variable mapping and repeat the steps.
To add output variable mappings:
- Select the tab Output variable mappings.
- Select Add output variable mapping, and repeat the steps that you followed for the input variable mapping.
Click Next: Release configuration
For Release name, type a name for the release.
Optional: Add a label to the resources that you are deploying. For more details about labels, see the Labels overview.
To add a label:
Under Labels select Add labels.
For Key 1 and for Value 1, enter the desired key-value pair.
Repeat the steps for each label that you want add.
Click Create.
You have now created a unit kind. To create another unit kind, repeat the same steps and use the Git repository that contains the Terraform configuration for this next unit kind.
If you have created all of the unit kinds that are needed for the SaaS offering, then you can deploy a unit instance.
Create a unit kind using an existing image
To create a unit kind using an existing blueprint, which is an OCI image, complete the following instructions.
For details about building an OCI image, see:
In the console, go to SaaS Runtime > Unit Kinds.
Select Create.
For Create blueprint, select Select an existing image from artifact registry.
Click Next: Configure blueprint
On the page Store blueprint:
For Select or enter an existing blueprint from Artifact Registry:
Click Browse.
Navigate to the image that contains the Terraform configuration.
Click Select.
Click Next: Unit kind details.
On the page Configure unit kind properties, do the following:
For Unit kind name, enter a name for the unit kind. The name must contain only lowercase letters, numbers, or hyphens.
For SaaS Offering, select the SaaS offering that you want to associate with this unit kind.
For Dependencies:
If this is the first or only unit kind that you are creating for the SaaS offering, then don't add a dependency.
If you have created other other unit kinds that are dependent on this unit kind, then select Add deppendency.
For Unit kind, select the existing unit kind that is dependent on the unit kind that you are creating.
For Alias, type a name that you can use for input variable mapping.
Click Done.
If you want to define variables mapping, do the following steps. For details about variable mapping, see Variable mapping.
Select Define input and output variable mappings.
For Input variable mappings:
- Select Add input variable mapping.
- For Variable, type the name of the input variable.
- For Mapping type, select:
- From to map from the other unit kind.
- To to map to the other unit kind.
- For Dependency, Select the existing unit kind to which you are mapping variables.
- For Output variable, type the name of the output variable.
- Select Done.
To add another input variable, select Add input variable mapping and repeat the steps.
To add output variable mappings:
- Select the tab Output variable mappings.
- Select Add output variable mapping, and repeat the steps that you followed for the input variable mapping.
Click Next: Release configuration
For Release name, type a name for the release.
Optional: Add a label to the resources that you are deploying. For more details about labels, see the Labels overview.
To add a label:
Under Labels select Add labels.
For Key 1 and for Value 1, enter the desired key-value pair.
Repeat the steps for each label that you want add.
Click Create.
You have now created a unit kind. To create another unit kind, repeat the same steps and use the OCI image that contains the Terraform configuration for this next unit kind.
If you have created all of the unit kinds that are needed for the SaaS offering, then you can deploy a unit instance.
What's next
- After you have modeled the SaaS offering, you can deploy a unit instance.
- To learn more about SaaS Runtime, see the SaaS Runtime overview.
- For more details about the service accounts needed when using SaaS Runtime, see service accounts.