1. Packages
  2. RedisCloud
  3. API Docs
  4. getRegions
Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs

rediscloud.getRegions

Explore with Pulumi AI

rediscloud logo
Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs

    The Regions data source allows access to a list of supported cloud provider regions. These regions can be used with the subscription resource.

    Example Usage

    The following example returns all of the supported regions available within your Redis Enterprise Cloud account.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rediscloud = Pulumi.Rediscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Rediscloud.GetRegions.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["allRegions"] = example.Apply(getRegionsResult => getRegionsResult.Regions),
        };
    });
    
    package main
    
    import (
    	"github.com/RedisLabs/pulumi-rediscloud/sdk/go/rediscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := rediscloud.GetRegions(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("allRegions", example.Regions)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rediscloud.RediscloudFunctions;
    import com.pulumi.rediscloud.inputs.GetRegionsArgs;
    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 example = RediscloudFunctions.getRegions();
    
            ctx.export("allRegions", example.applyValue(getRegionsResult -> getRegionsResult.regions()));
        }
    }
    
    import pulumi
    import pulumi_rediscloud as rediscloud
    
    example = rediscloud.get_regions()
    pulumi.export("allRegions", example.regions)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as rediscloud from "@pulumi/rediscloud";
    
    const example = rediscloud.getRegions({});
    export const allRegions = example.then(example => example.regions);
    
    variables:
      example:
        fn::invoke:
          Function: rediscloud:getRegions
          Arguments: {}
    outputs:
      allRegions: ${example.regions}
    

    ).

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rediscloud = Pulumi.Rediscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleAws = Rediscloud.GetRegions.Invoke(new()
        {
            ProviderName = "AWS",
        });
    
        var exampleGcp = Rediscloud.GetRegions.Invoke(new()
        {
            ProviderName = "GCP",
        });
    
    });
    
    package main
    
    import (
    	"github.com/RedisLabs/pulumi-rediscloud/sdk/go/rediscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := rediscloud.GetRegions(ctx, &rediscloud.GetRegionsArgs{
    			ProviderName: pulumi.StringRef("AWS"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = rediscloud.GetRegions(ctx, &rediscloud.GetRegionsArgs{
    			ProviderName: pulumi.StringRef("GCP"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rediscloud.RediscloudFunctions;
    import com.pulumi.rediscloud.inputs.GetRegionsArgs;
    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 exampleAws = RediscloudFunctions.getRegions(GetRegionsArgs.builder()
                .providerName("AWS")
                .build());
    
            final var exampleGcp = RediscloudFunctions.getRegions(GetRegionsArgs.builder()
                .providerName("GCP")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_rediscloud as rediscloud
    
    example_aws = rediscloud.get_regions(provider_name="AWS")
    example_gcp = rediscloud.get_regions(provider_name="GCP")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as rediscloud from "@pulumi/rediscloud";
    
    const exampleAws = rediscloud.getRegions({
        providerName: "AWS",
    });
    const exampleGcp = rediscloud.getRegions({
        providerName: "GCP",
    });
    
    variables:
      exampleAws:
        fn::invoke:
          Function: rediscloud:getRegions
          Arguments:
            providerName: AWS
      exampleGcp:
        fn::invoke:
          Function: rediscloud:getRegions
          Arguments:
            providerName: GCP
    

    Using getRegions

    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 getRegions(args: GetRegionsArgs, opts?: InvokeOptions): Promise<GetRegionsResult>
    function getRegionsOutput(args: GetRegionsOutputArgs, opts?: InvokeOptions): Output<GetRegionsResult>
    def get_regions(provider_name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetRegionsResult
    def get_regions_output(provider_name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetRegionsResult]
    func GetRegions(ctx *Context, args *GetRegionsArgs, opts ...InvokeOption) (*GetRegionsResult, error)
    func GetRegionsOutput(ctx *Context, args *GetRegionsOutputArgs, opts ...InvokeOption) GetRegionsResultOutput

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

    public static class GetRegions 
    {
        public static Task<GetRegionsResult> InvokeAsync(GetRegionsArgs args, InvokeOptions? opts = null)
        public static Output<GetRegionsResult> Invoke(GetRegionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRegionsResult> getRegions(GetRegionsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: rediscloud:index/getRegions:getRegions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProviderName string
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    ProviderName string
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    providerName String
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    providerName string
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    provider_name str
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    providerName String
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).

    getRegions Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Regions List<RedisLabs.Rediscloud.Outputs.GetRegionsRegion>
    A list of regions from either a single or multiple cloud providers.
    ProviderName string
    The identifier of the owning cloud provider, (either AWS or GCP)
    Id string
    The provider-assigned unique ID for this managed resource.
    Regions []GetRegionsRegion
    A list of regions from either a single or multiple cloud providers.
    ProviderName string
    The identifier of the owning cloud provider, (either AWS or GCP)
    id String
    The provider-assigned unique ID for this managed resource.
    regions List<GetRegionsRegion>
    A list of regions from either a single or multiple cloud providers.
    providerName String
    The identifier of the owning cloud provider, (either AWS or GCP)
    id string
    The provider-assigned unique ID for this managed resource.
    regions GetRegionsRegion[]
    A list of regions from either a single or multiple cloud providers.
    providerName string
    The identifier of the owning cloud provider, (either AWS or GCP)
    id str
    The provider-assigned unique ID for this managed resource.
    regions Sequence[GetRegionsRegion]
    A list of regions from either a single or multiple cloud providers.
    provider_name str
    The identifier of the owning cloud provider, (either AWS or GCP)
    id String
    The provider-assigned unique ID for this managed resource.
    regions List<Property Map>
    A list of regions from either a single or multiple cloud providers.
    providerName String
    The identifier of the owning cloud provider, (either AWS or GCP)

    Supporting Types

    GetRegionsRegion

    Name string
    The identifier assigned by the cloud provider, (for example eu-west-1 for AWS)
    ProviderName string
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    Name string
    The identifier assigned by the cloud provider, (for example eu-west-1 for AWS)
    ProviderName string
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    name String
    The identifier assigned by the cloud provider, (for example eu-west-1 for AWS)
    providerName String
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    name string
    The identifier assigned by the cloud provider, (for example eu-west-1 for AWS)
    providerName string
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    name str
    The identifier assigned by the cloud provider, (for example eu-west-1 for AWS)
    provider_name str
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).
    name String
    The identifier assigned by the cloud provider, (for example eu-west-1 for AWS)
    providerName String
    The name of the cloud provider to filter returned regions, (accepted values are AWS or GCP).

    Package Details

    Repository
    rediscloud RedisLabs/pulumi-rediscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rediscloud Terraform Provider.
    rediscloud logo
    Redis Cloud v1.3.5 published on Wednesday, Dec 20, 2023 by RedisLabs