1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. dataworks
  5. getFolders
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.dataworks.getFolders

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

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

    NOTE: Available in v1.131.0+.

    Example Usage

    Basic Usage

    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);
    
    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)
    
    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
    		}
    		ids := pulumi.All(_default.FolderId, _default.ProjectId).ApplyT(func(_args []interface{}) (dataworks.GetFoldersResult, error) {
    			folderId := _args[0].(string)
    			projectId := _args[1].(*string)
    			return dataworks.GetFoldersOutput(ctx, dataworks.GetFoldersOutputArgs{
    				Ids: []string{
    					folderId,
    				},
    				ProjectId:        projectId,
    				ParentFolderPath: "Business Flow/tfTestAcc/folderDi",
    			}, nil), nil
    		}).(dataworks.GetFoldersResultOutput)
    		ctx.Export("dataWorksFolderId1", ids.ApplyT(func(ids dataworks.GetFoldersResult) (*string, error) {
    			return &ids.Folders[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new AliCloud.DataWorks.Folder("default", new()
        {
            ProjectId = "xxxx",
            FolderPath = "Business Flow/tfTestAcc/folderDi",
        });
    
        var ids = AliCloud.DataWorks.GetFolders.Invoke(new()
        {
            Ids = new[]
            {
                @default.FolderId,
            },
            ProjectId = @default.ProjectId,
            ParentFolderPath = "Business Flow/tfTestAcc/folderDi",
        });
    
        return new Dictionary<string, object?>
        {
            ["dataWorksFolderId1"] = ids.Apply(getFoldersResult => getFoldersResult.Folders[0]?.Id),
        };
    });
    
    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())));
        }
    }
    
    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
    File name where to save data source results (after running pulumi preview).
    ParentFolderPath string
    The parent folder path.
    ProjectId string
    The ID of the project.
    Ids []string
    A list of Folder IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    parentFolderPath String
    The parent folder path.
    projectId String
    The ID of the project.
    ids List<String>
    A list of Folder IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    parentFolderPath string
    The parent folder path.
    projectId string
    The ID of the project.
    ids string[]
    A list of Folder IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    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
    File name where to save data source results (after running pulumi preview).
    parentFolderPath String
    The parent folder path.
    projectId String
    The ID of the project.
    ids List<String>
    A list of Folder IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    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
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi