1. Packages
  2. DigitalOcean
  3. API Docs
  4. getRegion
DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi

digitalocean.getRegion

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi

    Get information on a single DigitalOcean region. This is useful to find out what Droplet sizes and features are supported within a region.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const sfo2 = digitalocean.getRegion({
        slug: "sfo2",
    });
    export const regionName = sfo2.then(sfo2 => sfo2.name);
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    sfo2 = digitalocean.get_region(slug="sfo2")
    pulumi.export("regionName", sfo2.name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		sfo2, err := digitalocean.GetRegion(ctx, &digitalocean.GetRegionArgs{
    			Slug: "sfo2",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("regionName", sfo2.Name)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var sfo2 = DigitalOcean.GetRegion.Invoke(new()
        {
            Slug = "sfo2",
        });
    
        return new Dictionary<string, object?>
        {
            ["regionName"] = sfo2.Apply(getRegionResult => getRegionResult.Name),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.DigitaloceanFunctions;
    import com.pulumi.digitalocean.inputs.GetRegionArgs;
    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 sfo2 = DigitaloceanFunctions.getRegion(GetRegionArgs.builder()
                .slug("sfo2")
                .build());
    
            ctx.export("regionName", sfo2.applyValue(getRegionResult -> getRegionResult.name()));
        }
    }
    
    variables:
      sfo2:
        fn::invoke:
          Function: digitalocean:getRegion
          Arguments:
            slug: sfo2
    outputs:
      regionName: ${sfo2.name}
    

    Using getRegion

    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 getRegion(args: GetRegionArgs, opts?: InvokeOptions): Promise<GetRegionResult>
    function getRegionOutput(args: GetRegionOutputArgs, opts?: InvokeOptions): Output<GetRegionResult>
    def get_region(slug: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetRegionResult
    def get_region_output(slug: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetRegionResult]
    func GetRegion(ctx *Context, args *GetRegionArgs, opts ...InvokeOption) (*GetRegionResult, error)
    func GetRegionOutput(ctx *Context, args *GetRegionOutputArgs, opts ...InvokeOption) GetRegionResultOutput

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

    public static class GetRegion 
    {
        public static Task<GetRegionResult> InvokeAsync(GetRegionArgs args, InvokeOptions? opts = null)
        public static Output<GetRegionResult> Invoke(GetRegionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRegionResult> getRegion(GetRegionArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: digitalocean:index/getRegion:getRegion
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Slug string
    A human-readable string that is used as a unique identifier for each region.
    Slug string
    A human-readable string that is used as a unique identifier for each region.
    slug String
    A human-readable string that is used as a unique identifier for each region.
    slug string
    A human-readable string that is used as a unique identifier for each region.
    slug str
    A human-readable string that is used as a unique identifier for each region.
    slug String
    A human-readable string that is used as a unique identifier for each region.

    getRegion Result

    The following output properties are available:

    Available bool
    A boolean value that represents whether new Droplets can be created in this region.
    Features List<string>
    A set of features available in this region.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The display name of the region.
    Sizes List<string>
    A set of identifying slugs for the Droplet sizes available in this region.
    Slug string
    A human-readable string that is used as a unique identifier for each region.
    Available bool
    A boolean value that represents whether new Droplets can be created in this region.
    Features []string
    A set of features available in this region.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The display name of the region.
    Sizes []string
    A set of identifying slugs for the Droplet sizes available in this region.
    Slug string
    A human-readable string that is used as a unique identifier for each region.
    available Boolean
    A boolean value that represents whether new Droplets can be created in this region.
    features List<String>
    A set of features available in this region.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The display name of the region.
    sizes List<String>
    A set of identifying slugs for the Droplet sizes available in this region.
    slug String
    A human-readable string that is used as a unique identifier for each region.
    available boolean
    A boolean value that represents whether new Droplets can be created in this region.
    features string[]
    A set of features available in this region.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The display name of the region.
    sizes string[]
    A set of identifying slugs for the Droplet sizes available in this region.
    slug string
    A human-readable string that is used as a unique identifier for each region.
    available bool
    A boolean value that represents whether new Droplets can be created in this region.
    features Sequence[str]
    A set of features available in this region.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The display name of the region.
    sizes Sequence[str]
    A set of identifying slugs for the Droplet sizes available in this region.
    slug str
    A human-readable string that is used as a unique identifier for each region.
    available Boolean
    A boolean value that represents whether new Droplets can be created in this region.
    features List<String>
    A set of features available in this region.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The display name of the region.
    sizes List<String>
    A set of identifying slugs for the Droplet sizes available in this region.
    slug String
    A human-readable string that is used as a unique identifier for each region.

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi