edgecenter 0.7.34 published on Monday, Apr 14, 2025 by edge-center
edgecenter.getInstance
Explore with Pulumi AI
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.
- 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.
getInstance Result
The following output properties are available:
- Addresses
List<Get
Instance Address> - 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, ...}.
- 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 Interface> - A list defining the network interfaces to be attached to the instance.
- Metadatas
List<Get
Instance Metadata> - Name string
- The name of the instance.
- Security
Groups List<GetInstance Security Group> - 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.
- 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.
- Volumes
List<Get
Instance Volume> - A set defining the volumes to be attached to the instance.
- 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.
- Addresses
[]Get
Instance Address - 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, ...}.
- 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 Interface - A list defining the network interfaces to be attached to the instance.
- Metadatas
[]Get
Instance Metadata - Name string
- The name of the instance.
- Security
Groups []GetInstance Security Group - 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.
- 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.
- Volumes
[]Get
Instance Volume - A set defining the volumes to be attached to the instance.
- 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.
- addresses
List<Get
Instance Address> - 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, ...}.
- 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 Interface> - A list defining the network interfaces to be attached to the instance.
- metadatas
List<Get
Instance Metadata> - name String
- The name of the instance.
- security
Groups List<GetInstance Security Group> - 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.
- 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.
- volumes
List<Get
Instance Volume> - A set defining the volumes to be attached to the instance.
- 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.
- addresses
Get
Instance Address[] - 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, ...}.
- 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 Interface[] - A list defining the network interfaces to be attached to the instance.
- metadatas
Get
Instance Metadata[] - name string
- The name of the instance.
- security
Groups GetInstance Security Group[] - 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.
- 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.
- volumes
Get
Instance Volume[] - A set defining the volumes to be attached to the instance.
- 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.
- addresses
Sequence[Get
Instance Address] - 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[Get
Instance Interface] - A list defining the network interfaces to be attached to the instance.
- metadatas
Sequence[Get
Instance Metadata] - name str
- The name of the instance.
- security_
groups Sequence[GetInstance Security Group] - 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[Get
Instance Volume] - 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, ...}.
- 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.
- metadatas List<Property Map>
- name String
- The name of the instance.
- security
Groups 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.
- 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.
- volumes List<Property Map>
- A set defining the volumes to be attached to the instance.
- 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
GetInstanceAddress
GetInstanceAddressNet
GetInstanceInterface
- ip_
address str - network_
id str - port_
id str - subnet_
id str
GetInstanceMetadata
GetInstanceSecurityGroup
- Name string
- Name string
- name String
- name string
- name str
- name String
GetInstanceVolume
- Delete
On boolTermination - Volume
Id string
- Delete
On boolTermination - Volume
Id string
- delete
On BooleanTermination - volume
Id String
- delete
On booleanTermination - volume
Id string
- delete_
on_ booltermination - volume_
id str
- delete
On BooleanTermination - volume
Id String
Package Details
- Repository
- edgecenter edge-center/terraform-provider-edgecenter
- License
- Notes
- This Pulumi package is based on the
edgecenter
Terraform Provider.
edgecenter 0.7.34 published on Monday, Apr 14, 2025 by edge-center