1. Packages
  2. Alicloud Provider
  3. API Docs
  4. rds
  5. getCrossRegions
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.rds.getCrossRegions

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides an available area for remote disaster recovery for RDS.

    NOTE: Available in v1.193.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    // Declare the data source
    const crossRegions = alicloud.rds.getCrossRegions({});
    export const firstRdsCrossRegions = regions.ids[0];
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    # Declare the data source
    cross_regions = alicloud.rds.get_cross_regions()
    pulumi.export("firstRdsCrossRegions", regions["ids"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rds"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Declare the data source
    		_, err := rds.GetCrossRegions(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstRdsCrossRegions", regions.Ids[0])
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        // Declare the data source
        var crossRegions = AliCloud.Rds.GetCrossRegions.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["firstRdsCrossRegions"] = regions.Ids[0],
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.rds.RdsFunctions;
    import com.pulumi.alicloud.rds.inputs.GetCrossRegionsArgs;
    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) {
            // Declare the data source
            final var crossRegions = RdsFunctions.getCrossRegions();
    
            ctx.export("firstRdsCrossRegions", regions.ids()[0]);
        }
    }
    
    variables:
      # Declare the data source
      crossRegions:
        fn::invoke:
          Function: alicloud:rds:getCrossRegions
          Arguments: {}
    outputs:
      firstRdsCrossRegions: ${regions.ids[0]}
    

    Using getCrossRegions

    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 getCrossRegions(args: GetCrossRegionsArgs, opts?: InvokeOptions): Promise<GetCrossRegionsResult>
    function getCrossRegionsOutput(args: GetCrossRegionsOutputArgs, opts?: InvokeOptions): Output<GetCrossRegionsResult>
    def get_cross_regions(output_file: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetCrossRegionsResult
    def get_cross_regions_output(output_file: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetCrossRegionsResult]
    func GetCrossRegions(ctx *Context, args *GetCrossRegionsArgs, opts ...InvokeOption) (*GetCrossRegionsResult, error)
    func GetCrossRegionsOutput(ctx *Context, args *GetCrossRegionsOutputArgs, opts ...InvokeOption) GetCrossRegionsResultOutput

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

    public static class GetCrossRegions 
    {
        public static Task<GetCrossRegionsResult> InvokeAsync(GetCrossRegionsArgs args, InvokeOptions? opts = null)
        public static Output<GetCrossRegionsResult> Invoke(GetCrossRegionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCrossRegionsResult> getCrossRegions(GetCrossRegionsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:rds/getCrossRegions:getCrossRegions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OutputFile string
    OutputFile string
    outputFile String
    outputFile string
    outputFile String

    getCrossRegions Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of region IDs.
    Regions List<Pulumi.AliCloud.Rds.Outputs.GetCrossRegionsRegion>
    The list of destination regions that support cross-region backup. Each element contains the following attributes:
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of region IDs.
    Regions []GetCrossRegionsRegion
    The list of destination regions that support cross-region backup. Each element contains the following attributes:
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of region IDs.
    regions List<GetCrossRegionsRegion>
    The list of destination regions that support cross-region backup. Each element contains the following attributes:
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of region IDs.
    regions GetCrossRegionsRegion[]
    The list of destination regions that support cross-region backup. Each element contains the following attributes:
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of region IDs.
    regions Sequence[GetCrossRegionsRegion]
    The list of destination regions that support cross-region backup. Each element contains the following attributes:
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of region IDs.
    regions List<Property Map>
    The list of destination regions that support cross-region backup. Each element contains the following attributes:
    outputFile String

    Supporting Types

    GetCrossRegionsRegion

    Id string
    ID of the region.
    Id string
    ID of the region.
    id String
    ID of the region.
    id string
    ID of the region.
    id str
    ID of the region.
    id String
    ID of the region.

    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.62.1 published on Monday, Sep 16, 2024 by Pulumi