1. Packages
  2. Harness
  3. API Docs
  4. platform
  5. Environment
Harness v0.2.1 published on Friday, Jul 26, 2024 by Pulumi

harness.platform.Environment

Explore with Pulumi AI

harness logo
Harness v0.2.1 published on Friday, Jul 26, 2024 by Pulumi

    Resource for creating a Harness environment.

    Example to create Environment 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.Environment("example", {
        identifier: "identifier",
        name: "name",
        tags: [
            "foo:bar",
            "bar:foo",
        ],
        type: "PreProduction",
        description: "env description",
        yaml: `environment:
       name: name
       identifier: identifier
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    `,
    });
    
    import pulumi
    import pulumi_harness as harness
    
    example = harness.platform.Environment("example",
        identifier="identifier",
        name="name",
        tags=[
            "foo:bar",
            "bar:foo",
        ],
        type="PreProduction",
        description="env description",
        yaml="""environment:
       name: name
       identifier: identifier
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    """)
    
    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.NewEnvironment(ctx, "example", &platform.EnvironmentArgs{
    			Identifier: pulumi.String("identifier"),
    			Name:       pulumi.String("name"),
    			Tags: pulumi.StringArray{
    				pulumi.String("foo:bar"),
    				pulumi.String("bar:foo"),
    			},
    			Type:        pulumi.String("PreProduction"),
    			Description: pulumi.String("env description"),
    			Yaml: pulumi.String(`environment:
       name: name
       identifier: identifier
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    `),
    		})
    		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.Environment("example", new()
        {
            Identifier = "identifier",
            Name = "name",
            Tags = new[]
            {
                "foo:bar",
                "bar:foo",
            },
            Type = "PreProduction",
            Description = "env description",
            Yaml = @"environment:
       name: name
       identifier: identifier
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: """"
         - name: envVar2
           type: String
           value: v2
           description: """"
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.Environment;
    import com.pulumi.harness.platform.EnvironmentArgs;
    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 Environment("example", EnvironmentArgs.builder()
                .identifier("identifier")
                .name("name")
                .tags(            
                    "foo:bar",
                    "bar:foo")
                .type("PreProduction")
                .description("env description")
                .yaml("""
    environment:
       name: name
       identifier: identifier
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
                """)
                .build());
    
        }
    }
    
    resources:
      example:
        type: harness:platform:Environment
        properties:
          identifier: identifier
          name: name
          tags:
            - foo:bar
            - bar:foo
          type: PreProduction
          description: env description
          yaml: |
            environment:
               name: name
               identifier: identifier
               type: PreProduction
               tags:
                 foo: bar
                 bar: foo
               variables:
                 - name: envVar1
                   type: String
                   value: v1
                   description: ""
                 - name: envVar2
                   type: String
                   value: v2
                   description: ""
               overrides:
                 manifests:
                   - manifest:
                       identifier: manifestEnv
                       type: Values
                       spec:
                         store:
                           type: Git
                           spec:
                             connectorRef: <+input>
                             gitFetchType: Branch
                             paths:
                               - file1
                             repoName: <+input>
                             branch: master
                 configFiles:
                   - configFile:
                       identifier: configFileEnv
                       spec:
                         store:
                           type: Harness
                           spec:
                             files:
                               - account:/Add-ons/svcOverrideTest
                             secretFiles: []        
    

    Org Level

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const example = new harness.platform.Environment("example", {
        identifier: "identifier",
        name: "name",
        orgId: "org_id",
        tags: [
            "foo:bar",
            "bar:foo",
        ],
        type: "PreProduction",
        description: "env description",
        yaml: `environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    `,
    });
    
    import pulumi
    import pulumi_harness as harness
    
    example = harness.platform.Environment("example",
        identifier="identifier",
        name="name",
        org_id="org_id",
        tags=[
            "foo:bar",
            "bar:foo",
        ],
        type="PreProduction",
        description="env description",
        yaml="""environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    """)
    
    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.NewEnvironment(ctx, "example", &platform.EnvironmentArgs{
    			Identifier: pulumi.String("identifier"),
    			Name:       pulumi.String("name"),
    			OrgId:      pulumi.String("org_id"),
    			Tags: pulumi.StringArray{
    				pulumi.String("foo:bar"),
    				pulumi.String("bar:foo"),
    			},
    			Type:        pulumi.String("PreProduction"),
    			Description: pulumi.String("env description"),
    			Yaml: pulumi.String(`environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    `),
    		})
    		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.Environment("example", new()
        {
            Identifier = "identifier",
            Name = "name",
            OrgId = "org_id",
            Tags = new[]
            {
                "foo:bar",
                "bar:foo",
            },
            Type = "PreProduction",
            Description = "env description",
            Yaml = @"environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: """"
         - name: envVar2
           type: String
           value: v2
           description: """"
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.Environment;
    import com.pulumi.harness.platform.EnvironmentArgs;
    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 Environment("example", EnvironmentArgs.builder()
                .identifier("identifier")
                .name("name")
                .orgId("org_id")
                .tags(            
                    "foo:bar",
                    "bar:foo")
                .type("PreProduction")
                .description("env description")
                .yaml("""
    environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
                """)
                .build());
    
        }
    }
    
    resources:
      example:
        type: harness:platform:Environment
        properties:
          identifier: identifier
          name: name
          orgId: org_id
          tags:
            - foo:bar
            - bar:foo
          type: PreProduction
          description: env description
          yaml: |
            environment:
               name: name
               identifier: identifier
               orgIdentifier: org_id
               type: PreProduction
               tags:
                 foo: bar
                 bar: foo
               variables:
                 - name: envVar1
                   type: String
                   value: v1
                   description: ""
                 - name: envVar2
                   type: String
                   value: v2
                   description: ""
               overrides:
                 manifests:
                   - manifest:
                       identifier: manifestEnv
                       type: Values
                       spec:
                         store:
                           type: Git
                           spec:
                             connectorRef: <+input>
                             gitFetchType: Branch
                             paths:
                               - file1
                             repoName: <+input>
                             branch: master
                 configFiles:
                   - configFile:
                       identifier: configFileEnv
                       spec:
                         store:
                           type: Harness
                           spec:
                             files:
                               - account:/Add-ons/svcOverrideTest
                             secretFiles: []        
    

    Project Level

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const example = new harness.platform.Environment("example", {
        identifier: "identifier",
        name: "name",
        orgId: "org_id",
        projectId: "project_id",
        tags: [
            "foo:bar",
            "bar:foo",
        ],
        type: "PreProduction",
        description: "env description",
        yaml: `environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       projectIdentifier: project_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    `,
    });
    
    import pulumi
    import pulumi_harness as harness
    
    example = harness.platform.Environment("example",
        identifier="identifier",
        name="name",
        org_id="org_id",
        project_id="project_id",
        tags=[
            "foo:bar",
            "bar:foo",
        ],
        type="PreProduction",
        description="env description",
        yaml="""environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       projectIdentifier: project_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    """)
    
    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.NewEnvironment(ctx, "example", &platform.EnvironmentArgs{
    			Identifier: pulumi.String("identifier"),
    			Name:       pulumi.String("name"),
    			OrgId:      pulumi.String("org_id"),
    			ProjectId:  pulumi.String("project_id"),
    			Tags: pulumi.StringArray{
    				pulumi.String("foo:bar"),
    				pulumi.String("bar:foo"),
    			},
    			Type:        pulumi.String("PreProduction"),
    			Description: pulumi.String("env description"),
    			Yaml: pulumi.String(`environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       projectIdentifier: project_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    `),
    		})
    		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.Environment("example", new()
        {
            Identifier = "identifier",
            Name = "name",
            OrgId = "org_id",
            ProjectId = "project_id",
            Tags = new[]
            {
                "foo:bar",
                "bar:foo",
            },
            Type = "PreProduction",
            Description = "env description",
            Yaml = @"environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       projectIdentifier: project_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: """"
         - name: envVar2
           type: String
           value: v2
           description: """"
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.Environment;
    import com.pulumi.harness.platform.EnvironmentArgs;
    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 Environment("example", EnvironmentArgs.builder()
                .identifier("identifier")
                .name("name")
                .orgId("org_id")
                .projectId("project_id")
                .tags(            
                    "foo:bar",
                    "bar:foo")
                .type("PreProduction")
                .description("env description")
                .yaml("""
    environment:
       name: name
       identifier: identifier
       orgIdentifier: org_id
       projectIdentifier: project_id
       type: PreProduction
       tags:
         foo: bar
         bar: foo
       variables:
         - name: envVar1
           type: String
           value: v1
           description: ""
         - name: envVar2
           type: String
           value: v2
           description: ""
       overrides:
         manifests:
           - manifest:
               identifier: manifestEnv
               type: Values
               spec:
                 store:
                   type: Git
                   spec:
                     connectorRef: <+input>
                     gitFetchType: Branch
                     paths:
                       - file1
                     repoName: <+input>
                     branch: master
         configFiles:
           - configFile:
               identifier: configFileEnv
               spec:
                 store:
                   type: Harness
                   spec:
                     files:
                       - account:/Add-ons/svcOverrideTest
                     secretFiles: []
                """)
                .build());
    
        }
    }
    
    resources:
      example:
        type: harness:platform:Environment
        properties:
          identifier: identifier
          name: name
          orgId: org_id
          projectId: project_id
          tags:
            - foo:bar
            - bar:foo
          type: PreProduction
          description: env description
          yaml: |
            environment:
               name: name
               identifier: identifier
               orgIdentifier: org_id
               projectIdentifier: project_id
               type: PreProduction
               tags:
                 foo: bar
                 bar: foo
               variables:
                 - name: envVar1
                   type: String
                   value: v1
                   description: ""
                 - name: envVar2
                   type: String
                   value: v2
                   description: ""
               overrides:
                 manifests:
                   - manifest:
                       identifier: manifestEnv
                       type: Values
                       spec:
                         store:
                           type: Git
                           spec:
                             connectorRef: <+input>
                             gitFetchType: Branch
                             paths:
                               - file1
                             repoName: <+input>
                             branch: master
                 configFiles:
                   - configFile:
                       identifier: configFileEnv
                       spec:
                         store:
                           type: Harness
                           spec:
                             files:
                               - account:/Add-ons/svcOverrideTest
                             secretFiles: []        
    

    Creating Remote Environment

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const example = new harness.platform.Environment("example", {
        identifier: "identifier",
        name: "name",
        description: "test",
        orgId: "org_id",
        projectId: "project_id",
        gitDetails: {
            storeType: "REMOTE",
            connectorRef: "connector_ref",
            repoName: "repo_name",
            filePath: "file_path",
            branch: "branch",
        },
        yaml: `environment:
      name: env
      identifier: env
      tags:
        test: ""
      type: PreProduction
      orgIdentifier: default
      projectIdentifier: proj1
      variables:
        - name: var1
          type: String
          value: abc
          description: ""
          required: false
      overrides:
        manifests:
          - manifest:
              identifier: Manifest1
              type: Values
              spec:
                store:
                  type: Github
                  spec:
                    connectorRef: <+input>
                    gitFetchType: Branch
                    paths:
                      - .harness/
                    repoName: <+input>
                    branch: <+input>
    `,
    });
    
    import pulumi
    import pulumi_harness as harness
    
    example = harness.platform.Environment("example",
        identifier="identifier",
        name="name",
        description="test",
        org_id="org_id",
        project_id="project_id",
        git_details=harness.platform.EnvironmentGitDetailsArgs(
            store_type="REMOTE",
            connector_ref="connector_ref",
            repo_name="repo_name",
            file_path="file_path",
            branch="branch",
        ),
        yaml="""environment:
      name: env
      identifier: env
      tags:
        test: ""
      type: PreProduction
      orgIdentifier: default
      projectIdentifier: proj1
      variables:
        - name: var1
          type: String
          value: abc
          description: ""
          required: false
      overrides:
        manifests:
          - manifest:
              identifier: Manifest1
              type: Values
              spec:
                store:
                  type: Github
                  spec:
                    connectorRef: <+input>
                    gitFetchType: Branch
                    paths:
                      - .harness/
                    repoName: <+input>
                    branch: <+input>
    """)
    
    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.NewEnvironment(ctx, "example", &platform.EnvironmentArgs{
    			Identifier:  pulumi.String("identifier"),
    			Name:        pulumi.String("name"),
    			Description: pulumi.String("test"),
    			OrgId:       pulumi.String("org_id"),
    			ProjectId:   pulumi.String("project_id"),
    			GitDetails: &platform.EnvironmentGitDetailsArgs{
    				StoreType:    pulumi.String("REMOTE"),
    				ConnectorRef: pulumi.String("connector_ref"),
    				RepoName:     pulumi.String("repo_name"),
    				FilePath:     pulumi.String("file_path"),
    				Branch:       pulumi.String("branch"),
    			},
    			Yaml: pulumi.String(`environment:
      name: env
      identifier: env
      tags:
        test: ""
      type: PreProduction
      orgIdentifier: default
      projectIdentifier: proj1
      variables:
        - name: var1
          type: String
          value: abc
          description: ""
          required: false
      overrides:
        manifests:
          - manifest:
              identifier: Manifest1
              type: Values
              spec:
                store:
                  type: Github
                  spec:
                    connectorRef: <+input>
                    gitFetchType: Branch
                    paths:
                      - .harness/
                    repoName: <+input>
                    branch: <+input>
    `),
    		})
    		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.Environment("example", new()
        {
            Identifier = "identifier",
            Name = "name",
            Description = "test",
            OrgId = "org_id",
            ProjectId = "project_id",
            GitDetails = new Harness.Platform.Inputs.EnvironmentGitDetailsArgs
            {
                StoreType = "REMOTE",
                ConnectorRef = "connector_ref",
                RepoName = "repo_name",
                FilePath = "file_path",
                Branch = "branch",
            },
            Yaml = @"environment:
      name: env
      identifier: env
      tags:
        test: """"
      type: PreProduction
      orgIdentifier: default
      projectIdentifier: proj1
      variables:
        - name: var1
          type: String
          value: abc
          description: """"
          required: false
      overrides:
        manifests:
          - manifest:
              identifier: Manifest1
              type: Values
              spec:
                store:
                  type: Github
                  spec:
                    connectorRef: <+input>
                    gitFetchType: Branch
                    paths:
                      - .harness/
                    repoName: <+input>
                    branch: <+input>
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.Environment;
    import com.pulumi.harness.platform.EnvironmentArgs;
    import com.pulumi.harness.platform.inputs.EnvironmentGitDetailsArgs;
    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 Environment("example", EnvironmentArgs.builder()
                .identifier("identifier")
                .name("name")
                .description("test")
                .orgId("org_id")
                .projectId("project_id")
                .gitDetails(EnvironmentGitDetailsArgs.builder()
                    .storeType("REMOTE")
                    .connectorRef("connector_ref")
                    .repoName("repo_name")
                    .filePath("file_path")
                    .branch("branch")
                    .build())
                .yaml("""
    environment:
      name: env
      identifier: env
      tags:
        test: ""
      type: PreProduction
      orgIdentifier: default
      projectIdentifier: proj1
      variables:
        - name: var1
          type: String
          value: abc
          description: ""
          required: false
      overrides:
        manifests:
          - manifest:
              identifier: Manifest1
              type: Values
              spec:
                store:
                  type: Github
                  spec:
                    connectorRef: <+input>
                    gitFetchType: Branch
                    paths:
                      - .harness/
                    repoName: <+input>
                    branch: <+input>
                """)
                .build());
    
        }
    }
    
    resources:
      example:
        type: harness:platform:Environment
        properties:
          identifier: identifier
          name: name
          description: test
          orgId: org_id
          projectId: project_id
          gitDetails:
            storeType: REMOTE
            connectorRef: connector_ref
            repoName: repo_name
            filePath: file_path
            branch: branch
          yaml: |
            environment:
              name: env
              identifier: env
              tags:
                test: ""
              type: PreProduction
              orgIdentifier: default
              projectIdentifier: proj1
              variables:
                - name: var1
                  type: String
                  value: abc
                  description: ""
                  required: false
              overrides:
                manifests:
                  - manifest:
                      identifier: Manifest1
                      type: Values
                      spec:
                        store:
                          type: Github
                          spec:
                            connectorRef: <+input>
                            gitFetchType: Branch
                            paths:
                              - .harness/
                            repoName: <+input>
                            branch: <+input>        
    

    Importing Environment From Git

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const example = new harness.platform.Environment("example", {
        identifier: "identifier",
        name: "name",
        type: "PreProduction",
        gitDetails: {
            storeType: "REMOTE",
            connectorRef: "connector_ref",
            repoName: "repo_name",
            filePath: "file_path",
            branch: "branch",
            importFromGit: true,
        },
    });
    
    import pulumi
    import pulumi_harness as harness
    
    example = harness.platform.Environment("example",
        identifier="identifier",
        name="name",
        type="PreProduction",
        git_details=harness.platform.EnvironmentGitDetailsArgs(
            store_type="REMOTE",
            connector_ref="connector_ref",
            repo_name="repo_name",
            file_path="file_path",
            branch="branch",
            import_from_git=True,
        ))
    
    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.NewEnvironment(ctx, "example", &platform.EnvironmentArgs{
    			Identifier: pulumi.String("identifier"),
    			Name:       pulumi.String("name"),
    			Type:       pulumi.String("PreProduction"),
    			GitDetails: &platform.EnvironmentGitDetailsArgs{
    				StoreType:     pulumi.String("REMOTE"),
    				ConnectorRef:  pulumi.String("connector_ref"),
    				RepoName:      pulumi.String("repo_name"),
    				FilePath:      pulumi.String("file_path"),
    				Branch:        pulumi.String("branch"),
    				ImportFromGit: pulumi.Bool(true),
    			},
    		})
    		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.Environment("example", new()
        {
            Identifier = "identifier",
            Name = "name",
            Type = "PreProduction",
            GitDetails = new Harness.Platform.Inputs.EnvironmentGitDetailsArgs
            {
                StoreType = "REMOTE",
                ConnectorRef = "connector_ref",
                RepoName = "repo_name",
                FilePath = "file_path",
                Branch = "branch",
                ImportFromGit = true,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.platform.Environment;
    import com.pulumi.harness.platform.EnvironmentArgs;
    import com.pulumi.harness.platform.inputs.EnvironmentGitDetailsArgs;
    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 Environment("example", EnvironmentArgs.builder()
                .identifier("identifier")
                .name("name")
                .type("PreProduction")
                .gitDetails(EnvironmentGitDetailsArgs.builder()
                    .storeType("REMOTE")
                    .connectorRef("connector_ref")
                    .repoName("repo_name")
                    .filePath("file_path")
                    .branch("branch")
                    .importFromGit("true")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: harness:platform:Environment
        properties:
          identifier: identifier
          name: name
          type: PreProduction
          gitDetails:
            storeType: REMOTE
            connectorRef: connector_ref
            repoName: repo_name
            filePath: file_path
            branch: branch
            importFromGit: 'true'
    

    Create Environment Resource

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

    Constructor syntax

    new Environment(name: string, args: EnvironmentArgs, opts?: CustomResourceOptions);
    @overload
    def Environment(resource_name: str,
                    args: EnvironmentArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def Environment(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    identifier: Optional[str] = None,
                    type: Optional[str] = None,
                    color: Optional[str] = None,
                    description: Optional[str] = None,
                    force_delete: Optional[str] = None,
                    git_details: Optional[EnvironmentGitDetailsArgs] = None,
                    name: Optional[str] = None,
                    org_id: Optional[str] = None,
                    project_id: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None,
                    yaml: Optional[str] = None)
    func NewEnvironment(ctx *Context, name string, args EnvironmentArgs, opts ...ResourceOption) (*Environment, error)
    public Environment(string name, EnvironmentArgs args, CustomResourceOptions? opts = null)
    public Environment(String name, EnvironmentArgs args)
    public Environment(String name, EnvironmentArgs args, CustomResourceOptions options)
    
    type: harness:platform:Environment
    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 EnvironmentArgs
    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 EnvironmentArgs
    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 EnvironmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EnvironmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EnvironmentArgs
    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 harnessEnvironmentResource = new Harness.Platform.Environment("harnessEnvironmentResource", new()
    {
        Identifier = "string",
        Type = "string",
        Color = "string",
        Description = "string",
        ForceDelete = "string",
        GitDetails = new Harness.Platform.Inputs.EnvironmentGitDetailsArgs
        {
            BaseBranch = "string",
            Branch = "string",
            CommitMessage = "string",
            ConnectorRef = "string",
            FilePath = "string",
            ImportFromGit = false,
            IsForceImport = false,
            IsHarnesscodeRepo = false,
            IsNewBranch = false,
            LastCommitId = "string",
            LastObjectId = "string",
            LoadFromCache = "string",
            LoadFromFallbackBranch = false,
            ParentEntityConnectorRef = "string",
            ParentEntityRepoName = "string",
            RepoName = "string",
            StoreType = "string",
        },
        Name = "string",
        OrgId = "string",
        ProjectId = "string",
        Tags = new[]
        {
            "string",
        },
        Yaml = "string",
    });
    
    example, err := platform.NewEnvironment(ctx, "harnessEnvironmentResource", &platform.EnvironmentArgs{
    	Identifier:  pulumi.String("string"),
    	Type:        pulumi.String("string"),
    	Color:       pulumi.String("string"),
    	Description: pulumi.String("string"),
    	ForceDelete: pulumi.String("string"),
    	GitDetails: &platform.EnvironmentGitDetailsArgs{
    		BaseBranch:               pulumi.String("string"),
    		Branch:                   pulumi.String("string"),
    		CommitMessage:            pulumi.String("string"),
    		ConnectorRef:             pulumi.String("string"),
    		FilePath:                 pulumi.String("string"),
    		ImportFromGit:            pulumi.Bool(false),
    		IsForceImport:            pulumi.Bool(false),
    		IsHarnesscodeRepo:        pulumi.Bool(false),
    		IsNewBranch:              pulumi.Bool(false),
    		LastCommitId:             pulumi.String("string"),
    		LastObjectId:             pulumi.String("string"),
    		LoadFromCache:            pulumi.String("string"),
    		LoadFromFallbackBranch:   pulumi.Bool(false),
    		ParentEntityConnectorRef: pulumi.String("string"),
    		ParentEntityRepoName:     pulumi.String("string"),
    		RepoName:                 pulumi.String("string"),
    		StoreType:                pulumi.String("string"),
    	},
    	Name:      pulumi.String("string"),
    	OrgId:     pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Yaml: pulumi.String("string"),
    })
    
    var harnessEnvironmentResource = new Environment("harnessEnvironmentResource", EnvironmentArgs.builder()
        .identifier("string")
        .type("string")
        .color("string")
        .description("string")
        .forceDelete("string")
        .gitDetails(EnvironmentGitDetailsArgs.builder()
            .baseBranch("string")
            .branch("string")
            .commitMessage("string")
            .connectorRef("string")
            .filePath("string")
            .importFromGit(false)
            .isForceImport(false)
            .isHarnesscodeRepo(false)
            .isNewBranch(false)
            .lastCommitId("string")
            .lastObjectId("string")
            .loadFromCache("string")
            .loadFromFallbackBranch(false)
            .parentEntityConnectorRef("string")
            .parentEntityRepoName("string")
            .repoName("string")
            .storeType("string")
            .build())
        .name("string")
        .orgId("string")
        .projectId("string")
        .tags("string")
        .yaml("string")
        .build());
    
    harness_environment_resource = harness.platform.Environment("harnessEnvironmentResource",
        identifier="string",
        type="string",
        color="string",
        description="string",
        force_delete="string",
        git_details=harness.platform.EnvironmentGitDetailsArgs(
            base_branch="string",
            branch="string",
            commit_message="string",
            connector_ref="string",
            file_path="string",
            import_from_git=False,
            is_force_import=False,
            is_harnesscode_repo=False,
            is_new_branch=False,
            last_commit_id="string",
            last_object_id="string",
            load_from_cache="string",
            load_from_fallback_branch=False,
            parent_entity_connector_ref="string",
            parent_entity_repo_name="string",
            repo_name="string",
            store_type="string",
        ),
        name="string",
        org_id="string",
        project_id="string",
        tags=["string"],
        yaml="string")
    
    const harnessEnvironmentResource = new harness.platform.Environment("harnessEnvironmentResource", {
        identifier: "string",
        type: "string",
        color: "string",
        description: "string",
        forceDelete: "string",
        gitDetails: {
            baseBranch: "string",
            branch: "string",
            commitMessage: "string",
            connectorRef: "string",
            filePath: "string",
            importFromGit: false,
            isForceImport: false,
            isHarnesscodeRepo: false,
            isNewBranch: false,
            lastCommitId: "string",
            lastObjectId: "string",
            loadFromCache: "string",
            loadFromFallbackBranch: false,
            parentEntityConnectorRef: "string",
            parentEntityRepoName: "string",
            repoName: "string",
            storeType: "string",
        },
        name: "string",
        orgId: "string",
        projectId: "string",
        tags: ["string"],
        yaml: "string",
    });
    
    type: harness:platform:Environment
    properties:
        color: string
        description: string
        forceDelete: string
        gitDetails:
            baseBranch: string
            branch: string
            commitMessage: string
            connectorRef: string
            filePath: string
            importFromGit: false
            isForceImport: false
            isHarnesscodeRepo: false
            isNewBranch: false
            lastCommitId: string
            lastObjectId: string
            loadFromCache: string
            loadFromFallbackBranch: false
            parentEntityConnectorRef: string
            parentEntityRepoName: string
            repoName: string
            storeType: string
        identifier: string
        name: string
        orgId: string
        projectId: string
        tags:
            - string
        type: string
        yaml: string
    

    Environment 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 Environment resource accepts the following input properties:

    Identifier string
    Unique identifier of the resource.
    Type string
    The type of environment. Valid values are PreProduction, Production
    Color string
    Color of the environment.
    Description string
    Description of the resource.
    ForceDelete string
    Enable this flag for force deletion of environments
    GitDetails EnvironmentGitDetails
    Contains Git Information for remote entities from Git for Create/Update/Import
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags List<string>
    Tags to associate with the resource.
    Yaml string
    Environment 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.
    Identifier string
    Unique identifier of the resource.
    Type string
    The type of environment. Valid values are PreProduction, Production
    Color string
    Color of the environment.
    Description string
    Description of the resource.
    ForceDelete string
    Enable this flag for force deletion of environments
    GitDetails EnvironmentGitDetailsArgs
    Contains Git Information for remote entities from Git for Create/Update/Import
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags []string
    Tags to associate with the resource.
    Yaml string
    Environment 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.
    identifier String
    Unique identifier of the resource.
    type String
    The type of environment. Valid values are PreProduction, Production
    color String
    Color of the environment.
    description String
    Description of the resource.
    forceDelete String
    Enable this flag for force deletion of environments
    gitDetails EnvironmentGitDetails
    Contains Git Information for remote entities from Git for Create/Update/Import
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    yaml String
    Environment 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.
    identifier string
    Unique identifier of the resource.
    type string
    The type of environment. Valid values are PreProduction, Production
    color string
    Color of the environment.
    description string
    Description of the resource.
    forceDelete string
    Enable this flag for force deletion of environments
    gitDetails EnvironmentGitDetails
    Contains Git Information for remote entities from Git for Create/Update/Import
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    tags string[]
    Tags to associate with the resource.
    yaml string
    Environment 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.
    identifier str
    Unique identifier of the resource.
    type str
    The type of environment. Valid values are PreProduction, Production
    color str
    Color of the environment.
    description str
    Description of the resource.
    force_delete str
    Enable this flag for force deletion of environments
    git_details EnvironmentGitDetailsArgs
    Contains Git Information for remote entities from Git for Create/Update/Import
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    tags Sequence[str]
    Tags to associate with the resource.
    yaml str
    Environment 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.
    identifier String
    Unique identifier of the resource.
    type String
    The type of environment. Valid values are PreProduction, Production
    color String
    Color of the environment.
    description String
    Description of the resource.
    forceDelete String
    Enable this flag for force deletion of environments
    gitDetails Property Map
    Contains Git Information for remote entities from Git for Create/Update/Import
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    yaml String
    Environment 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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Environment 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 Environment Resource

    Get an existing Environment 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?: EnvironmentState, opts?: CustomResourceOptions): Environment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            color: Optional[str] = None,
            description: Optional[str] = None,
            force_delete: Optional[str] = None,
            git_details: Optional[EnvironmentGitDetailsArgs] = None,
            identifier: Optional[str] = None,
            name: Optional[str] = None,
            org_id: Optional[str] = None,
            project_id: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            type: Optional[str] = None,
            yaml: Optional[str] = None) -> Environment
    func GetEnvironment(ctx *Context, name string, id IDInput, state *EnvironmentState, opts ...ResourceOption) (*Environment, error)
    public static Environment Get(string name, Input<string> id, EnvironmentState? state, CustomResourceOptions? opts = null)
    public static Environment get(String name, Output<String> id, EnvironmentState 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.
    The following state arguments are supported:
    Color string
    Color of the environment.
    Description string
    Description of the resource.
    ForceDelete string
    Enable this flag for force deletion of environments
    GitDetails EnvironmentGitDetails
    Contains Git Information for remote entities from Git for Create/Update/Import
    Identifier string
    Unique identifier of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags List<string>
    Tags to associate with the resource.
    Type string
    The type of environment. Valid values are PreProduction, Production
    Yaml string
    Environment 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.
    Description string
    Description of the resource.
    ForceDelete string
    Enable this flag for force deletion of environments
    GitDetails EnvironmentGitDetailsArgs
    Contains Git Information for remote entities from Git for Create/Update/Import
    Identifier string
    Unique identifier of the resource.
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    Tags []string
    Tags to associate with the resource.
    Type string
    The type of environment. Valid values are PreProduction, Production
    Yaml string
    Environment 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.
    description String
    Description of the resource.
    forceDelete String
    Enable this flag for force deletion of environments
    gitDetails EnvironmentGitDetails
    Contains Git Information for remote entities from Git for Create/Update/Import
    identifier String
    Unique identifier of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    type String
    The type of environment. Valid values are PreProduction, Production
    yaml String
    Environment 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.
    description string
    Description of the resource.
    forceDelete string
    Enable this flag for force deletion of environments
    gitDetails EnvironmentGitDetails
    Contains Git Information for remote entities from Git for Create/Update/Import
    identifier string
    Unique identifier of the resource.
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    tags string[]
    Tags to associate with the resource.
    type string
    The type of environment. Valid values are PreProduction, Production
    yaml string
    Environment 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.
    description str
    Description of the resource.
    force_delete str
    Enable this flag for force deletion of environments
    git_details EnvironmentGitDetailsArgs
    Contains Git Information for remote entities from Git for Create/Update/Import
    identifier str
    Unique identifier of the resource.
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    tags Sequence[str]
    Tags to associate with the resource.
    type str
    The type of environment. Valid values are PreProduction, Production
    yaml str
    Environment 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.
    description String
    Description of the resource.
    forceDelete String
    Enable this flag for force deletion of environments
    gitDetails Property Map
    Contains Git Information for remote entities from Git for Create/Update/Import
    identifier String
    Unique identifier of the resource.
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    tags List<String>
    Tags to associate with the resource.
    type String
    The type of environment. Valid values are PreProduction, Production
    yaml String
    Environment 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.

    Supporting Types

    EnvironmentGitDetails, EnvironmentGitDetailsArgs

    BaseBranch string
    Name of the default branch (this checks out a new branch titled by branch_name).
    Branch string
    Name of the branch.
    CommitMessage string
    message for the commit in Git Repo.
    ConnectorRef string
    Identifier of the Harness Connector used for importing entity from Git To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    FilePath string
    File path of the Entity in the repository.
    ImportFromGit bool
    Flag to set if importing from Git
    IsForceImport bool
    Flag to set if force importing from Git
    IsHarnesscodeRepo bool
    If the gitProvider is HarnessCode
    IsNewBranch bool
    If a new branch creation is requested.
    LastCommitId string
    Last commit identifier (for Git Repositories other than Github). To be provided only when updating Environment.
    LastObjectId string
    Last object identifier (for Github). To be provided only when updating Environment.
    LoadFromCache string
    If the Entity is to be fetched from cache
    LoadFromFallbackBranch bool
    Whether the file has to be get from fallback_branch.
    ParentEntityConnectorRef string
    Identifier of the Harness Connector used for CRUD operations on the Parent Entity. To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    ParentEntityRepoName string
    Name of the repository where parent entity lies.
    RepoName string
    Name of the repository.
    StoreType string
    store type of the entity.
    BaseBranch string
    Name of the default branch (this checks out a new branch titled by branch_name).
    Branch string
    Name of the branch.
    CommitMessage string
    message for the commit in Git Repo.
    ConnectorRef string
    Identifier of the Harness Connector used for importing entity from Git To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    FilePath string
    File path of the Entity in the repository.
    ImportFromGit bool
    Flag to set if importing from Git
    IsForceImport bool
    Flag to set if force importing from Git
    IsHarnesscodeRepo bool
    If the gitProvider is HarnessCode
    IsNewBranch bool
    If a new branch creation is requested.
    LastCommitId string
    Last commit identifier (for Git Repositories other than Github). To be provided only when updating Environment.
    LastObjectId string
    Last object identifier (for Github). To be provided only when updating Environment.
    LoadFromCache string
    If the Entity is to be fetched from cache
    LoadFromFallbackBranch bool
    Whether the file has to be get from fallback_branch.
    ParentEntityConnectorRef string
    Identifier of the Harness Connector used for CRUD operations on the Parent Entity. To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    ParentEntityRepoName string
    Name of the repository where parent entity lies.
    RepoName string
    Name of the repository.
    StoreType string
    store type of the entity.
    baseBranch String
    Name of the default branch (this checks out a new branch titled by branch_name).
    branch String
    Name of the branch.
    commitMessage String
    message for the commit in Git Repo.
    connectorRef String
    Identifier of the Harness Connector used for importing entity from Git To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    filePath String
    File path of the Entity in the repository.
    importFromGit Boolean
    Flag to set if importing from Git
    isForceImport Boolean
    Flag to set if force importing from Git
    isHarnesscodeRepo Boolean
    If the gitProvider is HarnessCode
    isNewBranch Boolean
    If a new branch creation is requested.
    lastCommitId String
    Last commit identifier (for Git Repositories other than Github). To be provided only when updating Environment.
    lastObjectId String
    Last object identifier (for Github). To be provided only when updating Environment.
    loadFromCache String
    If the Entity is to be fetched from cache
    loadFromFallbackBranch Boolean
    Whether the file has to be get from fallback_branch.
    parentEntityConnectorRef String
    Identifier of the Harness Connector used for CRUD operations on the Parent Entity. To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    parentEntityRepoName String
    Name of the repository where parent entity lies.
    repoName String
    Name of the repository.
    storeType String
    store type of the entity.
    baseBranch string
    Name of the default branch (this checks out a new branch titled by branch_name).
    branch string
    Name of the branch.
    commitMessage string
    message for the commit in Git Repo.
    connectorRef string
    Identifier of the Harness Connector used for importing entity from Git To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    filePath string
    File path of the Entity in the repository.
    importFromGit boolean
    Flag to set if importing from Git
    isForceImport boolean
    Flag to set if force importing from Git
    isHarnesscodeRepo boolean
    If the gitProvider is HarnessCode
    isNewBranch boolean
    If a new branch creation is requested.
    lastCommitId string
    Last commit identifier (for Git Repositories other than Github). To be provided only when updating Environment.
    lastObjectId string
    Last object identifier (for Github). To be provided only when updating Environment.
    loadFromCache string
    If the Entity is to be fetched from cache
    loadFromFallbackBranch boolean
    Whether the file has to be get from fallback_branch.
    parentEntityConnectorRef string
    Identifier of the Harness Connector used for CRUD operations on the Parent Entity. To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    parentEntityRepoName string
    Name of the repository where parent entity lies.
    repoName string
    Name of the repository.
    storeType string
    store type of the entity.
    base_branch str
    Name of the default branch (this checks out a new branch titled by branch_name).
    branch str
    Name of the branch.
    commit_message str
    message for the commit in Git Repo.
    connector_ref str
    Identifier of the Harness Connector used for importing entity from Git To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    file_path str
    File path of the Entity in the repository.
    import_from_git bool
    Flag to set if importing from Git
    is_force_import bool
    Flag to set if force importing from Git
    is_harnesscode_repo bool
    If the gitProvider is HarnessCode
    is_new_branch bool
    If a new branch creation is requested.
    last_commit_id str
    Last commit identifier (for Git Repositories other than Github). To be provided only when updating Environment.
    last_object_id str
    Last object identifier (for Github). To be provided only when updating Environment.
    load_from_cache str
    If the Entity is to be fetched from cache
    load_from_fallback_branch bool
    Whether the file has to be get from fallback_branch.
    parent_entity_connector_ref str
    Identifier of the Harness Connector used for CRUD operations on the Parent Entity. To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    parent_entity_repo_name str
    Name of the repository where parent entity lies.
    repo_name str
    Name of the repository.
    store_type str
    store type of the entity.
    baseBranch String
    Name of the default branch (this checks out a new branch titled by branch_name).
    branch String
    Name of the branch.
    commitMessage String
    message for the commit in Git Repo.
    connectorRef String
    Identifier of the Harness Connector used for importing entity from Git To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    filePath String
    File path of the Entity in the repository.
    importFromGit Boolean
    Flag to set if importing from Git
    isForceImport Boolean
    Flag to set if force importing from Git
    isHarnesscodeRepo Boolean
    If the gitProvider is HarnessCode
    isNewBranch Boolean
    If a new branch creation is requested.
    lastCommitId String
    Last commit identifier (for Git Repositories other than Github). To be provided only when updating Environment.
    lastObjectId String
    Last object identifier (for Github). To be provided only when updating Environment.
    loadFromCache String
    If the Entity is to be fetched from cache
    loadFromFallbackBranch Boolean
    Whether the file has to be get from fallback_branch.
    parentEntityConnectorRef String
    Identifier of the Harness Connector used for CRUD operations on the Parent Entity. To reference a connector at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a connector at the account scope, prefix 'account` to the expression: account.{identifier}.
    parentEntityRepoName String
    Name of the repository where parent entity lies.
    repoName String
    Name of the repository.
    storeType String
    store type of the entity.

    Import

    Import account level environment id

    $ pulumi import harness:platform/environment:Environment example <environment_id>
    

    Import org level environment id

    $ pulumi import harness:platform/environment:Environment example <org_id>/<environment_id>
    

    Import project level environment id

    $ pulumi import harness:platform/environment:Environment example <org_id>/<project_id>/<environment_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.
    harness logo
    Harness v0.2.1 published on Friday, Jul 26, 2024 by Pulumi