get Project Environments
The gitlab.getProjectEnvironments
data source retrieves information about all environments of the given project. Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const thisProject = new gitlab.Project("this", {
name: "example",
initializeWithReadme: true,
});
const _this = gitlab.getProjectEnvironmentsOutput({
project: thisProject.pathWithNamespace,
});
import pulumi
import pulumi_gitlab as gitlab
this_project = gitlab.Project("this",
name="example",
initialize_with_readme=True)
this = gitlab.get_project_environments_output(project=this_project.path_with_namespace)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var thisProject = new GitLab.Project("this", new()
{
Name = "example",
InitializeWithReadme = true,
});
var @this = GitLab.GetProjectEnvironments.Invoke(new()
{
Project = thisProject.PathWithNamespace,
});
});
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 {
thisProject, err := gitlab.NewProject(ctx, "this", &gitlab.ProjectArgs{
Name: pulumi.String("example"),
InitializeWithReadme: pulumi.Bool(true),
})
if err != nil {
return err
}
_ = gitlab.GetProjectEnvironmentsOutput(ctx, gitlab.GetProjectEnvironmentsOutputArgs{
Project: thisProject.PathWithNamespace,
}, nil)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetProjectEnvironmentsArgs;
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 thisProject = new Project("thisProject", ProjectArgs.builder()
.name("example")
.initializeWithReadme(true)
.build());
final var this = GitlabFunctions.getProjectEnvironments(GetProjectEnvironmentsArgs.builder()
.project(thisProject.pathWithNamespace())
.build());
}
}
resources:
thisProject:
type: gitlab:Project
name: this
properties:
name: example
initializeWithReadme: true
variables:
this:
fn::invoke:
function: gitlab:getProjectEnvironments
arguments:
project: ${thisProject.pathWithNamespace}
Return
A collection of values returned by getProjectEnvironments.
Parameters
A collection of arguments for invoking getProjectEnvironments.
Return
A collection of values returned by getProjectEnvironments.
Parameters
Return the environment with this name. Mutually exclusive with search.
The ID or full path of the project.
Return list of environments matching the search criteria. Mutually exclusive with name. Must be at least 3 characters long.
List all environments that match the specified state. Valid values are available
, stopping
, stopped
. Returns all environments if not set.
See also
Return
A collection of values returned by getProjectEnvironments.
Parameters
Builder for com.pulumi.gitlab.kotlin.inputs.GetProjectEnvironmentsPlainArgs.