Environment Blueprints in Harness IDP
Learn more about Environment Blueprints in Harness IDP.
This page covers the complete YAML schema for defining an Environment Blueprint. For a conceptual overview, go to Overview & Key Concepts. To create a blueprint through the UI, go to Create an Environment Blueprint.
Environment blueprint YAML
An Environment Blueprint is defined using a declarative YAML format. The YAML structure defines infrastructure templates, services, dependencies, and lifecycle management for environments.
Core components
An environment blueprint YAML has the following core components:
1. API Definition
apiVersion: Alwaysharness.io/v1for Environment Blueprintskind: Must beEnvironmentBlueprintname: Human-readable name for the blueprintidentifier: Unique identifier for the blueprint (auto-generated)owner: Access control specification (group or user)
2. Specification (spec)
entities: List of infrastructure, service components and other entitiesinputs: User-configurable parameters for the blueprint
apiVersion: harness.io/v1
kind: EnvironmentBlueprint
type: ''
name: <blueprint-name>
identifier: <blueprint-identifier>
owner: group:account/_account_all_users
spec:
entities: []
inputs: {}Entity specification
Each entity in an Environment Blueprint represents a component (infrastructure or service) that will be provisioned or deployed. Entities are the building blocks that define what gets created and how they interact with each other.
Entity structure
Each entity in the blueprint is composed of 2 main parts:
1. Backend - Describes the lifecycle implementation of the entity
Defines how the entity is provisioned, deployed, or managed
Specifies the backend type (
HarnessIACMfor infrastructure,CatalogorHarnessCDfor services). Go to Backend Types to learn more.Contains configuration values and operational steps
2. Interface - Defines how the entity relates to other entities specified in the blueprint
Declares dependencies on other entities
Specifies entity-level user-configurable inputs
Defines the entity's interaction model
Entity parameters
identifier
string
Unique name for the entity within the blueprint
namespace, frontend, backend
interface
object
Defines entity relationships and user inputs
See Interface Parameters below
backend
object
Defines the lifecycle implementation of the entity
See Backend Parameters below
Interface Parameters
dependencies
array
List of entity identifiers this entity depends on
[{"identifier": "namespace"}]
inputs
object
User-configurable parameters with types and defaults at the entity level
{"replicas": {"type": "integer", "default": 1}}
Backend Parameters
type
string
Backend type for entity provisioning
HarnessIACM, Catalog, HarnessCD
values
object
Configuration settings specific to the backend type
Varies by backend type
steps
object
Operational steps for lifecycle management (IaCM only)
{"create": {"template": "MyTemplate"}}
Backend types
Environment Blueprints support three main backend types:
1. HarnessIACM backend (infrastructure)
Used for provisioning infrastructure resources using Infrastructure as Code Management.
In this definition, backend.type is set to HarnessIACM.
YAML Structure
HarnessIACM Backend Parameters (backend.values)
workspace
string
Workspace name for IaCM operations
Namespace-${{env.config.name}}
HarnessIACM Backend Steps (backend.steps)
apply
Yes
Provisions infrastructure with "upsert" behavior - creates initially and updates on changes
pipeline, variables
destroy
Yes
Destroys previously provisioned infrastructure
pipeline, variables
create
No
Initializes infrastructure (e.g., IaCM Workspace) before first provisioning
template, version
delete
No
Deletes initialized but unprovisioned infrastructure
None
Step Dependencies:
createmust be executed before firstapplyoperationdeletemust be executed afterdestroyoperationcreateanddeletesteps must be used together (both or neither)
Example Configuration:
Referencing Resources Across Scopes
When referencing Harness resources (such as IaCM workspace templates or catalog entities) in your blueprint, you can reference resources from different organizational scopes using scope prefixes:
Project scope (default): Use just the identifier -
MyResourceOrganization scope: Prefix with
org.-org.MyResourceAccount scope: Prefix with
account.-account.MyResource
This enables you to reference shared resources across your Harness hierarchy while maintaining proper access control. For example, environments created at the project level can reference IaCM workspace templates or catalog entities defined at the organization or account level.
2. Catalog backend (services)
Used for deploying application services from the IDP catalog.
In this definition, backend.type is set to Catalog.
YAML Structure
Catalog Backend (backend.values)
identifier
string
Component (service) ID from the IDP catalog
frontend, backend
variables
object
Input variables passed to the component
{"replicas": "${{entity.config.replicas}}"}
environment
object
Target deployment environment specification
See environment parameters below
The values.variables field maps to service-level variables on the Harness Service, not pipeline-level variables. If your deployment pipeline defines variables at the pipeline level (for example, pipeline.variables.COMMIT_SHA), those variables cannot be resolved through values.variables. Use the HarnessCD backend instead and pass pipeline variables under steps.apply.variables.
Environment Parameters (backend.values.environment)
identifier
string
CD Service Environment identifier where services will be deployed
mycluster
infra
object
Infrastructure specification within the environment
See infra parameters below
Infrastructure Parameters (backend.values.environment.infra)
identifier
string
Infrastructure identifier
ssemteamdelegate
Catalog Backend Steps (backend.steps)
apply
Yes
Deploys the service using the specified pipeline
pipeline
destroy
Yes
Removes the deployed service using the specified pipeline
pipeline
3. HarnessCD Backend (Services)
Used for deploying application services when your deployment pipelines use pipeline-level variables. Unlike the Catalog backend type, where values.variables maps to service-level variables on the Harness Service, the HarnessCD backend type lets you define pipeline variables (for example, COMMIT_SHA) directly under steps.apply.variables.
In this definition, backend.type is set to HarnessCD.
YAML Structure
HarnessCD Backend (backend.values)
service
string
Harness CD service identifier
frontend, backend
variables
object
Service-level input variables passed to the Harness Service
{"IMAGE_TAG": "${{env.config.IMAGE_TAG}}"}
environment
object
Target CD environment specification
See Environment Parameters below
Environment Parameters (backend.values.environment)
identifier
string
CD Service Environment identifier where the service will be deployed
mycluster
infra
object
Infrastructure specification within the environment
See infra parameters below
Infrastructure Parameters (backend.values.environment.infra)
identifier
string
Infrastructure identifier
ssemteam
namespace
string
Kubernetes namespace for the deployment (supports templating)
my-app-${{env.config.name}}
HarnessCD Backend Steps (backend.steps)
apply
Yes
Deploys the service using the specified pipeline
pipeline, variables
destroy
Yes
Removes the deployed service using the specified pipeline
pipeline
Step Parameters (backend.steps.apply)
pipeline
string
Deploy pipeline identifier
Deploy
variables
object
Pipeline-level variables passed directly to the pipeline at execution time
{"COMMIT_SHA": "${{env.config.COMMIT_SHA}}"}
Configure TTL (time-to-live)
You can configure TTL for environments in the environment blueprint. Defining a TTL specifies how long an environment can run before it is automatically paused. This helps control costs and prevents lingering environments.
Based on the TTL specification, there are two environment types: Ephemeral and Long-lived. Go to Types of Environments to learn more.
Set TTL in an environment blueprint
To define a TTL, add the spec.ttl field to the environment blueprint YAML. The ttl field is specified as follows:
1. TTL specification
Durations support hours, minutes, and seconds (e.g., 1h, 30m, 1h30m).
2. TTL kinds
fixed- A fixed, preconfigured duration in the blueprint. Users cannot change it when creating an environment.custom- A user-configurable duration chosen at environment creation time.none- No TTL. The environment is long-lived and is only paused/stopped when a user does so explicitly.
3. TTL parameters
default- The default TTL duration for the blueprint (optional).max- The maximum allowed TTL duration for the blueprint (optional).
4. Examples
Fixed 1-hour TTL; the environment pauses automatically after 1 hour:
User-defined TTL with a default of 3 hours (if no input is provided) and a 24-hour cap:
Long-lived environment (no automatic pause):
Note: When you update an environment’s configuration, the environment is re-provisioned and the TTL is reset. The new TTL countdown starts from the time of the update.
Blueprint outputs
A blueprint can define an outputs block under spec to expose values from its entities once the environment is provisioned. These values appear in the Outputs tab of the environment detail page and can be referenced by other environments using cross-environment output syntax.
The value field uses the entity output expression format described in YAML Templating System.
IaCM entity output (Terraform output from a workspace):
IaCM pipeline output (output from a provisioning pipeline stage):
CD pipeline output (stage output from a deployment pipeline):
YAML templating system
Environment Blueprints use a powerful templating system for dynamic configuration:
Template variables
Environment Config
${{env.config.name}}
Access blueprint-level inputs defined in spec.inputs.
Entity Config
${{entity.config.replicas}}
Access entity-level inputs defined in interface.inputs.
Entity Output
${{entity.<id>.output.<path>}}
Reference an output from an entity in this blueprint. For a specific pipeline stage and step: ${{entity.<id>.<stage>.<step>.output.<path>}}
Dependency Output
${{dependencies.<id>.output.<path>}}
Reference an output from a dependent entity. For a specific pipeline stage and step: ${{dependencies.<id>.<stage>.<step>.output.<path>}}
Example usage
Output values are populated once environment entities finish provisioning (IaCM workspaces) or deploying (CD services). To see the resolved output values for a running environment, open the environment and select the Outputs tab.
Scope & hierarchy
Environment Blueprints can be created at the account, organization, or project scope. The scope is determined by the orgIdentifier and projectIdentifier fields in the blueprint YAML:
A blueprint with no
orgIdentifierorprojectIdentifieris created at the account scope.A blueprint with only an
orgIdentifieris created at the org scope.A blueprint with both
orgIdentifierandprojectIdentifieris created at the project scope.
Environments are currently created at the project scope. However, an environment can reference a blueprint from its own project scope, its parent org scope, or the account scope.
Reference blueprints from environments
When an environment references a blueprint, the blueprint identifier uses a scope prefix to indicate which scope the blueprint belongs to:
account.my-blueprint: references a blueprint at the account scopeorg.my-blueprint: references a blueprint at the org scopemy-blueprint(no prefix): references a blueprint at the same scope as the environment (project level)
In an environment blueprint, all the entities, workspace templates, pipelines, etc. are also created at the project scope.
Environment management RBAC
Harness IDP provides granular Role-Based Access Control (RBAC) for environment management, allowing you to control who can view, create, edit, or delete environment blueprints and environments. The RBAC model follows the Harness platform hierarchy with different scopes for blueprints and environments.
Permissions hierarchy
The environment management RBAC is structured across two main resource types:
Environment Blueprint
Account, Org, or Project Level
VIEW: View environment blueprints
CREATE: Create new blueprints
EDIT: Edit existing blueprints
DELETE: Delete environment blueprints
All Environment Blueprints
Specific Environment Blueprints
Environment
Project Level
VIEW: View environments
CREATE: Create new environments
EDIT: Edit existing environments
DELETE: Delete environments
All Environments
Specific Environments
For a complete overview of all IDP resources and their permissions across different scopes, refer to the Permissions & Resources table in the IDP RBAC documentation.
Configuring RBAC for environment management
To configure access control for environment management:
For Environment Blueprints (Account, Org, or Project Level):
Navigate to the settings for the relevant scope (Account Settings, Org Settings, or Project Settings) → Access Control → Roles
Navigate to Account Settings → Access Control → Roles
Create or edit a role and assign Environment Blueprint permissions (VIEW, CREATE, EDIT, DELETE)
Create a Resource Group and select either:
All Environment Blueprints - Grants access to all blueprints in the account
Specific Environment Blueprints - Grants access to selected blueprints only
Assign the role and resource group to users or user groups
For Environments (Project Level):
Navigate to Project Settings → Access Control → Roles
Create or edit a role and assign Environment permissions (VIEW, CREATE, EDIT, DELETE)
Create a Resource Group and select either:
All Environments - Grants access to all environments in the project
Specific Environments - Grants access to selected environments only
Assign the role and resource group to users or user groups
Example blueprint YAML
Create environment blueprints
For a step-by-step UI walkthrough of the blueprint creation flow, go to Create an Environment Blueprint.
Last updated
Was this helpful?