Humanitec makes it easy to define and work with different types of environments. Typical types of environments are development environments, QA environments, staging/pre-production environments, and production environments. In Humanitec, you can define Environment Types to group and manage environments for your team. Every Environment in Humanitec has exactly one Environment Type.
Environment Types can be used with External Resources to manage where resources such as databases are provisioned or even which Kubernetes cluster to deploy to.
Let's look at a simple example of how Environment Types can be used when building an Internal Developer Platform. It is very common to use different infrastructure for development vs. production environments. Let's assume a team wants to use the infrastructure listed below in their day-to-day work.
Infrastructure | Development | Production |
Kubernetes Cluster | EKS cluster with namespace separation | Dedicated AKS cluster |
DNS | Dynamically generated URLs | Static URL |
Databases | Dynamically generated RDS databases | Static self-managed databases |
File Storage | Dynamically generated S3 buckets | Static Azure File Storage |
The easiest way to achieve this setup in Humanitec is to use two different Environment Types (e.g., development and production) to define the infrastructure that should be used/provisioned depending on the type of the environment. The following sections explain how to achieve this step by step.
All Environment Types defined for your organization are listed in the Organization Settings.
You can use this view to add and delete Environment Types. Note that you can only delete Environment Types that are not connected with any existing Environment in your Apps. You can add a short description for each Environment Type.
You can assign both, Static and Dynamic Resources, to the Environment Types directly from the respective tabs in the Organization Settings.
The Environment Type is shown below each of your Environments in Humanitec. Whenever you create a new Environment you are asked which Environment Type the new Environment should be based on.
The Environment Type then determines which Infrastructure is used for your Environment. The infrastructure elements need to be defined as Static Resources or as Dynamic Resources.