1. Packages
  2. GitLab
  3. API Docs
  4. ProjectEnvironment
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

gitlab.ProjectEnvironment

Explore with Pulumi AI

gitlab logo
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    const thisGroup = new gitlab.Group("thisGroup", {
        path: "example",
        description: "An example group",
    });
    const thisProject = new gitlab.Project("thisProject", {
        namespaceId: thisGroup.id,
        initializeWithReadme: true,
    });
    const thisProjectEnvironment = new gitlab.ProjectEnvironment("thisProjectEnvironment", {
        project: thisProject.id,
        externalUrl: "www.example.com",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    this_group = gitlab.Group("thisGroup",
        path="example",
        description="An example group")
    this_project = gitlab.Project("thisProject",
        namespace_id=this_group.id,
        initialize_with_readme=True)
    this_project_environment = gitlab.ProjectEnvironment("thisProjectEnvironment",
        project=this_project.id,
        external_url="www.example.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		thisGroup, err := gitlab.NewGroup(ctx, "thisGroup", &gitlab.GroupArgs{
    			Path:        pulumi.String("example"),
    			Description: pulumi.String("An example group"),
    		})
    		if err != nil {
    			return err
    		}
    		thisProject, err := gitlab.NewProject(ctx, "thisProject", &gitlab.ProjectArgs{
    			NamespaceId:          thisGroup.ID(),
    			InitializeWithReadme: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gitlab.NewProjectEnvironment(ctx, "thisProjectEnvironment", &gitlab.ProjectEnvironmentArgs{
    			Project:     thisProject.ID(),
    			ExternalUrl: pulumi.String("www.example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using GitLab = Pulumi.GitLab;
    
    return await Deployment.RunAsync(() => 
    {
        var thisGroup = new GitLab.Group("thisGroup", new()
        {
            Path = "example",
            Description = "An example group",
        });
    
        var thisProject = new GitLab.Project("thisProject", new()
        {
            NamespaceId = thisGroup.Id,
            InitializeWithReadme = true,
        });
    
        var thisProjectEnvironment = new GitLab.ProjectEnvironment("thisProjectEnvironment", new()
        {
            Project = thisProject.Id,
            ExternalUrl = "www.example.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.Group;
    import com.pulumi.gitlab.GroupArgs;
    import com.pulumi.gitlab.Project;
    import com.pulumi.gitlab.ProjectArgs;
    import com.pulumi.gitlab.ProjectEnvironment;
    import com.pulumi.gitlab.ProjectEnvironmentArgs;
    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 thisGroup = new Group("thisGroup", GroupArgs.builder()        
                .path("example")
                .description("An example group")
                .build());
    
            var thisProject = new Project("thisProject", ProjectArgs.builder()        
                .namespaceId(thisGroup.id())
                .initializeWithReadme(true)
                .build());
    
            var thisProjectEnvironment = new ProjectEnvironment("thisProjectEnvironment", ProjectEnvironmentArgs.builder()        
                .project(thisProject.id())
                .externalUrl("www.example.com")
                .build());
    
        }
    }
    
    resources:
      thisGroup:
        type: gitlab:Group
        properties:
          path: example
          description: An example group
      thisProject:
        type: gitlab:Project
        properties:
          namespaceId: ${thisGroup.id}
          initializeWithReadme: true
      thisProjectEnvironment:
        type: gitlab:ProjectEnvironment
        properties:
          project: ${thisProject.id}
          externalUrl: www.example.com
    

    Create ProjectEnvironment Resource

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

    Constructor syntax

    new ProjectEnvironment(name: string, args: ProjectEnvironmentArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectEnvironment(resource_name: str,
                           args: ProjectEnvironmentArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectEnvironment(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           project: Optional[str] = None,
                           external_url: Optional[str] = None,
                           name: Optional[str] = None,
                           stop_before_destroy: Optional[bool] = None)
    func NewProjectEnvironment(ctx *Context, name string, args ProjectEnvironmentArgs, opts ...ResourceOption) (*ProjectEnvironment, error)
    public ProjectEnvironment(string name, ProjectEnvironmentArgs args, CustomResourceOptions? opts = null)
    public ProjectEnvironment(String name, ProjectEnvironmentArgs args)
    public ProjectEnvironment(String name, ProjectEnvironmentArgs args, CustomResourceOptions options)
    
    type: gitlab:ProjectEnvironment
    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 ProjectEnvironmentArgs
    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 ProjectEnvironmentArgs
    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 ProjectEnvironmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectEnvironmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectEnvironmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var projectEnvironmentResource = new GitLab.ProjectEnvironment("projectEnvironmentResource", new()
    {
        Project = "string",
        ExternalUrl = "string",
        Name = "string",
        StopBeforeDestroy = false,
    });
    
    example, err := gitlab.NewProjectEnvironment(ctx, "projectEnvironmentResource", &gitlab.ProjectEnvironmentArgs{
    	Project:           pulumi.String("string"),
    	ExternalUrl:       pulumi.String("string"),
    	Name:              pulumi.String("string"),
    	StopBeforeDestroy: pulumi.Bool(false),
    })
    
    var projectEnvironmentResource = new ProjectEnvironment("projectEnvironmentResource", ProjectEnvironmentArgs.builder()        
        .project("string")
        .externalUrl("string")
        .name("string")
        .stopBeforeDestroy(false)
        .build());
    
    project_environment_resource = gitlab.ProjectEnvironment("projectEnvironmentResource",
        project="string",
        external_url="string",
        name="string",
        stop_before_destroy=False)
    
    const projectEnvironmentResource = new gitlab.ProjectEnvironment("projectEnvironmentResource", {
        project: "string",
        externalUrl: "string",
        name: "string",
        stopBeforeDestroy: false,
    });
    
    type: gitlab:ProjectEnvironment
    properties:
        externalUrl: string
        name: string
        project: string
        stopBeforeDestroy: false
    

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

    Project string
    The ID or full path of the project to environment is created for.
    ExternalUrl string
    Place to link to for this environment.
    Name string
    The name of the environment.
    StopBeforeDestroy bool
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    Project string
    The ID or full path of the project to environment is created for.
    ExternalUrl string
    Place to link to for this environment.
    Name string
    The name of the environment.
    StopBeforeDestroy bool
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    project String
    The ID or full path of the project to environment is created for.
    externalUrl String
    Place to link to for this environment.
    name String
    The name of the environment.
    stopBeforeDestroy Boolean
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    project string
    The ID or full path of the project to environment is created for.
    externalUrl string
    Place to link to for this environment.
    name string
    The name of the environment.
    stopBeforeDestroy boolean
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    project str
    The ID or full path of the project to environment is created for.
    external_url str
    Place to link to for this environment.
    name str
    The name of the environment.
    stop_before_destroy bool
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    project String
    The ID or full path of the project to environment is created for.
    externalUrl String
    Place to link to for this environment.
    name String
    The name of the environment.
    stopBeforeDestroy Boolean
    Determines whether the environment is attempted to be stopped before the environment is deleted.

    Outputs

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

    CreatedAt string
    The ISO8601 date/time that this environment was created at in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    Slug string
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    State string
    State the environment is in. Valid values are available, stopped.
    UpdatedAt string
    The ISO8601 date/time that this environment was last updated at in UTC.
    CreatedAt string
    The ISO8601 date/time that this environment was created at in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    Slug string
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    State string
    State the environment is in. Valid values are available, stopped.
    UpdatedAt string
    The ISO8601 date/time that this environment was last updated at in UTC.
    createdAt String
    The ISO8601 date/time that this environment was created at in UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    slug String
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    state String
    State the environment is in. Valid values are available, stopped.
    updatedAt String
    The ISO8601 date/time that this environment was last updated at in UTC.
    createdAt string
    The ISO8601 date/time that this environment was created at in UTC.
    id string
    The provider-assigned unique ID for this managed resource.
    slug string
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    state string
    State the environment is in. Valid values are available, stopped.
    updatedAt string
    The ISO8601 date/time that this environment was last updated at in UTC.
    created_at str
    The ISO8601 date/time that this environment was created at in UTC.
    id str
    The provider-assigned unique ID for this managed resource.
    slug str
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    state str
    State the environment is in. Valid values are available, stopped.
    updated_at str
    The ISO8601 date/time that this environment was last updated at in UTC.
    createdAt String
    The ISO8601 date/time that this environment was created at in UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    slug String
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    state String
    State the environment is in. Valid values are available, stopped.
    updatedAt String
    The ISO8601 date/time that this environment was last updated at in UTC.

    Look up Existing ProjectEnvironment Resource

    Get an existing ProjectEnvironment 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?: ProjectEnvironmentState, opts?: CustomResourceOptions): ProjectEnvironment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            external_url: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            slug: Optional[str] = None,
            state: Optional[str] = None,
            stop_before_destroy: Optional[bool] = None,
            updated_at: Optional[str] = None) -> ProjectEnvironment
    func GetProjectEnvironment(ctx *Context, name string, id IDInput, state *ProjectEnvironmentState, opts ...ResourceOption) (*ProjectEnvironment, error)
    public static ProjectEnvironment Get(string name, Input<string> id, ProjectEnvironmentState? state, CustomResourceOptions? opts = null)
    public static ProjectEnvironment get(String name, Output<String> id, ProjectEnvironmentState 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:
    CreatedAt string
    The ISO8601 date/time that this environment was created at in UTC.
    ExternalUrl string
    Place to link to for this environment.
    Name string
    The name of the environment.
    Project string
    The ID or full path of the project to environment is created for.
    Slug string
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    State string
    State the environment is in. Valid values are available, stopped.
    StopBeforeDestroy bool
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    UpdatedAt string
    The ISO8601 date/time that this environment was last updated at in UTC.
    CreatedAt string
    The ISO8601 date/time that this environment was created at in UTC.
    ExternalUrl string
    Place to link to for this environment.
    Name string
    The name of the environment.
    Project string
    The ID or full path of the project to environment is created for.
    Slug string
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    State string
    State the environment is in. Valid values are available, stopped.
    StopBeforeDestroy bool
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    UpdatedAt string
    The ISO8601 date/time that this environment was last updated at in UTC.
    createdAt String
    The ISO8601 date/time that this environment was created at in UTC.
    externalUrl String
    Place to link to for this environment.
    name String
    The name of the environment.
    project String
    The ID or full path of the project to environment is created for.
    slug String
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    state String
    State the environment is in. Valid values are available, stopped.
    stopBeforeDestroy Boolean
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    updatedAt String
    The ISO8601 date/time that this environment was last updated at in UTC.
    createdAt string
    The ISO8601 date/time that this environment was created at in UTC.
    externalUrl string
    Place to link to for this environment.
    name string
    The name of the environment.
    project string
    The ID or full path of the project to environment is created for.
    slug string
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    state string
    State the environment is in. Valid values are available, stopped.
    stopBeforeDestroy boolean
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    updatedAt string
    The ISO8601 date/time that this environment was last updated at in UTC.
    created_at str
    The ISO8601 date/time that this environment was created at in UTC.
    external_url str
    Place to link to for this environment.
    name str
    The name of the environment.
    project str
    The ID or full path of the project to environment is created for.
    slug str
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    state str
    State the environment is in. Valid values are available, stopped.
    stop_before_destroy bool
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    updated_at str
    The ISO8601 date/time that this environment was last updated at in UTC.
    createdAt String
    The ISO8601 date/time that this environment was created at in UTC.
    externalUrl String
    Place to link to for this environment.
    name String
    The name of the environment.
    project String
    The ID or full path of the project to environment is created for.
    slug String
    The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.
    state String
    State the environment is in. Valid values are available, stopped.
    stopBeforeDestroy Boolean
    Determines whether the environment is attempted to be stopped before the environment is deleted.
    updatedAt String
    The ISO8601 date/time that this environment was last updated at in UTC.

    Import

    GitLab project environments can be imported using an id made up of projectId:environmenId, e.g.

    $ pulumi import gitlab:index/projectEnvironment:ProjectEnvironment bar 123:321
    

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

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi