OVHCloud v2.0.7 published on Wednesday, Mar 19, 2025 by OVHcloud
ovh.CloudProject.getInstances
Explore with Pulumi AI
This datasource uses a Beta API
Use this data source to get the list of instances in a region of a public cloud project.
Example Usage
To list your instances:
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@pulumi/ovh";
const instance = ovh.CloudProject.getInstances({
    region: "XXXX",
    serviceName: "YYYY",
});
import pulumi
import pulumi_ovh as ovh
instance = ovh.CloudProject.get_instances(region="XXXX",
    service_name="YYYY")
package main
import (
	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/cloudproject"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudproject.GetInstances(ctx, &cloudproject.GetInstancesArgs{
			Region:      "XXXX",
			ServiceName: "YYYY",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() => 
{
    var instance = Ovh.CloudProject.GetInstances.Invoke(new()
    {
        Region = "XXXX",
        ServiceName = "YYYY",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.CloudProject.CloudProjectFunctions;
import com.pulumi.ovh.CloudProject.inputs.GetInstancesArgs;
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 instance = CloudProjectFunctions.getInstances(GetInstancesArgs.builder()
            .region("XXXX")
            .serviceName("YYYY")
            .build());
    }
}
variables:
  instance:
    fn::invoke:
      function: ovh:CloudProject:getInstances
      arguments:
        region: XXXX
        serviceName: YYYY
Using getInstances
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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>def get_instances(region: Optional[str] = None,
                  service_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(region: Optional[pulumi.Input[str]] = None,
                  service_name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput> Note: This function is named GetInstances in the Go SDK.
public static class GetInstances 
{
    public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
    public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
public static Output<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
fn::invoke:
  function: ovh:CloudProject/getInstances:getInstances
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Region string
- Instance region.
- ServiceName string
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- Region string
- Instance region.
- ServiceName string
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- region String
- Instance region.
- serviceName String
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- region string
- Instance region.
- serviceName string
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- region str
- Instance region.
- service_name str
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
- region String
- Instance region.
- serviceName String
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used.
getInstances Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
List<GetInstances Instance> 
- List of instances
- Region string
- ServiceName string
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
[]GetInstances Instance 
- List of instances
- Region string
- ServiceName string
- id String
- The provider-assigned unique ID for this managed resource.
- instances
List<GetInstances Instance> 
- List of instances
- region String
- serviceName String
- id string
- The provider-assigned unique ID for this managed resource.
- instances
GetInstances Instance[] 
- List of instances
- region string
- serviceName string
- id str
- The provider-assigned unique ID for this managed resource.
- instances
Sequence[cloudproject.Get Instances Instance] 
- List of instances
- region str
- service_name str
- id String
- The provider-assigned unique ID for this managed resource.
- instances List<Property Map>
- List of instances
- region String
- serviceName String
Supporting Types
GetInstancesInstance  
- Addresses
List<GetInstances Instance Address> 
- Instance IP addresses
- AttachedVolumes List<GetInstances Instance Attached Volume> 
- Volumes attached to the instance
- AvailabilityZone string
- Availability zone of the instance
- FlavorId string
- Flavor id
- FlavorName string
- Flavor name
- Id string
- Instance id
- ImageId string
- Image id
- Name string
- Instance name
- SshKey string
- SSH Keypair
- TaskState string
- Instance task state
- Addresses
[]GetInstances Instance Address 
- Instance IP addresses
- AttachedVolumes []GetInstances Instance Attached Volume 
- Volumes attached to the instance
- AvailabilityZone string
- Availability zone of the instance
- FlavorId string
- Flavor id
- FlavorName string
- Flavor name
- Id string
- Instance id
- ImageId string
- Image id
- Name string
- Instance name
- SshKey string
- SSH Keypair
- TaskState string
- Instance task state
- addresses
List<GetInstances Instance Address> 
- Instance IP addresses
- attachedVolumes List<GetInstances Instance Attached Volume> 
- Volumes attached to the instance
- availabilityZone String
- Availability zone of the instance
- flavorId String
- Flavor id
- flavorName String
- Flavor name
- id String
- Instance id
- imageId String
- Image id
- name String
- Instance name
- sshKey String
- SSH Keypair
- taskState String
- Instance task state
- addresses
GetInstances Instance Address[] 
- Instance IP addresses
- attachedVolumes GetInstances Instance Attached Volume[] 
- Volumes attached to the instance
- availabilityZone string
- Availability zone of the instance
- flavorId string
- Flavor id
- flavorName string
- Flavor name
- id string
- Instance id
- imageId string
- Image id
- name string
- Instance name
- sshKey string
- SSH Keypair
- taskState string
- Instance task state
- addresses
Sequence[cloudproject.Get Instances Instance Address] 
- Instance IP addresses
- attached_volumes Sequence[cloudproject.Get Instances Instance Attached Volume] 
- Volumes attached to the instance
- availability_zone str
- Availability zone of the instance
- flavor_id str
- Flavor id
- flavor_name str
- Flavor name
- id str
- Instance id
- image_id str
- Image id
- name str
- Instance name
- ssh_key str
- SSH Keypair
- task_state str
- Instance task state
- addresses List<Property Map>
- Instance IP addresses
- attachedVolumes List<Property Map>
- Volumes attached to the instance
- availabilityZone String
- Availability zone of the instance
- flavorId String
- Flavor id
- flavorName String
- Flavor name
- id String
- Instance id
- imageId String
- Image id
- name String
- Instance name
- sshKey String
- SSH Keypair
- taskState String
- Instance task state
GetInstancesInstanceAddress   
GetInstancesInstanceAttachedVolume    
- Id string
- Instance id
- Id string
- Instance id
- id String
- Instance id
- id string
- Instance id
- id str
- Instance id
- id String
- Instance id
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ovhTerraform Provider.