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: []
`,
});
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: []
""")
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
})
}
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: []
",
});
});
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());
}
}
resources:
example:
type: harness:platform:EnvironmentGroup
properties:
identifier: identifier
color: '#0063F7'
yaml: |
environmentGroup:
name: "name"
identifier: "identifier"
description: "temp"
envIdentifiers: []
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: []
`,
});
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: []
""")
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
})
}
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: []
",
});
});
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());
}
}
resources:
example:
type: harness:platform:EnvironmentGroup
properties:
identifier: identifier
orgId: orgIdentifer
color: '#0063F7'
yaml: |
environmentGroup:
name: "name"
identifier: "identifier"
description: "temp"
orgIdentifier: "orgIdentifer"
envIdentifiers: []
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: []
`,
});
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: []
""")
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
})
}
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: []
",
});
});
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());
}
}
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: []
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[str] = 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 string
- The unique name of the resource.
- args EnvironmentGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args EnvironmentGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnvironmentGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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 = "string",
OrgId = "string",
ProjectId = "string",
});
example, err := platform.NewEnvironmentGroup(ctx, "environmentGroupResource", &platform.EnvironmentGroupArgs{
Identifier: pulumi.String("string"),
Yaml: pulumi.String("string"),
Color: pulumi.String("string"),
ForceDelete: pulumi.String("string"),
OrgId: pulumi.String("string"),
ProjectId: pulumi.String("string"),
})
var environmentGroupResource = new EnvironmentGroup("environmentGroupResource", EnvironmentGroupArgs.builder()
.identifier("string")
.yaml("string")
.color("string")
.forceDelete("string")
.orgId("string")
.projectId("string")
.build());
environment_group_resource = harness.platform.EnvironmentGroup("environmentGroupResource",
identifier="string",
yaml="string",
color="string",
force_delete="string",
org_id="string",
project_id="string")
const environmentGroupResource = new harness.platform.EnvironmentGroup("environmentGroupResource", {
identifier: "string",
yaml: "string",
color: "string",
forceDelete: "string",
orgId: "string",
projectId: "string",
});
type: harness:platform:EnvironmentGroup
properties:
color: string
forceDelete: string
identifier: string
orgId: string
projectId: string
yaml: string
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
The EnvironmentGroup resource accepts the following input properties:
- Identifier string
- identifier 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.
- Force
Delete string - Enable this flag for force deletion of environment group
- Org
Id string - org_id of the environment group.
- Project
Id string - project_id of the environment group.
- Identifier string
- identifier 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.
- Force
Delete string - Enable this flag for force deletion of environment group
- Org
Id string - org_id of the environment group.
- Project
Id string - project_id of the environment group.
- identifier String
- identifier 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.
- force
Delete String - Enable this flag for force deletion of environment group
- org
Id String - org_id of the environment group.
- project
Id String - project_id of the environment group.
- identifier string
- identifier 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.
- force
Delete string - Enable this flag for force deletion of environment group
- org
Id string - org_id of the environment group.
- project
Id string - project_id of the environment group.
- identifier str
- identifier 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 str
- Color of the environment group.
- force_
delete str - 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 String
- identifier 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.
- force
Delete String - Enable this flag for force deletion of environment group
- org
Id String - org_id of the environment group.
- project
Id 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[str] = 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)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Color string
- Color of the environment group.
- Force
Delete string - Enable this flag for force deletion of environment group
- Identifier string
- identifier of the environment group.
- Org
Id string - org_id of the environment group.
- Project
Id 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.
- Force
Delete string - Enable this flag for force deletion of environment group
- Identifier string
- identifier of the environment group.
- Org
Id string - org_id of the environment group.
- Project
Id 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.
- force
Delete String - Enable this flag for force deletion of environment group
- identifier String
- identifier of the environment group.
- org
Id String - org_id of the environment group.
- project
Id 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.
- force
Delete string - Enable this flag for force deletion of environment group
- identifier string
- identifier of the environment group.
- org
Id string - org_id of the environment group.
- project
Id 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 str - 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.
- force
Delete String - Enable this flag for force deletion of environment group
- identifier String
- identifier of the environment group.
- org
Id String - org_id of the environment group.
- project
Id 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>
Import org level environment group.
$ pulumi import harness:platform/environmentGroup:EnvironmentGroup example <org_id>/<environment_group_id>
Import project level environment group.
$ pulumi import harness:platform/environmentGroup:EnvironmentGroup example <org_id>/<project_id>/<environment_group_id>
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.