1. Packages
  2. Ucloud Provider
  3. API Docs
  4. getProjects
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.getProjects

Explore with Pulumi AI

This data source providers a list of projects owned by user according to finance permission and name.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";

const example = ucloud.getProjects({
    isFinance: false,
});
export const first = example.then(example => example.projects?.[0]?.id);
Copy
import pulumi
import pulumi_ucloud as ucloud

example = ucloud.get_projects(is_finance=False)
pulumi.export("first", example.projects[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := ucloud.GetProjects(ctx, &ucloud.GetProjectsArgs{
			IsFinance: pulumi.BoolRef(false),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("first", example.Projects[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;

return await Deployment.RunAsync(() => 
{
    var example = Ucloud.GetProjects.Invoke(new()
    {
        IsFinance = false,
    });

    return new Dictionary<string, object?>
    {
        ["first"] = example.Apply(getProjectsResult => getProjectsResult.Projects[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.UcloudFunctions;
import com.pulumi.ucloud.inputs.GetProjectsArgs;
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) {
        final var example = UcloudFunctions.getProjects(GetProjectsArgs.builder()
            .isFinance(false)
            .build());

        ctx.export("first", example.applyValue(getProjectsResult -> getProjectsResult.projects()[0].id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ucloud:getProjects
      arguments:
        isFinance: false
outputs:
  first: ${example.projects[0].id}
Copy

Using getProjects

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>
function getProjectsOutput(args: GetProjectsOutputArgs, opts?: InvokeOptions): Output<GetProjectsResult>
Copy
def get_projects(id: Optional[str] = None,
                 is_finance: Optional[bool] = None,
                 name_regex: Optional[str] = None,
                 output_file: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetProjectsResult
def get_projects_output(id: Optional[pulumi.Input[str]] = None,
                 is_finance: Optional[pulumi.Input[bool]] = None,
                 name_regex: Optional[pulumi.Input[str]] = None,
                 output_file: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetProjectsResult]
Copy
func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)
func GetProjectsOutput(ctx *Context, args *GetProjectsOutputArgs, opts ...InvokeOption) GetProjectsResultOutput
Copy

> Note: This function is named GetProjects in the Go SDK.

public static class GetProjects 
{
    public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
    public static Output<GetProjectsResult> Invoke(GetProjectsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
public static Output<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ucloud:index/getProjects:getProjects
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id string
The ID of project defined.
IsFinance bool
To identify if the current account is granted with financial permission.
NameRegex string
A regex string to filter resulting projects by name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Id string
The ID of project defined.
IsFinance bool
To identify if the current account is granted with financial permission.
NameRegex string
A regex string to filter resulting projects by name.
OutputFile string
File name where to save data source results (after running pulumi preview).
id String
The ID of project defined.
isFinance Boolean
To identify if the current account is granted with financial permission.
nameRegex String
A regex string to filter resulting projects by name.
outputFile String
File name where to save data source results (after running pulumi preview).
id string
The ID of project defined.
isFinance boolean
To identify if the current account is granted with financial permission.
nameRegex string
A regex string to filter resulting projects by name.
outputFile string
File name where to save data source results (after running pulumi preview).
id str
The ID of project defined.
is_finance bool
To identify if the current account is granted with financial permission.
name_regex str
A regex string to filter resulting projects by name.
output_file str
File name where to save data source results (after running pulumi preview).
id String
The ID of project defined.
isFinance Boolean
To identify if the current account is granted with financial permission.
nameRegex String
A regex string to filter resulting projects by name.
outputFile String
File name where to save data source results (after running pulumi preview).

getProjects Result

The following output properties are available:

Id string
The ID of project defined.
Projects List<GetProjectsProject>
It is a nested type which documented below.
TotalCount double
Total number of projects that satisfy the condition.
IsFinance bool
NameRegex string
OutputFile string
Id string
The ID of project defined.
Projects []GetProjectsProject
It is a nested type which documented below.
TotalCount float64
Total number of projects that satisfy the condition.
IsFinance bool
NameRegex string
OutputFile string
id String
The ID of project defined.
projects List<GetProjectsProject>
It is a nested type which documented below.
totalCount Double
Total number of projects that satisfy the condition.
isFinance Boolean
nameRegex String
outputFile String
id string
The ID of project defined.
projects GetProjectsProject[]
It is a nested type which documented below.
totalCount number
Total number of projects that satisfy the condition.
isFinance boolean
nameRegex string
outputFile string
id str
The ID of project defined.
projects Sequence[GetProjectsProject]
It is a nested type which documented below.
total_count float
Total number of projects that satisfy the condition.
is_finance bool
name_regex str
output_file str
id String
The ID of project defined.
projects List<Property Map>
It is a nested type which documented below.
totalCount Number
Total number of projects that satisfy the condition.
isFinance Boolean
nameRegex String
outputFile String

Supporting Types

GetProjectsProject

CreateTime This property is required. string
The time of creation for instance, formatted in RFC3339 time string.
Id This property is required. string
The ID of project defined.
MemberCount This property is required. double
The number of members belongs to the defined project.
Name This property is required. string
The name of the defined project.
ParentId This property is required. string
The ID of the parent project where the sub project belongs to.
ParentName This property is required. string
The name of the parent project where the sub project belongs to.
ResourceCount This property is required. double
The number of the resounce instance belong/s to the defined project.
CreateTime This property is required. string
The time of creation for instance, formatted in RFC3339 time string.
Id This property is required. string
The ID of project defined.
MemberCount This property is required. float64
The number of members belongs to the defined project.
Name This property is required. string
The name of the defined project.
ParentId This property is required. string
The ID of the parent project where the sub project belongs to.
ParentName This property is required. string
The name of the parent project where the sub project belongs to.
ResourceCount This property is required. float64
The number of the resounce instance belong/s to the defined project.
createTime This property is required. String
The time of creation for instance, formatted in RFC3339 time string.
id This property is required. String
The ID of project defined.
memberCount This property is required. Double
The number of members belongs to the defined project.
name This property is required. String
The name of the defined project.
parentId This property is required. String
The ID of the parent project where the sub project belongs to.
parentName This property is required. String
The name of the parent project where the sub project belongs to.
resourceCount This property is required. Double
The number of the resounce instance belong/s to the defined project.
createTime This property is required. string
The time of creation for instance, formatted in RFC3339 time string.
id This property is required. string
The ID of project defined.
memberCount This property is required. number
The number of members belongs to the defined project.
name This property is required. string
The name of the defined project.
parentId This property is required. string
The ID of the parent project where the sub project belongs to.
parentName This property is required. string
The name of the parent project where the sub project belongs to.
resourceCount This property is required. number
The number of the resounce instance belong/s to the defined project.
create_time This property is required. str
The time of creation for instance, formatted in RFC3339 time string.
id This property is required. str
The ID of project defined.
member_count This property is required. float
The number of members belongs to the defined project.
name This property is required. str
The name of the defined project.
parent_id This property is required. str
The ID of the parent project where the sub project belongs to.
parent_name This property is required. str
The name of the parent project where the sub project belongs to.
resource_count This property is required. float
The number of the resounce instance belong/s to the defined project.
createTime This property is required. String
The time of creation for instance, formatted in RFC3339 time string.
id This property is required. String
The ID of project defined.
memberCount This property is required. Number
The number of members belongs to the defined project.
name This property is required. String
The name of the defined project.
parentId This property is required. String
The ID of the parent project where the sub project belongs to.
parentName This property is required. String
The name of the parent project where the sub project belongs to.
resourceCount This property is required. Number
The number of the resounce instance belong/s to the defined project.

Package Details

Repository
ucloud ucloud/terraform-provider-ucloud
License
Notes
This Pulumi package is based on the ucloud Terraform Provider.