OVHCloud v2.0.7 published on Wednesday, Mar 19, 2025 by OVHcloud
ovh.CloudProject.getInstance
Explore with Pulumi AI
This datasource uses a Beta API Use this data source to get the instance of a public cloud project.
Example Usage
To get information of an instance:
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@pulumi/ovh";
const instance = ovh.CloudProject.getInstance({
    instanceId: "ZZZZZ",
    region: "XXXX",
    serviceName: "YYYY",
});
import pulumi
import pulumi_ovh as ovh
instance = ovh.CloudProject.get_instance(instance_id="ZZZZZ",
    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.GetInstance(ctx, &cloudproject.GetInstanceArgs{
			InstanceId:  "ZZZZZ",
			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.GetInstance.Invoke(new()
    {
        InstanceId = "ZZZZZ",
        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.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 instance = CloudProjectFunctions.getInstance(GetInstanceArgs.builder()
            .instanceId("ZZZZZ")
            .region("XXXX")
            .serviceName("YYYY")
            .build());
    }
}
variables:
  instance:
    fn::invoke:
      function: ovh:CloudProject:getInstance
      arguments:
        instanceId: ZZZZZ
        region: XXXX
        serviceName: YYYY
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(instance_id: Optional[str] = None,
                 region: Optional[str] = None,
                 service_name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetInstanceResult
def get_instance_output(instance_id: Optional[pulumi.Input[str]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetInstanceResult]func GetInstance(ctx *Context, args *GetInstanceArgs, opts ...InvokeOption) (*GetInstanceResult, error)
func GetInstanceOutput(ctx *Context, args *GetInstanceOutputArgs, opts ...InvokeOption) GetInstanceResultOutput> Note: This function is named GetInstance 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: ovh:CloudProject/getInstance:getInstance
  arguments:
    # arguments dictionaryThe following arguments are supported:
- InstanceId string
- Instance id
- Region string
- Instance region
- ServiceName string
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used
- InstanceId string
- Instance id
- Region string
- Instance region
- ServiceName string
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used
- instanceId String
- Instance id
- region String
- Instance region
- serviceName String
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used
- instanceId string
- Instance id
- region string
- Instance region
- serviceName string
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used
- instance_id str
- Instance id
- region str
- Instance region
- service_name str
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used
- instanceId String
- Instance id
- region String
- Instance region
- serviceName String
- The id of the public cloud project. If omitted,
the OVH_CLOUD_PROJECT_SERVICEenvironment variable is used
getInstance Result
The following output properties are available:
- Addresses
List<GetInstance Address> 
- Instance IP addresses
- AttachedVolumes List<GetInstance Attached Volume> 
- Volumes attached to the instance
- AvailabilityZone string
- Availability zone of the instance
- FlavorId string
- Flavor id
- FlavorName string
- Flavor name
- Id string
- The provider-assigned unique ID for this managed resource.
- ImageId string
- Image id
- InstanceId string
- Name string
- Instance name
- Region string
- ServiceName string
- SshKey string
- SSH Keypair
- TaskState string
- Instance task state
- Addresses
[]GetInstance Address 
- Instance IP addresses
- AttachedVolumes []GetInstance Attached Volume 
- Volumes attached to the instance
- AvailabilityZone string
- Availability zone of the instance
- FlavorId string
- Flavor id
- FlavorName string
- Flavor name
- Id string
- The provider-assigned unique ID for this managed resource.
- ImageId string
- Image id
- InstanceId string
- Name string
- Instance name
- Region string
- ServiceName string
- SshKey string
- SSH Keypair
- TaskState string
- Instance task state
- addresses
List<GetInstance Address> 
- Instance IP addresses
- attachedVolumes List<GetInstance Attached Volume> 
- Volumes attached to the instance
- availabilityZone String
- Availability zone of the instance
- flavorId String
- Flavor id
- flavorName String
- Flavor name
- id String
- The provider-assigned unique ID for this managed resource.
- imageId String
- Image id
- instanceId String
- name String
- Instance name
- region String
- serviceName String
- sshKey String
- SSH Keypair
- taskState String
- Instance task state
- addresses
GetInstance Address[] 
- Instance IP addresses
- attachedVolumes GetInstance Attached Volume[] 
- Volumes attached to the instance
- availabilityZone string
- Availability zone of the instance
- flavorId string
- Flavor id
- flavorName string
- Flavor name
- id string
- The provider-assigned unique ID for this managed resource.
- imageId string
- Image id
- instanceId string
- name string
- Instance name
- region string
- serviceName string
- sshKey string
- SSH Keypair
- taskState string
- Instance task state
- addresses
Sequence[cloudproject.Get Instance Address] 
- Instance IP addresses
- attached_volumes Sequence[cloudproject.Get 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
- The provider-assigned unique ID for this managed resource.
- image_id str
- Image id
- instance_id str
- name str
- Instance name
- region str
- service_name str
- 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
- The provider-assigned unique ID for this managed resource.
- imageId String
- Image id
- instanceId String
- name String
- Instance name
- region String
- serviceName String
- sshKey String
- SSH Keypair
- taskState String
- Instance task state
Supporting Types
GetInstanceAddress  
GetInstanceAttachedVolume   
- 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.