1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cloudstoragegateway
  5. getExpressSyncs
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.cloudstoragegateway.getExpressSyncs

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Cloud Storage Gateway Express Syncs 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.getExpressSyncs({});
    export const cloudStorageGatewayExpressSyncId1 = ids.then(ids => ids.syncs?.[0]?.id);
    const nameRegex = alicloud.cloudstoragegateway.getExpressSyncs({
        nameRegex: "^my-ExpressSync",
    });
    export const cloudStorageGatewayExpressSyncId2 = nameRegex.then(nameRegex => nameRegex.syncs?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.cloudstoragegateway.get_express_syncs()
    pulumi.export("cloudStorageGatewayExpressSyncId1", ids.syncs[0].id)
    name_regex = alicloud.cloudstoragegateway.get_express_syncs(name_regex="^my-ExpressSync")
    pulumi.export("cloudStorageGatewayExpressSyncId2", name_regex.syncs[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.GetExpressSyncs(ctx, &cloudstoragegateway.GetExpressSyncsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("cloudStorageGatewayExpressSyncId1", ids.Syncs[0].Id)
    		nameRegex, err := cloudstoragegateway.GetExpressSyncs(ctx, &cloudstoragegateway.GetExpressSyncsArgs{
    			NameRegex: pulumi.StringRef("^my-ExpressSync"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("cloudStorageGatewayExpressSyncId2", nameRegex.Syncs[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.CloudStorageGateway.GetExpressSyncs.Invoke();
    
        var nameRegex = AliCloud.CloudStorageGateway.GetExpressSyncs.Invoke(new()
        {
            NameRegex = "^my-ExpressSync",
        });
    
        return new Dictionary<string, object?>
        {
            ["cloudStorageGatewayExpressSyncId1"] = ids.Apply(getExpressSyncsResult => getExpressSyncsResult.Syncs[0]?.Id),
            ["cloudStorageGatewayExpressSyncId2"] = nameRegex.Apply(getExpressSyncsResult => getExpressSyncsResult.Syncs[0]?.Id),
        };
    });
    
    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.GetExpressSyncsArgs;
    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.getExpressSyncs();
    
            ctx.export("cloudStorageGatewayExpressSyncId1", ids.applyValue(getExpressSyncsResult -> getExpressSyncsResult.syncs()[0].id()));
            final var nameRegex = CloudstoragegatewayFunctions.getExpressSyncs(GetExpressSyncsArgs.builder()
                .nameRegex("^my-ExpressSync")
                .build());
    
            ctx.export("cloudStorageGatewayExpressSyncId2", nameRegex.applyValue(getExpressSyncsResult -> getExpressSyncsResult.syncs()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:cloudstoragegateway:getExpressSyncs
          Arguments: {}
      nameRegex:
        fn::invoke:
          Function: alicloud:cloudstoragegateway:getExpressSyncs
          Arguments:
            nameRegex: ^my-ExpressSync
    outputs:
      cloudStorageGatewayExpressSyncId1: ${ids.syncs[0].id}
      cloudStorageGatewayExpressSyncId2: ${nameRegex.syncs[0].id}
    

    Using getExpressSyncs

    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 getExpressSyncs(args: GetExpressSyncsArgs, opts?: InvokeOptions): Promise<GetExpressSyncsResult>
    function getExpressSyncsOutput(args: GetExpressSyncsOutputArgs, opts?: InvokeOptions): Output<GetExpressSyncsResult>
    def get_express_syncs(ids: Optional[Sequence[str]] = None,
                          name_regex: Optional[str] = None,
                          output_file: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetExpressSyncsResult
    def get_express_syncs_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                          name_regex: Optional[pulumi.Input[str]] = None,
                          output_file: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetExpressSyncsResult]
    func GetExpressSyncs(ctx *Context, args *GetExpressSyncsArgs, opts ...InvokeOption) (*GetExpressSyncsResult, error)
    func GetExpressSyncsOutput(ctx *Context, args *GetExpressSyncsOutputArgs, opts ...InvokeOption) GetExpressSyncsResultOutput

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

    public static class GetExpressSyncs 
    {
        public static Task<GetExpressSyncsResult> InvokeAsync(GetExpressSyncsArgs args, InvokeOptions? opts = null)
        public static Output<GetExpressSyncsResult> Invoke(GetExpressSyncsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetExpressSyncsResult> getExpressSyncs(GetExpressSyncsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cloudstoragegateway/getExpressSyncs:getExpressSyncs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Express Sync IDs.
    NameRegex string
    A regex string to filter results by Express Sync name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Express Sync IDs.
    NameRegex string
    A regex string to filter results by Express Sync name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Express Sync IDs.
    nameRegex String
    A regex string to filter results by Express Sync name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Express Sync IDs.
    nameRegex string
    A regex string to filter results by Express Sync name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Express Sync IDs.
    name_regex str
    A regex string to filter results by Express Sync name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Express Sync IDs.
    nameRegex String
    A regex string to filter results by Express Sync name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getExpressSyncs Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Syncs List<Pulumi.AliCloud.CloudStorageGateway.Outputs.GetExpressSyncsSync>
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Syncs []GetExpressSyncsSync
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    syncs List<GetExpressSyncsSync>
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    syncs GetExpressSyncsSync[]
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    syncs Sequence[GetExpressSyncsSync]
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    syncs List<Property Map>
    nameRegex String
    outputFile String

    Supporting Types

    GetExpressSyncsSync

    BucketName string
    The name of the OSS Bucket.
    BucketPrefix string
    The prefix of the OSS Bucket.
    BucketRegion string
    The region of the OSS Bucket.
    Description string
    The description of the Express Sync.
    ExpressSyncId string
    The ID of the Express Sync.
    ExpressSyncName string
    The name of the Express Sync.
    Id string
    MnsTopic string
    The name of the message topic (Topic) corresponding to the Express Sync in the Alibaba Cloud Message Service MNS.
    BucketName string
    The name of the OSS Bucket.
    BucketPrefix string
    The prefix of the OSS Bucket.
    BucketRegion string
    The region of the OSS Bucket.
    Description string
    The description of the Express Sync.
    ExpressSyncId string
    The ID of the Express Sync.
    ExpressSyncName string
    The name of the Express Sync.
    Id string
    MnsTopic string
    The name of the message topic (Topic) corresponding to the Express Sync in the Alibaba Cloud Message Service MNS.
    bucketName String
    The name of the OSS Bucket.
    bucketPrefix String
    The prefix of the OSS Bucket.
    bucketRegion String
    The region of the OSS Bucket.
    description String
    The description of the Express Sync.
    expressSyncId String
    The ID of the Express Sync.
    expressSyncName String
    The name of the Express Sync.
    id String
    mnsTopic String
    The name of the message topic (Topic) corresponding to the Express Sync in the Alibaba Cloud Message Service MNS.
    bucketName string
    The name of the OSS Bucket.
    bucketPrefix string
    The prefix of the OSS Bucket.
    bucketRegion string
    The region of the OSS Bucket.
    description string
    The description of the Express Sync.
    expressSyncId string
    The ID of the Express Sync.
    expressSyncName string
    The name of the Express Sync.
    id string
    mnsTopic string
    The name of the message topic (Topic) corresponding to the Express Sync in the Alibaba Cloud Message Service MNS.
    bucket_name str
    The name of the OSS Bucket.
    bucket_prefix str
    The prefix of the OSS Bucket.
    bucket_region str
    The region of the OSS Bucket.
    description str
    The description of the Express Sync.
    express_sync_id str
    The ID of the Express Sync.
    express_sync_name str
    The name of the Express Sync.
    id str
    mns_topic str
    The name of the message topic (Topic) corresponding to the Express Sync in the Alibaba Cloud Message Service MNS.
    bucketName String
    The name of the OSS Bucket.
    bucketPrefix String
    The prefix of the OSS Bucket.
    bucketRegion String
    The region of the OSS Bucket.
    description String
    The description of the Express Sync.
    expressSyncId String
    The ID of the Express Sync.
    expressSyncName String
    The name of the Express Sync.
    id String
    mnsTopic String
    The name of the message topic (Topic) corresponding to the Express Sync in the Alibaba Cloud Message Service MNS.

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi