getGatewayFileShares

This data source provides the Cloud Storage Gateway Gateway File Shares of the current Alibaba Cloud user.

NOTE: Available in v1.144.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.cloudstoragegateway.getGatewayFileShares({
gatewayId: "example_value",
ids: [
"example_value-1",
"example_value-2",
],
});
export const cloudStorageGatewayGatewayFileShareId1 = ids.then(ids => ids.shares?.[0]?.id);
const nameRegex = alicloud.cloudstoragegateway.getGatewayFileShares({
gatewayId: "example_value",
nameRegex: "^my-GatewayFileShare",
});
export const cloudStorageGatewayGatewayFileShareId2 = nameRegex.then(nameRegex => nameRegex.shares?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.cloudstoragegateway.get_gateway_file_shares(gateway_id="example_value",
ids=[
"example_value-1",
"example_value-2",
])
pulumi.export("cloudStorageGatewayGatewayFileShareId1", ids.shares[0].id)
name_regex = alicloud.cloudstoragegateway.get_gateway_file_shares(gateway_id="example_value",
name_regex="^my-GatewayFileShare")
pulumi.export("cloudStorageGatewayGatewayFileShareId2", name_regex.shares[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.CloudStorageGateway.GetGatewayFileShares.Invoke(new()
{
GatewayId = "example_value",
Ids = new[]
{
"example_value-1",
"example_value-2",
},
});
var nameRegex = AliCloud.CloudStorageGateway.GetGatewayFileShares.Invoke(new()
{
GatewayId = "example_value",
NameRegex = "^my-GatewayFileShare",
});
return new Dictionary<string, object?>
{
["cloudStorageGatewayGatewayFileShareId1"] = ids&#46;Apply(getGatewayFileSharesResult => getGatewayFileSharesResult&#46;Shares[0]?.Id),
["cloudStorageGatewayGatewayFileShareId2"] = nameRegex&#46;Apply(getGatewayFileSharesResult => getGatewayFileSharesResult&#46;Shares[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudstoragegateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := cloudstoragegateway.GetGatewayFileShares(ctx, &cloudstoragegateway.GetGatewayFileSharesArgs{
GatewayId: "example_value",
Ids: []string{
"example_value-1",
"example_value-2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("cloudStorageGatewayGatewayFileShareId1", ids.Shares[0].Id)
nameRegex, err := cloudstoragegateway.GetGatewayFileShares(ctx, &cloudstoragegateway.GetGatewayFileSharesArgs{
GatewayId: "example_value",
NameRegex: pulumi.StringRef("^my-GatewayFileShare"),
}, nil)
if err != nil {
return err
}
ctx.Export("cloudStorageGatewayGatewayFileShareId2", nameRegex.Shares[0].Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cloudstoragegateway.CloudstoragegatewayFunctions;
import com.pulumi.alicloud.cloudstoragegateway.inputs.GetGatewayFileSharesArgs;
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 ids = CloudstoragegatewayFunctions.getGatewayFileShares(GetGatewayFileSharesArgs.builder()
.gatewayId("example_value")
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("cloudStorageGatewayGatewayFileShareId1", ids.shares()[0].id());
final var nameRegex = CloudstoragegatewayFunctions.getGatewayFileShares(GetGatewayFileSharesArgs.builder()
.gatewayId("example_value")
.nameRegex("^my-GatewayFileShare")
.build());
ctx.export("cloudStorageGatewayGatewayFileShareId2", nameRegex.shares()[0].id());
}
}
variables:
ids:
fn::invoke:
function: alicloud:cloudstoragegateway:getGatewayFileShares
arguments:
gatewayId: example_value
ids:
- example_value-1
- example_value-2
nameRegex:
fn::invoke:
function: alicloud:cloudstoragegateway:getGatewayFileShares
arguments:
gatewayId: example_value
nameRegex: ^my-GatewayFileShare
outputs:
cloudStorageGatewayGatewayFileShareId1: ${ids.shares[0].id}
cloudStorageGatewayGatewayFileShareId2: ${nameRegex.shares[0].id}

Return

A collection of values returned by getGatewayFileShares.

Parameters

argument

A collection of arguments for invoking getGatewayFileShares.


suspend fun getGatewayFileShares(gatewayId: String, ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null): GetGatewayFileSharesResult

Return

A collection of values returned by getGatewayFileShares.

Parameters

gatewayId

The ID of the gateway.

ids

A list of Gateway File Share IDs.

nameRegex

A regex string to filter results by Gateway File Share name.

outputFile

File name where to save data source results (after running pulumi preview).

See also


Return

A collection of values returned by getGatewayFileShares.

Parameters

argument

Builder for com.pulumi.alicloud.cloudstoragegateway.kotlin.inputs.GetGatewayFileSharesPlainArgs.

See also