getGateways

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

NOTE: Available in v1.132.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = new alicloud.cloudstoragegateway.StorageBundle("example", {storageBundleName: "example_value"});
const nameRegex = alicloud.cloudstoragegateway.getGatewaysOutput({
storageBundleId: example.id,
nameRegex: "^my-Gateway",
});
export const cloudStorageGatewayGatewayId = nameRegex.apply(nameRegex => nameRegex.gateways?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.cloudstoragegateway.StorageBundle("example", storage_bundle_name="example_value")
name_regex = alicloud.cloudstoragegateway.get_gateways_output(storage_bundle_id=example.id,
name_regex="^my-Gateway")
pulumi.export("cloudStorageGatewayGatewayId", name_regex.gateways[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = new AliCloud.CloudStorageGateway.StorageBundle("example", new()
{
StorageBundleName = "example_value",
});
var nameRegex = AliCloud.CloudStorageGateway.GetGateways.Invoke(new()
{
StorageBundleId = example.Id,
NameRegex = "^my-Gateway",
});
return new Dictionary<string, object?>
{
["cloudStorageGatewayGatewayId"] = nameRegex&#46;Apply(getGatewaysResult => getGatewaysResult&#46;Gateways[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 {
example, err := cloudstoragegateway.NewStorageBundle(ctx, "example", &cloudstoragegateway.StorageBundleArgs{
StorageBundleName: pulumi.String("example_value"),
})
if err != nil {
return err
}
nameRegex := cloudstoragegateway.GetGatewaysOutput(ctx, cloudstoragegateway.GetGatewaysOutputArgs{
StorageBundleId: example.ID(),
NameRegex: pulumi.String("^my-Gateway"),
}, nil)
ctx.Export("cloudStorageGatewayGatewayId", nameRegex.ApplyT(func(nameRegex cloudstoragegateway.GetGatewaysResult) (*string, error) {
return &nameRegex.Gateways[0].Id, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cloudstoragegateway.StorageBundle;
import com.pulumi.alicloud.cloudstoragegateway.StorageBundleArgs;
import com.pulumi.alicloud.cloudstoragegateway.CloudstoragegatewayFunctions;
import com.pulumi.alicloud.cloudstoragegateway.inputs.GetGatewaysArgs;
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 example = new StorageBundle("example", StorageBundleArgs.builder()
.storageBundleName("example_value")
.build());
final var nameRegex = CloudstoragegatewayFunctions.getGateways(GetGatewaysArgs.builder()
.storageBundleId(example.id())
.nameRegex("^my-Gateway")
.build());
ctx.export("cloudStorageGatewayGatewayId", nameRegex.applyValue(_nameRegex -> _nameRegex.gateways()[0].id()));
}
}
resources:
example:
type: alicloud:cloudstoragegateway:StorageBundle
properties:
storageBundleName: example_value
variables:
nameRegex:
fn::invoke:
function: alicloud:cloudstoragegateway:getGateways
arguments:
storageBundleId: ${example.id}
nameRegex: ^my-Gateway
outputs:
cloudStorageGatewayGatewayId: ${nameRegex.gateways[0].id}

Return

A collection of values returned by getGateways.

Parameters

argument

A collection of arguments for invoking getGateways.


suspend fun getGateways(ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, pageNumber: Int? = null, pageSize: Int? = null, status: String? = null, storageBundleId: String): GetGatewaysResult

Return

A collection of values returned by getGateways.

Parameters

ids

A list of Gateway IDs.

nameRegex

A regex string to filter results by Gateway name.

outputFile

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

pageNumber
pageSize
status

gateway status.

storageBundleId

storage bundle id.

See also


suspend fun getGateways(argument: suspend GetGatewaysPlainArgsBuilder.() -> Unit): GetGatewaysResult

Return

A collection of values returned by getGateways.

Parameters

argument

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

See also