Skip to main content

Environment

A deployment target within a project where blueprint components become live infrastructure.

Each project can have multiple environments (e.g., staging, production). When you deploy to an environment, every component in the project's blueprint is realized as an Instance -- a running piece of cloud infrastructure with its own configuration, state, and cost data.

Environments inherit attributes from their parent project. You can also set environment-scoped attributes that cascade down to all instances within the environment. Defaults let you pre-assign resources (like a shared VPC or DNS zone) so that new instances automatically receive them.

Before deleting an environment, all instances must be decommissioned. Use the deletable field to check for blocking constraints.

type Environment {
id: ID!
name: String!
description: String
attributes: Map!
decommissionProtection: Boolean!
separationOfDuty: Boolean!
effectiveAttributes: Map!
createdAt: DateTime!
updatedAt: DateTime!
project: Project
parent: Environment
cost: CostSummary!
deletable: Deletable!
instances: [Instance!]!
connections: [Connection!]!
links: [Link!]!
blueprint: EnvironmentBlueprint @deprecated
unfulfilledDependencies: [UnfulfilledDependency!]!
defaults(
cursor: Cursor
): EnvironmentDefaultsPage
}

Fields

Environment.id ● ID! non-null scalar {#id}

Environment.name ● String! non-null scalar {#name}

Display name shown in the UI and CLI. Must be unique within the project.

Environment.description ● String scalar {#description}

Free-text description of what this environment is for.

Environment.attributes ● Map! non-null scalar {#attributes}

Key-value attributes assigned directly to this environment. Attributes cascade to instances. Must conform to your organization's custom attributes for the ENVIRONMENT scope.

Environment.decommissionProtection ● Boolean! non-null scalar {#decommission-protection}

When true, blocks decommissionEnvironment and any per-instance deployment with action: DECOMMISSION against this environment. Disable it via updateEnvironment before tearing down. Defaults to false.

Environment.separationOfDuty ● Boolean! non-null scalar {#separation-of-duty}

When true, approveDeployment rejects any approval from the account or service account that proposed the deployment — a proposal in this environment has to be approved by a second reviewer. Proposers can still reject their own proposals with rejectDeployment. Defaults to false.

Environment.effectiveAttributes ● Map! non-null scalar {#effective-attributes}

The full attribute map the authorization system evaluates policies against for this environment — user attributes merged with the parent project (project wins on conflict) plus auto-injected md-* system attributes.

System attributes always present on an environment:

  • md-id — the environment's identifier
  • md-project — the project's identifier
  • md-environment — the environment's local identifier

Environment.createdAt ● DateTime! non-null scalar {#created-at}

When this environment was created (UTC).

Environment.updatedAt ● DateTime! non-null scalar {#updated-at}

When this environment was last modified (UTC).

Environment.project ● Project object {#project}

The parent project that this environment belongs to.

Environment.parent ● Environment object {#parent}

The environment this one was forked from via forkEnvironment, or null for environments that were created directly. A fork's parent is immutable.

Environment.cost ● CostSummary! non-null object {#cost}

Aggregated cloud-provider cost metrics for all instances in this environment.

Environment.deletable ● Deletable! non-null object {#deletable}

Whether this environment can be safely deleted. Check constraints for blocking conditions.

Environment.instances ● [Instance!]! non-null object {#instances}

Infrastructure deployed in this environment.

Environment.connections ● [Connection!]! non-null object {#connections}

Runtime wiring between deployed instances in this environment.

The links in effect in this environment given the versions its instances actually run.

Where a project's links list every link in the architecture, this is the subset that applies to this environment: a component can run different versions in different environments, and a link applies only where the versions at both ends fall inside its version range. A link split across versions (~0.2 in staging, ~0.3 in production) appears here as the single row whose range matches the versions deployed in this environment. A link whose source or destination has no instance here does not appear.

Environment.unfulfilledDependencies ● [UnfulfilledDependency!]! non-null object {#unfulfilled-dependencies}

Required dependency inputs across this environment's instances that nothing fills — no blueprint link, no per-instance remote reference, and no environment default of the matching resource type.

Each entry is one input a deploy would block on. Clear it by wiring a resource into the slot (a link or a remote reference) or by setting an environment default of the listed resource type. Optional inputs are never included. The list is sorted by instance identifier, then input name.

Environment.defaults ● EnvironmentDefaultsPage object {#defaults}

Paginated list of default resources for this environment.

Defaults are pre-assigned resources (like a shared VPC or DNS zone) that instances automatically inherit when they require a matching resource type. Only one default per resource type is allowed.

Environment.defaults.cursor ● Cursor input {#environment-defaults-cursor}

Cursor from a previous page to fetch the next set of results.

Show deprecated

Returned By

environment query

Member Of

Environment object ● EnvironmentComparison object ● EnvironmentDefault object ● EnvironmentEvent object ● EnvironmentPayload object ● EnvironmentsPage object ● Instance object