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);
import pulumi
import pulumi_ucloud as ucloud
example = ucloud.get_projects(is_finance=False)
pulumi.export("first", example.projects[0].id)
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
	})
}
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),
    };
});
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()));
    }
}
variables:
  example:
    fn::invoke:
      function: ucloud:getProjects
      arguments:
        isFinance: false
outputs:
  first: ${example.projects[0].id}
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>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]func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)
func GetProjectsOutput(ctx *Context, args *GetProjectsOutputArgs, opts ...InvokeOption) GetProjectsResultOutput> 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)
}public static CompletableFuture<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
public static Output<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
fn::invoke:
  function: ucloud:index/getProjects:getProjects
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Id string
 - The ID of project defined.
 - Is
Finance bool - To identify if the current account is granted with financial permission.
 - Name
Regex string - A regex string to filter resulting projects by name.
 - Output
File string - File name where to save data source results (after running 
pulumi preview). 
- Id string
 - The ID of project defined.
 - Is
Finance bool - To identify if the current account is granted with financial permission.
 - Name
Regex string - A regex string to filter resulting projects by name.
 - Output
File string - File name where to save data source results (after running 
pulumi preview). 
- id String
 - The ID of project defined.
 - is
Finance Boolean - To identify if the current account is granted with financial permission.
 - name
Regex String - A regex string to filter resulting projects by name.
 - output
File String - File name where to save data source results (after running 
pulumi preview). 
- id string
 - The ID of project defined.
 - is
Finance boolean - To identify if the current account is granted with financial permission.
 - name
Regex string - A regex string to filter resulting projects by name.
 - output
File 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.
 - is
Finance Boolean - To identify if the current account is granted with financial permission.
 - name
Regex String - A regex string to filter resulting projects by name.
 - output
File 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<Get
Projects Project>  - It is a nested type which documented below.
 - Total
Count double - Total number of projects that satisfy the condition.
 - Is
Finance bool - Name
Regex string - Output
File string 
- Id string
 - The ID of project defined.
 - Projects
[]Get
Projects Project  - It is a nested type which documented below.
 - Total
Count float64 - Total number of projects that satisfy the condition.
 - Is
Finance bool - Name
Regex string - Output
File string 
- id String
 - The ID of project defined.
 - projects
List<Get
Projects Project>  - It is a nested type which documented below.
 - total
Count Double - Total number of projects that satisfy the condition.
 - is
Finance Boolean - name
Regex String - output
File String 
- id string
 - The ID of project defined.
 - projects
Get
Projects Project[]  - It is a nested type which documented below.
 - total
Count number - Total number of projects that satisfy the condition.
 - is
Finance boolean - name
Regex string - output
File string 
- id str
 - The ID of project defined.
 - projects
Sequence[Get
Projects Project]  - 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.
 - total
Count Number - Total number of projects that satisfy the condition.
 - is
Finance Boolean - name
Regex String - output
File String 
Supporting Types
GetProjectsProject  
- Create
Time string - The time of creation for instance, formatted in RFC3339 time string.
 - Id string
 - The ID of project defined.
 - Member
Count double - The number of members belongs to the defined project.
 - Name string
 - The name of the defined project.
 - Parent
Id string - The ID of the parent project where the sub project belongs to.
 - Parent
Name string - The name of the parent project where the sub project belongs to.
 - Resource
Count double - The number of the resounce instance belong/s to the defined project.
 
- Create
Time string - The time of creation for instance, formatted in RFC3339 time string.
 - Id string
 - The ID of project defined.
 - Member
Count float64 - The number of members belongs to the defined project.
 - Name string
 - The name of the defined project.
 - Parent
Id string - The ID of the parent project where the sub project belongs to.
 - Parent
Name string - The name of the parent project where the sub project belongs to.
 - Resource
Count float64 - The number of the resounce instance belong/s to the defined project.
 
- create
Time String - The time of creation for instance, formatted in RFC3339 time string.
 - id String
 - The ID of project defined.
 - member
Count Double - The number of members belongs to the defined project.
 - name String
 - The name of the defined project.
 - parent
Id String - The ID of the parent project where the sub project belongs to.
 - parent
Name String - The name of the parent project where the sub project belongs to.
 - resource
Count Double - The number of the resounce instance belong/s to the defined project.
 
- create
Time string - The time of creation for instance, formatted in RFC3339 time string.
 - id string
 - The ID of project defined.
 - member
Count number - The number of members belongs to the defined project.
 - name string
 - The name of the defined project.
 - parent
Id string - The ID of the parent project where the sub project belongs to.
 - parent
Name string - The name of the parent project where the sub project belongs to.
 - resource
Count number - The number of the resounce instance belong/s to the defined project.
 
- create_
time str - The time of creation for instance, formatted in RFC3339 time string.
 - id str
 - The ID of project defined.
 - member_
count float - The number of members belongs to the defined project.
 - name str
 - The name of the defined project.
 - parent_
id str - The ID of the parent project where the sub project belongs to.
 - parent_
name str - The name of the parent project where the sub project belongs to.
 - resource_
count float - The number of the resounce instance belong/s to the defined project.
 
- create
Time String - The time of creation for instance, formatted in RFC3339 time string.
 - id String
 - The ID of project defined.
 - member
Count Number - The number of members belongs to the defined project.
 - name String
 - The name of the defined project.
 - parent
Id String - The ID of the parent project where the sub project belongs to.
 - parent
Name String - The name of the parent project where the sub project belongs to.
 - resource
Count 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 
ucloudTerraform Provider.