edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center
edgecenter.getInstanceV2
Explore with Pulumi AI
edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center
A cloud instance is a virtual machine in a cloud environment. Could be used with baremetal too.
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.getInstanceV2({
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_v2(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.LookupInstanceV2(ctx, &edgecenter.LookupInstanceV2Args{
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.GetInstanceV2.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.GetInstanceV2Args;
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.getInstanceV2(GetInstanceV2Args.builder()
.name("test-vm")
.regionId(rg.applyValue(getRegionResult -> getRegionResult.id()))
.projectId(pr.applyValue(getProjectResult -> getProjectResult.id()))
.build());
ctx.export("view", vm.applyValue(getInstanceV2Result -> getInstanceV2Result));
}
}
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:getInstanceV2
arguments:
name: test-vm
regionId: ${rg.id}
projectId: ${pr.id}
outputs:
view: ${vm}
Using getInstanceV2
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 getInstanceV2(args: GetInstanceV2Args, opts?: InvokeOptions): Promise<GetInstanceV2Result>
function getInstanceV2Output(args: GetInstanceV2OutputArgs, opts?: InvokeOptions): Output<GetInstanceV2Result>
def get_instance_v2(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) -> GetInstanceV2Result
def get_instance_v2_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[GetInstanceV2Result]
func LookupInstanceV2(ctx *Context, args *LookupInstanceV2Args, opts ...InvokeOption) (*LookupInstanceV2Result, error)
func LookupInstanceV2Output(ctx *Context, args *LookupInstanceV2OutputArgs, opts ...InvokeOption) LookupInstanceV2ResultOutput
> Note: This function is named LookupInstanceV2
in the Go SDK.
public static class GetInstanceV2
{
public static Task<GetInstanceV2Result> InvokeAsync(GetInstanceV2Args args, InvokeOptions? opts = null)
public static Output<GetInstanceV2Result> Invoke(GetInstanceV2InvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetInstanceV2Result> getInstanceV2(GetInstanceV2Args args, InvokeOptions options)
public static Output<GetInstanceV2Result> getInstanceV2(GetInstanceV2Args args, InvokeOptions options)
fn::invoke:
function: edgecenter:index/getInstanceV2:getInstanceV2
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- The name of the instance.
- Id string
- The ID of this resource.
- Project
Id double - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- Project
Name string - The name of the project. Either 'projectid' or 'projectname' must be specified.
- Region
Id double - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- Region
Name 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.
- Project
Id float64 - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- Project
Name string - The name of the project. Either 'projectid' or 'projectname' must be specified.
- Region
Id float64 - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- Region
Name 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.
- project
Id Double - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- project
Name String - The name of the project. Either 'projectid' or 'projectname' must be specified.
- region
Id Double - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- region
Name 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.
- project
Id number - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- project
Name string - The name of the project. Either 'projectid' or 'projectname' must be specified.
- region
Id number - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- region
Name 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.
- project
Id Number - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- project
Name String - The name of the project. Either 'projectid' or 'projectname' must be specified.
- region
Id Number - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- region
Name String - The name of the region. Either 'regionid' or 'regionname' must be specified.
getInstanceV2 Result
The following output properties are available:
- Boot
Volumes List<GetInstance V2Boot Volume> - A set defining the volumes to be attached to the instance.
- Data
Volumes List<GetInstance V2Data Volume> - A set defining the volumes to be attached to the instance.
- Flavor Dictionary<string, string>
- A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
- Flavor
Id 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<Get
Instance V2Interface> - A list defining the network interfaces to be attached to the instance.
- Metadata Dictionary<string, string>
- A map containing metadata, for example tags.
- Name string
- The name of the instance.
- Status string
- The current status of the instance. This is computed automatically and can be used to track the instance's state.
- Vm
State string - The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
- Project
Id double - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- Project
Name string - The name of the project. Either 'projectid' or 'projectname' must be specified.
- Region
Id double - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- Region
Name string - The name of the region. Either 'regionid' or 'regionname' must be specified.
- Boot
Volumes []GetInstance V2Boot Volume - A set defining the volumes to be attached to the instance.
- Data
Volumes []GetInstance V2Data Volume - A set defining the volumes to be attached to the instance.
- Flavor map[string]string
- A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
- Flavor
Id 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
[]Get
Instance V2Interface - A list defining the network interfaces to be attached to the instance.
- Metadata map[string]string
- A map containing metadata, for example tags.
- Name string
- The name of the instance.
- Status string
- The current status of the instance. This is computed automatically and can be used to track the instance's state.
- Vm
State string - The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
- Project
Id float64 - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- Project
Name string - The name of the project. Either 'projectid' or 'projectname' must be specified.
- Region
Id float64 - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- Region
Name string - The name of the region. Either 'regionid' or 'regionname' must be specified.
- boot
Volumes List<GetInstance V2Boot Volume> - A set defining the volumes to be attached to the instance.
- data
Volumes List<GetInstance V2Data Volume> - A set defining the volumes to be attached to the instance.
- flavor Map<String,String>
- A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
- flavor
Id 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<Get
Instance V2Interface> - A list defining the network interfaces to be attached to the instance.
- metadata Map<String,String>
- A map containing metadata, for example tags.
- name String
- The name of the instance.
- status String
- The current status of the instance. This is computed automatically and can be used to track the instance's state.
- vm
State String - The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
- project
Id Double - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- project
Name String - The name of the project. Either 'projectid' or 'projectname' must be specified.
- region
Id Double - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- region
Name String - The name of the region. Either 'regionid' or 'regionname' must be specified.
- boot
Volumes GetInstance V2Boot Volume[] - A set defining the volumes to be attached to the instance.
- data
Volumes GetInstance V2Data Volume[] - A set defining the volumes to be attached to the instance.
- flavor {[key: string]: string}
- A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
- flavor
Id 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
Get
Instance V2Interface[] - A list defining the network interfaces to be attached to the instance.
- metadata {[key: string]: string}
- A map containing metadata, for example tags.
- name string
- The name of the instance.
- status string
- The current status of the instance. This is computed automatically and can be used to track the instance's state.
- vm
State string - The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
- project
Id number - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- project
Name string - The name of the project. Either 'projectid' or 'projectname' must be specified.
- region
Id number - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- region
Name string - The name of the region. Either 'regionid' or 'regionname' must be specified.
- boot_
volumes Sequence[GetInstance V2Boot Volume] - A set defining the volumes to be attached to the instance.
- data_
volumes Sequence[GetInstance V2Data Volume] - A set defining the volumes to be attached to the instance.
- 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[Get
Instance V2Interface] - A list defining the network interfaces to be attached to the instance.
- metadata Mapping[str, str]
- A map containing metadata, for example tags.
- name str
- The name of the instance.
- 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.
- 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.
- boot
Volumes List<Property Map> - A set defining the volumes to be attached to the instance.
- data
Volumes List<Property Map> - A set defining the volumes to be attached to the instance.
- flavor Map<String>
- A map defining the flavor of the instance, for example, {"flavor_name": "g1-standard-2-4", "ram": 4096, ...}.
- flavor
Id 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.
- metadata Map<String>
- A map containing metadata, for example tags.
- name String
- The name of the instance.
- status String
- The current status of the instance. This is computed automatically and can be used to track the instance's state.
- vm
State String - The current virtual machine state of the instance, allowing you to start or stop the VM. Possible values are stopped and active.
- project
Id Number - The uuid of the project. Either 'projectid' or 'projectname' must be specified.
- project
Name String - The name of the project. Either 'projectid' or 'projectname' must be specified.
- region
Id Number - The uuid of the region. Either 'regionid' or 'regionname' must be specified.
- region
Name String - The name of the region. Either 'regionid' or 'regionname' must be specified.
Supporting Types
GetInstanceV2BootVolume
GetInstanceV2DataVolume
GetInstanceV2Interface
- ip_
address str - network_
id str - network_
name str - order float
- port_
id str - subnet_
id str
Package Details
- Repository
- edgecenter edge-center/terraform-provider-edgecenter
- License
- Notes
- This Pulumi package is based on the
edgecenter
Terraform Provider.
edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center