1. Packages
  2. Gcore Provider
  3. API Docs
  4. getRegion
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

gcore.getRegion

Explore with Pulumi AI

gcore logo
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

    Represent region data

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const rg = gcore.getRegion({
        name: "ED-10 Preprod",
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    rg = gcore.get_region(name="ED-10 Preprod")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gcore.GetRegion(ctx, &gcore.GetRegionArgs{
    			Name: "ED-10 Preprod",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var rg = Gcore.GetRegion.Invoke(new()
        {
            Name = "ED-10 Preprod",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.GcoreFunctions;
    import com.pulumi.gcore.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 rg = GcoreFunctions.getRegion(GetRegionArgs.builder()
                .name("ED-10 Preprod")
                .build());
    
        }
    }
    
    variables:
      rg:
        fn::invoke:
          function: gcore:getRegion
          arguments:
            name: ED-10 Preprod
    

    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(id: Optional[str] = None,
                   name: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetRegionResult
    def get_region_output(id: Optional[pulumi.Input[str]] = None,
                   name: 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)
    public static Output<GetRegionResult> getRegion(GetRegionArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcore:index/getRegion:getRegion
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Displayed region name
    Id string
    The ID of this resource.
    Name string
    Displayed region name
    Id string
    The ID of this resource.
    name String
    Displayed region name
    id String
    The ID of this resource.
    name string
    Displayed region name
    id string
    The ID of this resource.
    name str
    Displayed region name
    id str
    The ID of this resource.
    name String
    Displayed region name
    id String
    The ID of this resource.

    getRegion Result

    The following output properties are available:

    Id string
    The ID of this resource.
    Name string
    Displayed region name
    Id string
    The ID of this resource.
    Name string
    Displayed region name
    id String
    The ID of this resource.
    name String
    Displayed region name
    id string
    The ID of this resource.
    name string
    Displayed region name
    id str
    The ID of this resource.
    name str
    Displayed region name
    id String
    The ID of this resource.
    name String
    Displayed region name

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    gcore logo
    gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core