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.
 - Service
Name string - The id of the public cloud project. If omitted,
the 
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. 
- Region string
 - Instance region.
 - Service
Name string - The id of the public cloud project. If omitted,
the 
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. 
- region String
 - Instance region.
 - service
Name String - The id of the public cloud project. If omitted,
the 
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. 
- region string
 - Instance region.
 - service
Name 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.
 - service
Name 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<Get
Instances Instance>  - List of instances
 - Region string
 - Service
Name string 
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Instances
[]Get
Instances Instance  - List of instances
 - Region string
 - Service
Name string 
- id String
 - The provider-assigned unique ID for this managed resource.
 - instances
List<Get
Instances Instance>  - List of instances
 - region String
 - service
Name String 
- id string
 - The provider-assigned unique ID for this managed resource.
 - instances
Get
Instances Instance[]  - List of instances
 - region string
 - service
Name 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
 - service
Name String 
Supporting Types
GetInstancesInstance  
- Addresses
List<Get
Instances Instance Address>  - Instance IP addresses
 - Attached
Volumes List<GetInstances Instance Attached Volume>  - Volumes attached to the instance
 - Availability
Zone string - Availability zone of the instance
 - Flavor
Id string - Flavor id
 - Flavor
Name string - Flavor name
 - Id string
 - Instance id
 - Image
Id string - Image id
 - Name string
 - Instance name
 - Ssh
Key string - SSH Keypair
 - Task
State string - Instance task state
 
- Addresses
[]Get
Instances Instance Address  - Instance IP addresses
 - Attached
Volumes []GetInstances Instance Attached Volume  - Volumes attached to the instance
 - Availability
Zone string - Availability zone of the instance
 - Flavor
Id string - Flavor id
 - Flavor
Name string - Flavor name
 - Id string
 - Instance id
 - Image
Id string - Image id
 - Name string
 - Instance name
 - Ssh
Key string - SSH Keypair
 - Task
State string - Instance task state
 
- addresses
List<Get
Instances Instance Address>  - Instance IP addresses
 - attached
Volumes List<GetInstances Instance Attached Volume>  - Volumes attached to the instance
 - availability
Zone String - Availability zone of the instance
 - flavor
Id String - Flavor id
 - flavor
Name String - Flavor name
 - id String
 - Instance id
 - image
Id String - Image id
 - name String
 - Instance name
 - ssh
Key String - SSH Keypair
 - task
State String - Instance task state
 
- addresses
Get
Instances Instance Address[]  - Instance IP addresses
 - attached
Volumes GetInstances Instance Attached Volume[]  - Volumes attached to the instance
 - availability
Zone string - Availability zone of the instance
 - flavor
Id string - Flavor id
 - flavor
Name string - Flavor name
 - id string
 - Instance id
 - image
Id string - Image id
 - name string
 - Instance name
 - ssh
Key string - SSH Keypair
 - task
State 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
 - attached
Volumes List<Property Map> - Volumes attached to the instance
 - availability
Zone String - Availability zone of the instance
 - flavor
Id String - Flavor id
 - flavor
Name String - Flavor name
 - id String
 - Instance id
 - image
Id String - Image id
 - name String
 - Instance name
 - ssh
Key String - SSH Keypair
 - task
State 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.