1. Packages
  2. Harness Provider
  3. API Docs
  4. platform
  5. EnvironmentGroup
Harness v0.7.3 published on Friday, Apr 18, 2025 by Pulumi

harness.platform.EnvironmentGroup

Explore with Pulumi AI

Resource for creating a Harness environment group.

Example to create Environment Group at different levels (Org, Project, Account)

Account Level

import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";

const example = new harness.platform.EnvironmentGroup("example", {
    identifier: "identifier",
    color: "#0063F7",
    yaml: `environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  envIdentifiers: []
`,
});
Copy
import pulumi
import pulumi_harness as harness

example = harness.platform.EnvironmentGroup("example",
    identifier="identifier",
    color="#0063F7",
    yaml="""environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  envIdentifiers: []
""")
Copy
package main

import (
	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := platform.NewEnvironmentGroup(ctx, "example", &platform.EnvironmentGroupArgs{
			Identifier: pulumi.String("identifier"),
			Color:      pulumi.String("#0063F7"),
			Yaml: pulumi.String(`environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  envIdentifiers: []
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;

return await Deployment.RunAsync(() => 
{
    var example = new Harness.Platform.EnvironmentGroup("example", new()
    {
        Identifier = "identifier",
        Color = "#0063F7",
        Yaml = @"environmentGroup:
  name: ""name""
  identifier: ""identifier""
  description: ""temp""
  envIdentifiers: []
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.EnvironmentGroup;
import com.pulumi.harness.platform.EnvironmentGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new EnvironmentGroup("example", EnvironmentGroupArgs.builder()
            .identifier("identifier")
            .color("#0063F7")
            .yaml("""
environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  envIdentifiers: []
            """)
            .build());

    }
}
Copy
resources:
  example:
    type: harness:platform:EnvironmentGroup
    properties:
      identifier: identifier
      color: '#0063F7'
      yaml: |
        environmentGroup:
          name: "name"
          identifier: "identifier"
          description: "temp"
          envIdentifiers: []        
Copy

Org Level

import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";

const example = new harness.platform.EnvironmentGroup("example", {
    identifier: "identifier",
    orgId: "orgIdentifer",
    color: "#0063F7",
    yaml: `environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  orgIdentifier: "orgIdentifer"
  envIdentifiers: []
`,
});
Copy
import pulumi
import pulumi_harness as harness

example = harness.platform.EnvironmentGroup("example",
    identifier="identifier",
    org_id="orgIdentifer",
    color="#0063F7",
    yaml="""environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  orgIdentifier: "orgIdentifer"
  envIdentifiers: []
""")
Copy
package main

import (
	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := platform.NewEnvironmentGroup(ctx, "example", &platform.EnvironmentGroupArgs{
			Identifier: pulumi.String("identifier"),
			OrgId:      pulumi.String("orgIdentifer"),
			Color:      pulumi.String("#0063F7"),
			Yaml: pulumi.String(`environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  orgIdentifier: "orgIdentifer"
  envIdentifiers: []
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;

return await Deployment.RunAsync(() => 
{
    var example = new Harness.Platform.EnvironmentGroup("example", new()
    {
        Identifier = "identifier",
        OrgId = "orgIdentifer",
        Color = "#0063F7",
        Yaml = @"environmentGroup:
  name: ""name""
  identifier: ""identifier""
  description: ""temp""
  orgIdentifier: ""orgIdentifer""
  envIdentifiers: []
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.EnvironmentGroup;
import com.pulumi.harness.platform.EnvironmentGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new EnvironmentGroup("example", EnvironmentGroupArgs.builder()
            .identifier("identifier")
            .orgId("orgIdentifer")
            .color("#0063F7")
            .yaml("""
environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  orgIdentifier: "orgIdentifer"
  envIdentifiers: []
            """)
            .build());

    }
}
Copy
resources:
  example:
    type: harness:platform:EnvironmentGroup
    properties:
      identifier: identifier
      orgId: orgIdentifer
      color: '#0063F7'
      yaml: |
        environmentGroup:
          name: "name"
          identifier: "identifier"
          description: "temp"
          orgIdentifier: "orgIdentifer"
          envIdentifiers: []        
Copy

Project Level

import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";

const example = new harness.platform.EnvironmentGroup("example", {
    identifier: "identifier",
    orgId: "orgIdentifer",
    projectId: "projectIdentifier",
    color: "#0063F7",
    yaml: `environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  orgIdentifier: "orgIdentifer"
  projectIdentifier: "projectIdentifier"
  envIdentifiers: []
`,
});
Copy
import pulumi
import pulumi_harness as harness

example = harness.platform.EnvironmentGroup("example",
    identifier="identifier",
    org_id="orgIdentifer",
    project_id="projectIdentifier",
    color="#0063F7",
    yaml="""environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  orgIdentifier: "orgIdentifer"
  projectIdentifier: "projectIdentifier"
  envIdentifiers: []
""")
Copy
package main

import (
	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := platform.NewEnvironmentGroup(ctx, "example", &platform.EnvironmentGroupArgs{
			Identifier: pulumi.String("identifier"),
			OrgId:      pulumi.String("orgIdentifer"),
			ProjectId:  pulumi.String("projectIdentifier"),
			Color:      pulumi.String("#0063F7"),
			Yaml: pulumi.String(`environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  orgIdentifier: "orgIdentifer"
  projectIdentifier: "projectIdentifier"
  envIdentifiers: []
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;

return await Deployment.RunAsync(() => 
{
    var example = new Harness.Platform.EnvironmentGroup("example", new()
    {
        Identifier = "identifier",
        OrgId = "orgIdentifer",
        ProjectId = "projectIdentifier",
        Color = "#0063F7",
        Yaml = @"environmentGroup:
  name: ""name""
  identifier: ""identifier""
  description: ""temp""
  orgIdentifier: ""orgIdentifer""
  projectIdentifier: ""projectIdentifier""
  envIdentifiers: []
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.EnvironmentGroup;
import com.pulumi.harness.platform.EnvironmentGroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new EnvironmentGroup("example", EnvironmentGroupArgs.builder()
            .identifier("identifier")
            .orgId("orgIdentifer")
            .projectId("projectIdentifier")
            .color("#0063F7")
            .yaml("""
environmentGroup:
  name: "name"
  identifier: "identifier"
  description: "temp"
  orgIdentifier: "orgIdentifer"
  projectIdentifier: "projectIdentifier"
  envIdentifiers: []
            """)
            .build());

    }
}
Copy
resources:
  example:
    type: harness:platform:EnvironmentGroup
    properties:
      identifier: identifier
      orgId: orgIdentifer
      projectId: projectIdentifier
      color: '#0063F7'
      yaml: |
        environmentGroup:
          name: "name"
          identifier: "identifier"
          description: "temp"
          orgIdentifier: "orgIdentifer"
          projectIdentifier: "projectIdentifier"
          envIdentifiers: []        
Copy

Create EnvironmentGroup Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new EnvironmentGroup(name: string, args: EnvironmentGroupArgs, opts?: CustomResourceOptions);
@overload
def EnvironmentGroup(resource_name: str,
                     args: EnvironmentGroupArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def EnvironmentGroup(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     identifier: Optional[str] = None,
                     yaml: Optional[str] = None,
                     color: Optional[str] = None,
                     force_delete: Optional[bool] = None,
                     org_id: Optional[str] = None,
                     project_id: Optional[str] = None)
func NewEnvironmentGroup(ctx *Context, name string, args EnvironmentGroupArgs, opts ...ResourceOption) (*EnvironmentGroup, error)
public EnvironmentGroup(string name, EnvironmentGroupArgs args, CustomResourceOptions? opts = null)
public EnvironmentGroup(String name, EnvironmentGroupArgs args)
public EnvironmentGroup(String name, EnvironmentGroupArgs args, CustomResourceOptions options)
type: harness:platform:EnvironmentGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. EnvironmentGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. EnvironmentGroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. EnvironmentGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. EnvironmentGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. EnvironmentGroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var environmentGroupResource = new Harness.Platform.EnvironmentGroup("environmentGroupResource", new()
{
    Identifier = "string",
    Yaml = "string",
    Color = "string",
    ForceDelete = false,
    OrgId = "string",
    ProjectId = "string",
});
Copy
example, err := platform.NewEnvironmentGroup(ctx, "environmentGroupResource", &platform.EnvironmentGroupArgs{
	Identifier:  pulumi.String("string"),
	Yaml:        pulumi.String("string"),
	Color:       pulumi.String("string"),
	ForceDelete: pulumi.Bool(false),
	OrgId:       pulumi.String("string"),
	ProjectId:   pulumi.String("string"),
})
Copy
var environmentGroupResource = new EnvironmentGroup("environmentGroupResource", EnvironmentGroupArgs.builder()
    .identifier("string")
    .yaml("string")
    .color("string")
    .forceDelete(false)
    .orgId("string")
    .projectId("string")
    .build());
Copy
environment_group_resource = harness.platform.EnvironmentGroup("environmentGroupResource",
    identifier="string",
    yaml="string",
    color="string",
    force_delete=False,
    org_id="string",
    project_id="string")
Copy
const environmentGroupResource = new harness.platform.EnvironmentGroup("environmentGroupResource", {
    identifier: "string",
    yaml: "string",
    color: "string",
    forceDelete: false,
    orgId: "string",
    projectId: "string",
});
Copy
type: harness:platform:EnvironmentGroup
properties:
    color: string
    forceDelete: false
    identifier: string
    orgId: string
    projectId: string
    yaml: string
Copy

EnvironmentGroup Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The EnvironmentGroup resource accepts the following input properties:

Identifier This property is required. string
identifier of the environment group.
Yaml This property is required. string
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
Color string
Color of the environment group.
ForceDelete bool
Enable this flag for force deletion of environment group
OrgId string
org_id of the environment group.
ProjectId string
project_id of the environment group.
Identifier This property is required. string
identifier of the environment group.
Yaml This property is required. string
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
Color string
Color of the environment group.
ForceDelete bool
Enable this flag for force deletion of environment group
OrgId string
org_id of the environment group.
ProjectId string
project_id of the environment group.
identifier This property is required. String
identifier of the environment group.
yaml This property is required. String
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
color String
Color of the environment group.
forceDelete Boolean
Enable this flag for force deletion of environment group
orgId String
org_id of the environment group.
projectId String
project_id of the environment group.
identifier This property is required. string
identifier of the environment group.
yaml This property is required. string
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
color string
Color of the environment group.
forceDelete boolean
Enable this flag for force deletion of environment group
orgId string
org_id of the environment group.
projectId string
project_id of the environment group.
identifier This property is required. str
identifier of the environment group.
yaml This property is required. str
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
color str
Color of the environment group.
force_delete bool
Enable this flag for force deletion of environment group
org_id str
org_id of the environment group.
project_id str
project_id of the environment group.
identifier This property is required. String
identifier of the environment group.
yaml This property is required. String
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
color String
Color of the environment group.
forceDelete Boolean
Enable this flag for force deletion of environment group
orgId String
org_id of the environment group.
projectId String
project_id of the environment group.

Outputs

All input properties are implicitly available as output properties. Additionally, the EnvironmentGroup resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing EnvironmentGroup Resource

Get an existing EnvironmentGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: EnvironmentGroupState, opts?: CustomResourceOptions): EnvironmentGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        color: Optional[str] = None,
        force_delete: Optional[bool] = None,
        identifier: Optional[str] = None,
        org_id: Optional[str] = None,
        project_id: Optional[str] = None,
        yaml: Optional[str] = None) -> EnvironmentGroup
func GetEnvironmentGroup(ctx *Context, name string, id IDInput, state *EnvironmentGroupState, opts ...ResourceOption) (*EnvironmentGroup, error)
public static EnvironmentGroup Get(string name, Input<string> id, EnvironmentGroupState? state, CustomResourceOptions? opts = null)
public static EnvironmentGroup get(String name, Output<String> id, EnvironmentGroupState state, CustomResourceOptions options)
resources:  _:    type: harness:platform:EnvironmentGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Color string
Color of the environment group.
ForceDelete bool
Enable this flag for force deletion of environment group
Identifier string
identifier of the environment group.
OrgId string
org_id of the environment group.
ProjectId string
project_id of the environment group.
Yaml string
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
Color string
Color of the environment group.
ForceDelete bool
Enable this flag for force deletion of environment group
Identifier string
identifier of the environment group.
OrgId string
org_id of the environment group.
ProjectId string
project_id of the environment group.
Yaml string
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
color String
Color of the environment group.
forceDelete Boolean
Enable this flag for force deletion of environment group
identifier String
identifier of the environment group.
orgId String
org_id of the environment group.
projectId String
project_id of the environment group.
yaml String
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
color string
Color of the environment group.
forceDelete boolean
Enable this flag for force deletion of environment group
identifier string
identifier of the environment group.
orgId string
org_id of the environment group.
projectId string
project_id of the environment group.
yaml string
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
color str
Color of the environment group.
force_delete bool
Enable this flag for force deletion of environment group
identifier str
identifier of the environment group.
org_id str
org_id of the environment group.
project_id str
project_id of the environment group.
yaml str
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.
color String
Color of the environment group.
forceDelete Boolean
Enable this flag for force deletion of environment group
identifier String
identifier of the environment group.
orgId String
org_id of the environment group.
projectId String
project_id of the environment group.
yaml String
Env group YAML. In YAML, to reference an entity at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference an entity at the account scope, prefix 'account` to the expression: account.{identifier}. For eg, to reference a connector with identifier 'connectorId' at the organization scope in a stage mention it as connectorRef: org.connectorId.

Import

Import account level environment group.

$ pulumi import harness:platform/environmentGroup:EnvironmentGroup example <environment_group_id>
Copy

Import org level environment group.

$ pulumi import harness:platform/environmentGroup:EnvironmentGroup example <org_id>/<environment_group_id>
Copy

Import project level environment group.

$ pulumi import harness:platform/environmentGroup:EnvironmentGroup example <org_id>/<project_id>/<environment_group_id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
harness pulumi/pulumi-harness
License
Apache-2.0
Notes
This Pulumi package is based on the harness Terraform Provider.