gitlab.ProjectEnvironment
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const _this = new gitlab.Group("this", {
name: "example",
path: "example",
description: "An example group",
});
const thisProject = new gitlab.Project("this", {
name: "example",
namespaceId: _this.id,
initializeWithReadme: true,
});
const thisProjectEnvironment = new gitlab.ProjectEnvironment("this", {
project: thisProject.id,
name: "example",
externalUrl: "www.example.com",
});
import pulumi
import pulumi_gitlab as gitlab
this = gitlab.Group("this",
name="example",
path="example",
description="An example group")
this_project = gitlab.Project("this",
name="example",
namespace_id=this.id,
initialize_with_readme=True)
this_project_environment = gitlab.ProjectEnvironment("this",
project=this_project.id,
name="example",
external_url="www.example.com")
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
this, err := gitlab.NewGroup(ctx, "this", &gitlab.GroupArgs{
Name: pulumi.String("example"),
Path: pulumi.String("example"),
Description: pulumi.String("An example group"),
})
if err != nil {
return err
}
thisProject, err := gitlab.NewProject(ctx, "this", &gitlab.ProjectArgs{
Name: pulumi.String("example"),
NamespaceId: this.ID(),
InitializeWithReadme: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = gitlab.NewProjectEnvironment(ctx, "this", &gitlab.ProjectEnvironmentArgs{
Project: thisProject.ID(),
Name: pulumi.String("example"),
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 @this = new GitLab.Group("this", new()
{
Name = "example",
Path = "example",
Description = "An example group",
});
var thisProject = new GitLab.Project("this", new()
{
Name = "example",
NamespaceId = @this.Id,
InitializeWithReadme = true,
});
var thisProjectEnvironment = new GitLab.ProjectEnvironment("this", new()
{
Project = thisProject.Id,
Name = "example",
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 this_ = new Group("this", GroupArgs.builder()
.name("example")
.path("example")
.description("An example group")
.build());
var thisProject = new Project("thisProject", ProjectArgs.builder()
.name("example")
.namespaceId(this_.id())
.initializeWithReadme(true)
.build());
var thisProjectEnvironment = new ProjectEnvironment("thisProjectEnvironment", ProjectEnvironmentArgs.builder()
.project(thisProject.id())
.name("example")
.externalUrl("www.example.com")
.build());
}
}
resources:
this:
type: gitlab:Group
properties:
name: example
path: example
description: An example group
thisProject:
type: gitlab:Project
name: this
properties:
name: example
namespaceId: ${this.id}
initializeWithReadme: true
thisProjectEnvironment:
type: gitlab:ProjectEnvironment
name: this
properties:
project: ${thisProject.id}
name: example
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.
Constructor 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProjectEnvironment resource accepts the following input properties:
- Project string
- The ID or full path of the project to environment is created for.
- External
Url string - Place to link to for this environment.
- Name string
- The name of the environment.
- Stop
Before boolDestroy - 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.
- External
Url string - Place to link to for this environment.
- Name string
- The name of the environment.
- Stop
Before boolDestroy - 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.
- external
Url String - Place to link to for this environment.
- name String
- The name of the environment.
- stop
Before BooleanDestroy - 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.
- external
Url string - Place to link to for this environment.
- name string
- The name of the environment.
- stop
Before booleanDestroy - 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_ booldestroy - 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.
- external
Url String - Place to link to for this environment.
- name String
- The name of the environment.
- stop
Before BooleanDestroy - 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:
- Created
At 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
. - Updated
At string - The ISO8601 date/time that this environment was last updated at in UTC.
- Created
At 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
. - Updated
At string - The ISO8601 date/time that this environment was last updated at in UTC.
- created
At 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
. - updated
At String - The ISO8601 date/time that this environment was last updated at in UTC.
- created
At 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
. - updated
At 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.
- created
At 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
. - updated
At 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.
- Created
At string - The ISO8601 date/time that this environment was created at in UTC.
- External
Url 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
. - Stop
Before boolDestroy - Determines whether the environment is attempted to be stopped before the environment is deleted.
- Updated
At string - The ISO8601 date/time that this environment was last updated at in UTC.
- Created
At string - The ISO8601 date/time that this environment was created at in UTC.
- External
Url 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
. - Stop
Before boolDestroy - Determines whether the environment is attempted to be stopped before the environment is deleted.
- Updated
At string - The ISO8601 date/time that this environment was last updated at in UTC.
- created
At String - The ISO8601 date/time that this environment was created at in UTC.
- external
Url 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
. - stop
Before BooleanDestroy - Determines whether the environment is attempted to be stopped before the environment is deleted.
- updated
At String - The ISO8601 date/time that this environment was last updated at in UTC.
- created
At string - The ISO8601 date/time that this environment was created at in UTC.
- external
Url 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
. - stop
Before booleanDestroy - Determines whether the environment is attempted to be stopped before the environment is deleted.
- updated
At 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_ booldestroy - 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.
- created
At String - The ISO8601 date/time that this environment was created at in UTC.
- external
Url 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
. - stop
Before BooleanDestroy - Determines whether the environment is attempted to be stopped before the environment is deleted.
- updated
At 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.