Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getFolders

This data source provides the Data Works Folders of the current Alibaba Cloud user.

NOTE: Available in v1.131.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var @default = new AliCloud.DataWorks.Folder("default", new AliCloud.DataWorks.FolderArgs
        {
            ProjectId = "xxxx",
            FolderPath = "Business Flow/tfTestAcc/folderDi",
        });
        var ids = Output.Tuple(@default.FolderId, @default.ProjectId).Apply(values =>
        {
            var folderId = values.Item1;
            var projectId = values.Item2;
            return AliCloud.DataWorks.GetFolders.Invoke(new AliCloud.DataWorks.GetFoldersInvokeArgs
            {
                Ids = 
                {
                    folderId,
                },
                ProjectId = projectId,
                ParentFolderPath = "Business Flow/tfTestAcc/folderDi",
            });
        });
        this.DataWorksFolderId1 = ids.Apply(ids => ids.Folders?[0]?.Id);
    }

    [Output("dataWorksFolderId1")]
    public Output<string> DataWorksFolderId1 { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dataworks"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dataworks.NewFolder(ctx, "default", &dataworks.FolderArgs{
			ProjectId:  pulumi.String("xxxx"),
			FolderPath: pulumi.String("Business Flow/tfTestAcc/folderDi"),
		})
		if err != nil {
			return err
		}
		ctx.Export("dataWorksFolderId1", ids.ApplyT(func(ids dataworks.GetFoldersResult) (string, error) {
			return ids.Folders[0].Id, nil
		}).(pulumi.StringOutput))
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dataworks.Folder;
import com.pulumi.alicloud.dataworks.FolderArgs;
import com.pulumi.alicloud.dataworks.DataworksFunctions;
import com.pulumi.alicloud.dataworks.inputs.GetFoldersArgs;
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 default_ = new Folder("default", FolderArgs.builder()        
            .projectId("xxxx")
            .folderPath("Business Flow/tfTestAcc/folderDi")
            .build());

        final var ids = DataworksFunctions.getFolders(GetFoldersArgs.builder()
            .ids(default_.folderId())
            .projectId(default_.projectId())
            .parentFolderPath("Business Flow/tfTestAcc/folderDi")
            .build());

        ctx.export("dataWorksFolderId1", ids.applyValue(getFoldersResult -> getFoldersResult).applyValue(ids -> ids.applyValue(getFoldersResult -> getFoldersResult.folders()[0].id())));
    }
}
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.dataworks.Folder("default",
    project_id="xxxx",
    folder_path="Business Flow/tfTestAcc/folderDi")
ids = pulumi.Output.all(default.folder_id, default.project_id).apply(lambda folder_id, project_id: alicloud.dataworks.get_folders_output(ids=[folder_id],
    project_id=project_id,
    parent_folder_path="Business Flow/tfTestAcc/folderDi"))
pulumi.export("dataWorksFolderId1", ids.folders[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const _default = new alicloud.dataworks.Folder("default", {
    projectId: "xxxx",
    folderPath: "Business Flow/tfTestAcc/folderDi",
});
const ids = pulumi.all([_default.folderId, _default.projectId]).apply(([folderId, projectId]) => alicloud.dataworks.getFoldersOutput({
    ids: [folderId],
    projectId: projectId,
    parentFolderPath: "Business Flow/tfTestAcc/folderDi",
}));
export const dataWorksFolderId1 = ids.apply(ids => ids.folders?[0]?.id);
resources:
  default:
    type: alicloud:dataworks:Folder
    properties:
      projectId: xxxx
      folderPath: Business Flow/tfTestAcc/folderDi
variables:
  ids:
    Fn::Invoke:
      Function: alicloud:dataworks:getFolders
      Arguments:
        ids:
          - ${default.folderId}
        projectId: ${default.projectId}
        parentFolderPath: Business Flow/tfTestAcc/folderDi
outputs:
  dataWorksFolderId1: ${ids.folders[0].id}

Using getFolders

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 getFolders(args: GetFoldersArgs, opts?: InvokeOptions): Promise<GetFoldersResult>
function getFoldersOutput(args: GetFoldersOutputArgs, opts?: InvokeOptions): Output<GetFoldersResult>
def get_folders(ids: Optional[Sequence[str]] = None,
                output_file: Optional[str] = None,
                parent_folder_path: Optional[str] = None,
                project_id: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetFoldersResult
def get_folders_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                output_file: Optional[pulumi.Input[str]] = None,
                parent_folder_path: Optional[pulumi.Input[str]] = None,
                project_id: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetFoldersResult]
func GetFolders(ctx *Context, args *GetFoldersArgs, opts ...InvokeOption) (*GetFoldersResult, error)
func GetFoldersOutput(ctx *Context, args *GetFoldersOutputArgs, opts ...InvokeOption) GetFoldersResultOutput

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

public static class GetFolders 
{
    public static Task<GetFoldersResult> InvokeAsync(GetFoldersArgs args, InvokeOptions? opts = null)
    public static Output<GetFoldersResult> Invoke(GetFoldersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetFoldersResult> getFolders(GetFoldersArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:dataworks/getFolders:getFolders
  Arguments:
    # Arguments dictionary

The following arguments are supported:

ParentFolderPath string

The parent folder path.

ProjectId string

The ID of the project.

Ids List<string>

A list of Folder IDs.

OutputFile string
ParentFolderPath string

The parent folder path.

ProjectId string

The ID of the project.

Ids []string

A list of Folder IDs.

OutputFile string
parentFolderPath String

The parent folder path.

projectId String

The ID of the project.

ids List<String>

A list of Folder IDs.

outputFile String
parentFolderPath string

The parent folder path.

projectId string

The ID of the project.

ids string[]

A list of Folder IDs.

outputFile string
parent_folder_path str

The parent folder path.

project_id str

The ID of the project.

ids Sequence[str]

A list of Folder IDs.

output_file str
parentFolderPath String

The parent folder path.

projectId String

The ID of the project.

ids List<String>

A list of Folder IDs.

outputFile String

getFolders Result

The following output properties are available:

Folders List<Pulumi.AliCloud.DataWorks.Outputs.GetFoldersFolder>
Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
ParentFolderPath string
ProjectId string
OutputFile string
Folders []GetFoldersFolder
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
ParentFolderPath string
ProjectId string
OutputFile string
folders List<GetFoldersFolder>
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
parentFolderPath String
projectId String
outputFile String
folders GetFoldersFolder[]
id string

The provider-assigned unique ID for this managed resource.

ids string[]
parentFolderPath string
projectId string
outputFile string
folders Sequence[GetFoldersFolder]
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
parent_folder_path str
project_id str
output_file str
folders List<Property Map>
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
parentFolderPath String
projectId String
outputFile String

Supporting Types

GetFoldersFolder

FolderId string
FolderPath string

Folder Path.

Id string

The Folder ID.

ProjectId string

The ID of the project.

FolderId string
FolderPath string

Folder Path.

Id string

The Folder ID.

ProjectId string

The ID of the project.

folderId String
folderPath String

Folder Path.

id String

The Folder ID.

projectId String

The ID of the project.

folderId string
folderPath string

Folder Path.

id string

The Folder ID.

projectId string

The ID of the project.

folder_id str
folder_path str

Folder Path.

id str

The Folder ID.

project_id str

The ID of the project.

folderId String
folderPath String

Folder Path.

id String

The Folder ID.

projectId String

The ID of the project.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.