Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.dataworks.getFolders
Explore with Pulumi AI
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:
- Parent
Folder stringPath - The parent folder path.
- Project
Id string - The ID of the project.
- Ids List<string>
- A list of Folder IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Parent
Folder stringPath - The parent folder path.
- Project
Id string - The ID of the project.
- Ids []string
- A list of Folder IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- parent
Folder StringPath - The parent folder path.
- project
Id String - The ID of the project.
- ids List<String>
- A list of Folder IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- parent
Folder stringPath - The parent folder path.
- project
Id string - The ID of the project.
- ids string[]
- A list of Folder IDs.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- parent_
folder_ strpath - 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
).
- parent
Folder StringPath - The parent folder path.
- project
Id String - The ID of the project.
- ids List<String>
- A list of Folder IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getFolders Result
The following output properties are available:
- Folders
List<Pulumi.
Ali Cloud. Data Works. Outputs. Get Folders Folder> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Parent
Folder stringPath - Project
Id string - Output
File string
- Folders
[]Get
Folders Folder - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Parent
Folder stringPath - Project
Id string - Output
File string
- folders
List<Get
Folders Folder> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- parent
Folder StringPath - project
Id String - output
File String
- folders
Get
Folders Folder[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- parent
Folder stringPath - project
Id string - output
File string
- folders
Sequence[Get
Folders Folder] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- parent_
folder_ strpath - project_
id str - output_
file str
- folders List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- parent
Folder StringPath - project
Id String - output
File String
Supporting Types
GetFoldersFolder
- Folder
Id string - Folder
Path string - Folder Path.
- Id string
- The Folder ID.
- Project
Id string - The ID of the project.
- Folder
Id string - Folder
Path string - Folder Path.
- Id string
- The Folder ID.
- Project
Id string - The ID of the project.
- folder
Id String - folder
Path String - Folder Path.
- id String
- The Folder ID.
- project
Id String - The ID of the project.
- folder
Id string - folder
Path string - Folder Path.
- id string
- The Folder ID.
- project
Id 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.
- folder
Id String - folder
Path String - Folder Path.
- id String
- The Folder ID.
- project
Id 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.