1. Packages
  2. Azuredevops Provider
  3. API Docs
  4. Environment
Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi

azuredevops.Environment

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi

    Manages an Environment.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = new azuredevops.Project("example", {
        name: "Example Project",
        workItemTemplate: "Agile",
        versionControl: "Git",
        visibility: "private",
        description: "Managed by Terraform",
    });
    const exampleEnvironment = new azuredevops.Environment("example", {
        projectId: example.id,
        name: "Example Environment",
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.Project("example",
        name="Example Project",
        work_item_template="Agile",
        version_control="Git",
        visibility="private",
        description="Managed by Terraform")
    example_environment = azuredevops.Environment("example",
        project_id=example.id,
        name="Example Environment")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
    			Name:             pulumi.String("Example Project"),
    			WorkItemTemplate: pulumi.String("Agile"),
    			VersionControl:   pulumi.String("Git"),
    			Visibility:       pulumi.String("private"),
    			Description:      pulumi.String("Managed by Terraform"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = azuredevops.NewEnvironment(ctx, "example", &azuredevops.EnvironmentArgs{
    			ProjectId: example.ID(),
    			Name:      pulumi.String("Example Environment"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureDevOps.Project("example", new()
        {
            Name = "Example Project",
            WorkItemTemplate = "Agile",
            VersionControl = "Git",
            Visibility = "private",
            Description = "Managed by Terraform",
        });
    
        var exampleEnvironment = new AzureDevOps.Environment("example", new()
        {
            ProjectId = example.Id,
            Name = "Example Environment",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.Environment;
    import com.pulumi.azuredevops.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 Project("example", ProjectArgs.builder()
                .name("Example Project")
                .workItemTemplate("Agile")
                .versionControl("Git")
                .visibility("private")
                .description("Managed by Terraform")
                .build());
    
            var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()
                .projectId(example.id())
                .name("Example Environment")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azuredevops:Project
        properties:
          name: Example Project
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Terraform
      exampleEnvironment:
        type: azuredevops:Environment
        name: example
        properties:
          projectId: ${example.id}
          name: Example Environment
    

    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,
                    project_id: Optional[str] = None,
                    description: Optional[str] = None,
                    name: 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: azuredevops: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 environmentResource = new AzureDevOps.Environment("environmentResource", new()
    {
        ProjectId = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := azuredevops.NewEnvironment(ctx, "environmentResource", &azuredevops.EnvironmentArgs{
    	ProjectId:   pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var environmentResource = new Environment("environmentResource", EnvironmentArgs.builder()
        .projectId("string")
        .description("string")
        .name("string")
        .build());
    
    environment_resource = azuredevops.Environment("environmentResource",
        project_id="string",
        description="string",
        name="string")
    
    const environmentResource = new azuredevops.Environment("environmentResource", {
        projectId: "string",
        description: "string",
        name: "string",
    });
    
    type: azuredevops:Environment
    properties:
        description: string
        name: string
        projectId: 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

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

    The Environment resource accepts the following input properties:

    ProjectId string
    The ID of the project. Changing this forces a new Environment to be created.
    Description string
    A description for the Environment.
    Name string
    The name which should be used for this Environment.
    ProjectId string
    The ID of the project. Changing this forces a new Environment to be created.
    Description string
    A description for the Environment.
    Name string
    The name which should be used for this Environment.
    projectId String
    The ID of the project. Changing this forces a new Environment to be created.
    description String
    A description for the Environment.
    name String
    The name which should be used for this Environment.
    projectId string
    The ID of the project. Changing this forces a new Environment to be created.
    description string
    A description for the Environment.
    name string
    The name which should be used for this Environment.
    project_id str
    The ID of the project. Changing this forces a new Environment to be created.
    description str
    A description for the Environment.
    name str
    The name which should be used for this Environment.
    projectId String
    The ID of the project. Changing this forces a new Environment to be created.
    description String
    A description for the Environment.
    name String
    The name which should be used for this Environment.

    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,
            description: Optional[str] = None,
            name: Optional[str] = None,
            project_id: 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:
    Description string
    A description for the Environment.
    Name string
    The name which should be used for this Environment.
    ProjectId string
    The ID of the project. Changing this forces a new Environment to be created.
    Description string
    A description for the Environment.
    Name string
    The name which should be used for this Environment.
    ProjectId string
    The ID of the project. Changing this forces a new Environment to be created.
    description String
    A description for the Environment.
    name String
    The name which should be used for this Environment.
    projectId String
    The ID of the project. Changing this forces a new Environment to be created.
    description string
    A description for the Environment.
    name string
    The name which should be used for this Environment.
    projectId string
    The ID of the project. Changing this forces a new Environment to be created.
    description str
    A description for the Environment.
    name str
    The name which should be used for this Environment.
    project_id str
    The ID of the project. Changing this forces a new Environment to be created.
    description String
    A description for the Environment.
    name String
    The name which should be used for this Environment.
    projectId String
    The ID of the project. Changing this forces a new Environment to be created.

    Import

    Azure DevOps Environments can be imported using the project ID and environment ID, e.g.:

    $ pulumi import azuredevops:index/environment:Environment example 00000000-0000-0000-0000-000000000000/0
    

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

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi