1. Packages
  2. Edgecenter Provider
  3. API Docs
  4. getInstance
edgecenter 0.7.34 published on Monday, Apr 14, 2025 by edge-center

edgecenter.getInstance

Explore with Pulumi AI

edgecenter logo
edgecenter 0.7.34 published on Monday, Apr 14, 2025 by edge-center

    WARNING: Data source “edgecenter.Instance” is deprecated and unavailable. Use “edgecenter_instanceV2” data-source instead.

    A cloud instance is a virtual machine in a cloud environment. Could be used with baremetal also.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as edgecenter from "@pulumi/edgecenter";
    
    const pr = edgecenter.getProject({
        name: "test",
    });
    const rg = edgecenter.getRegion({
        name: "ED-10 Preprod",
    });
    const vm = Promise.all([rg, pr]).then(([rg, pr]) => edgecenter.getInstance({
        name: "test-vm",
        regionId: rg.id,
        projectId: pr.id,
    }));
    export const view = vm;
    
    import pulumi
    import pulumi_edgecenter as edgecenter
    
    pr = edgecenter.get_project(name="test")
    rg = edgecenter.get_region(name="ED-10 Preprod")
    vm = edgecenter.get_instance(name="test-vm",
        region_id=rg.id,
        project_id=pr.id)
    pulumi.export("view", vm)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/edgecenter/edgecenter"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		pr, err := edgecenter.LookupProject(ctx, &edgecenter.LookupProjectArgs{
    			Name: pulumi.StringRef("test"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		rg, err := edgecenter.GetRegion(ctx, &edgecenter.GetRegionArgs{
    			Name: "ED-10 Preprod",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		vm, err := edgecenter.LookupInstance(ctx, &edgecenter.LookupInstanceArgs{
    			Name:      "test-vm",
    			RegionId:  pulumi.Float64Ref(rg.Id),
    			ProjectId: pulumi.Float64Ref(pr.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("view", vm)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Edgecenter = Pulumi.Edgecenter;
    
    return await Deployment.RunAsync(() => 
    {
        var pr = Edgecenter.GetProject.Invoke(new()
        {
            Name = "test",
        });
    
        var rg = Edgecenter.GetRegion.Invoke(new()
        {
            Name = "ED-10 Preprod",
        });
    
        var vm = Edgecenter.GetInstance.Invoke(new()
        {
            Name = "test-vm",
            RegionId = rg.Apply(getRegionResult => getRegionResult.Id),
            ProjectId = pr.Apply(getProjectResult => getProjectResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["view"] = vm,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.edgecenter.EdgecenterFunctions;
    import com.pulumi.edgecenter.inputs.GetProjectArgs;
    import com.pulumi.edgecenter.inputs.GetRegionArgs;
    import com.pulumi.edgecenter.inputs.GetInstanceArgs;
    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 pr = EdgecenterFunctions.getProject(GetProjectArgs.builder()
                .name("test")
                .build());
    
            final var rg = EdgecenterFunctions.getRegion(GetRegionArgs.builder()
                .name("ED-10 Preprod")
                .build());
    
            final var vm = EdgecenterFunctions.getInstance(GetInstanceArgs.builder()
                .name("test-vm")
                .regionId(rg.applyValue(getRegionResult -> getRegionResult.id()))
                .projectId(pr.applyValue(getProjectResult -> getProjectResult.id()))
                .build());
    
            ctx.export("view", vm.applyValue(getInstanceResult -> getInstanceResult));
        }
    }
    
    variables:
      pr:
        fn::invoke:
          function: edgecenter:getProject
          arguments:
            name: test
      rg:
        fn::invoke:
          function: edgecenter:getRegion
          arguments:
            name: ED-10 Preprod
      vm:
        fn::invoke:
          function: edgecenter:getInstance
          arguments:
            name: test-vm
            regionId: ${rg.id}
            projectId: ${pr.id}
    outputs:
      view: ${vm}
    

    Using getInstance

    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 getInstance(args: GetInstanceArgs, opts?: InvokeOptions): Promise<GetInstanceResult>
    function getInstanceOutput(args: GetInstanceOutputArgs, opts?: InvokeOptions): Output<GetInstanceResult>
    def get_instance(id: Optional[str] = None,
                     name: Optional[str] = None,
                     project_id: Optional[float] = None,
                     project_name: Optional[str] = None,
                     region_id: Optional[float] = None,
                     region_name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetInstanceResult
    def get_instance_output(id: Optional[pulumi.Input[str]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     project_id: Optional[pulumi.Input[float]] = None,
                     project_name: Optional[pulumi.Input[str]] = None,
                     region_id: Optional[pulumi.Input[float]] = None,
                     region_name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetInstanceResult]
    func LookupInstance(ctx *Context, args *LookupInstanceArgs, opts ...InvokeOption) (*LookupInstanceResult, error)
    func LookupInstanceOutput(ctx *Context, args *LookupInstanceOutputArgs, opts ...InvokeOption) LookupInstanceResultOutput

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

    public static class GetInstance 
    {
        public static Task<GetInstanceResult> InvokeAsync(GetInstanceArgs args, InvokeOptions? opts = null)
        public static Output<GetInstanceResult> Invoke(GetInstanceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
    public static Output<GetInstanceResult> getInstance(GetInstanceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: edgecenter:index/getInstance:getInstance
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the instance.
    Id string
    The ID of this resource.
    ProjectId double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    Name string
    The name of the instance.
    Id string
    The ID of this resource.
    ProjectId float64
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId float64
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    name String
    The name of the instance.
    id String
    The ID of this resource.
    projectId Double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    name string
    The name of the instance.
    id string
    The ID of this resource.
    projectId number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    name str
    The name of the instance.
    id str
    The ID of this resource.
    project_id float
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    project_name str
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    region_id float
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    region_name str
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    name String
    The name of the instance.
    id String
    The ID of this resource.
    projectId Number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.

    getInstance Result

    The following output properties are available:

    Addresses List<GetInstanceAddress>
    A list of network addresses associated with the instance, for example "pub_net": [...].
    Flavor Dictionary<string, string>
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    FlavorId string
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    Id string
    The ID of this resource.
    Interfaces List<GetInstanceInterface>
    A list defining the network interfaces to be attached to the instance.
    Metadatas List<GetInstanceMetadata>
    Name string
    The name of the instance.
    SecurityGroups List<GetInstanceSecurityGroup>
    A list of firewall configurations applied to the instance, defined by their id and name.
    Status string
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    VmState string
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    Volumes List<GetInstanceVolume>
    A set defining the volumes to be attached to the instance.
    ProjectId double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    Addresses []GetInstanceAddress
    A list of network addresses associated with the instance, for example "pub_net": [...].
    Flavor map[string]string
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    FlavorId string
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    Id string
    The ID of this resource.
    Interfaces []GetInstanceInterface
    A list defining the network interfaces to be attached to the instance.
    Metadatas []GetInstanceMetadata
    Name string
    The name of the instance.
    SecurityGroups []GetInstanceSecurityGroup
    A list of firewall configurations applied to the instance, defined by their id and name.
    Status string
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    VmState string
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    Volumes []GetInstanceVolume
    A set defining the volumes to be attached to the instance.
    ProjectId float64
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    ProjectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    RegionId float64
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    RegionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    addresses List<GetInstanceAddress>
    A list of network addresses associated with the instance, for example "pub_net": [...].
    flavor Map<String,String>
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    flavorId String
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    id String
    The ID of this resource.
    interfaces List<GetInstanceInterface>
    A list defining the network interfaces to be attached to the instance.
    metadatas List<GetInstanceMetadata>
    name String
    The name of the instance.
    securityGroups List<GetInstanceSecurityGroup>
    A list of firewall configurations applied to the instance, defined by their id and name.
    status String
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    vmState String
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    volumes List<GetInstanceVolume>
    A set defining the volumes to be attached to the instance.
    projectId Double
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Double
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    addresses GetInstanceAddress[]
    A list of network addresses associated with the instance, for example "pub_net": [...].
    flavor {[key: string]: string}
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    flavorId string
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    id string
    The ID of this resource.
    interfaces GetInstanceInterface[]
    A list defining the network interfaces to be attached to the instance.
    metadatas GetInstanceMetadata[]
    name string
    The name of the instance.
    securityGroups GetInstanceSecurityGroup[]
    A list of firewall configurations applied to the instance, defined by their id and name.
    status string
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    vmState string
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    volumes GetInstanceVolume[]
    A set defining the volumes to be attached to the instance.
    projectId number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName string
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName string
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    addresses Sequence[GetInstanceAddress]
    A list of network addresses associated with the instance, for example "pub_net": [...].
    flavor Mapping[str, str]
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    flavor_id str
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    id str
    The ID of this resource.
    interfaces Sequence[GetInstanceInterface]
    A list defining the network interfaces to be attached to the instance.
    metadatas Sequence[GetInstanceMetadata]
    name str
    The name of the instance.
    security_groups Sequence[GetInstanceSecurityGroup]
    A list of firewall configurations applied to the instance, defined by their id and name.
    status str
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    vm_state str
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    volumes Sequence[GetInstanceVolume]
    A set defining the volumes to be attached to the instance.
    project_id float
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    project_name str
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    region_id float
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    region_name str
    The name of the region. Either 'regionid' or 'regionname' must be specified.
    addresses List<Property Map>
    A list of network addresses associated with the instance, for example "pub_net": [...].
    flavor Map<String>
    A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
    flavorId String
    The ID of the flavor to be used for the instance, determining its compute and memory, for example 'g1-standard-2-4'.
    id String
    The ID of this resource.
    interfaces List<Property Map>
    A list defining the network interfaces to be attached to the instance.
    metadatas List<Property Map>
    name String
    The name of the instance.
    securityGroups List<Property Map>
    A list of firewall configurations applied to the instance, defined by their id and name.
    status String
    The current status of the instance. This is computed automatically and can be used to track the instance's state.
    vmState String
    The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
    volumes List<Property Map>
    A set defining the volumes to be attached to the instance.
    projectId Number
    The uuid of the project. Either 'projectid' or 'projectname' must be specified.
    projectName String
    The name of the project. Either 'projectid' or 'projectname' must be specified.
    regionId Number
    The uuid of the region. Either 'regionid' or 'regionname' must be specified.
    regionName String
    The name of the region. Either 'regionid' or 'regionname' must be specified.

    Supporting Types

    GetInstanceAddress

    GetInstanceAddressNet

    Addr string
    Type string
    Addr string
    Type string
    addr String
    type String
    addr string
    type string
    addr str
    type str
    addr String
    type String

    GetInstanceInterface

    IpAddress string
    NetworkId string
    PortId string
    SubnetId string
    IpAddress string
    NetworkId string
    PortId string
    SubnetId string
    ipAddress String
    networkId String
    portId String
    subnetId String
    ipAddress string
    networkId string
    portId string
    subnetId string
    ipAddress String
    networkId String
    portId String
    subnetId String

    GetInstanceMetadata

    Key string
    Value string
    Key string
    Value string
    key String
    value String
    key string
    value string
    key str
    value str
    key String
    value String

    GetInstanceSecurityGroup

    Name string
    Name string
    name String
    name string
    name str
    name String

    GetInstanceVolume

    Package Details

    Repository
    edgecenter edge-center/terraform-provider-edgecenter
    License
    Notes
    This Pulumi package is based on the edgecenter Terraform Provider.
    edgecenter logo
    edgecenter 0.7.34 published on Monday, Apr 14, 2025 by edge-center