Class GetRegions
Inheritance
System.Object
GetRegions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public static class GetRegions
Methods
View SourceInvokeAsync(GetRegionsArgs, InvokeOptions)
Retrieve information about all supported DigitalOcean regions, with the ability to filter and sort the results. If no filters are specified, all regions will be returned.
Note: You can use the digitalocean..getRegion data source
to obtain metadata about a single region if you already know the slug to retrieve.
{{% examples %}}
Example Usage
{{% example %}}
Use the filter block with a key string and values list to filter regions.
For example to find all available regions:
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var available = Output.Create(DigitalOcean.GetRegions.InvokeAsync(new DigitalOcean.GetRegionsArgs
{
Filters =
{
new DigitalOcean.Inputs.GetRegionsFilterArgs
{
Key = "available",
Values =
{
"true",
},
},
},
}));
}
}
You can filter on multiple fields and sort the results as well:
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var available = Output.Create(DigitalOcean.GetRegions.InvokeAsync(new DigitalOcean.GetRegionsArgs
{
Filters =
{
new DigitalOcean.Inputs.GetRegionsFilterArgs
{
Key = "available",
Values =
{
"true",
},
},
new DigitalOcean.Inputs.GetRegionsFilterArgs
{
Key = "features",
Values =
{
"private_networking",
},
},
},
Sorts =
{
new DigitalOcean.Inputs.GetRegionsSortArgs
{
Direction = "desc",
Key = "name",
},
},
}));
}
}
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetRegionsResult> InvokeAsync(GetRegionsArgs args = null, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetRegionsArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetRegionsResult> |