1. Packages
  2. OVH
  3. API Docs
  4. CloudProject
  5. VolumeBackup
OVHCloud v2.1.0 published on Friday, Mar 28, 2025 by OVHcloud

ovh.CloudProject.VolumeBackup

Explore with Pulumi AI

Manage backups for the given volume in a public cloud project.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";

const backup = new ovh.cloudproject.VolumeBackup("backup", {
    regionName: "GRA9",
    serviceName: "<public cloud project ID>",
    volumeId: "<volume ID>",
});
Copy
import pulumi
import pulumi_ovh as ovh

backup = ovh.cloud_project.VolumeBackup("backup",
    region_name="GRA9",
    service_name="<public cloud project ID>",
    volume_id="<volume ID>")
Copy
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.NewVolumeBackup(ctx, "backup", &cloudproject.VolumeBackupArgs{
			RegionName:  pulumi.String("GRA9"),
			ServiceName: pulumi.String("<public cloud project ID>"),
			VolumeId:    pulumi.String("<volume ID>"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var backup = new Ovh.CloudProject.VolumeBackup("backup", new()
    {
        RegionName = "GRA9",
        ServiceName = "<public cloud project ID>",
        VolumeId = "<volume ID>",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.CloudProject.VolumeBackup;
import com.pulumi.ovh.CloudProject.VolumeBackupArgs;
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) {
        var backup = new VolumeBackup("backup", VolumeBackupArgs.builder()
            .regionName("GRA9")
            .serviceName("<public cloud project ID>")
            .volumeId("<volume ID>")
            .build());

    }
}
Copy
resources:
  backup:
    type: ovh:CloudProject:VolumeBackup
    properties:
      regionName: GRA9
      serviceName: <public cloud project ID>
      volumeId: <volume ID>
Copy

Create VolumeBackup Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new VolumeBackup(name: string, args: VolumeBackupArgs, opts?: CustomResourceOptions);
@overload
def VolumeBackup(resource_name: str,
                 args: VolumeBackupArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def VolumeBackup(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 region_name: Optional[str] = None,
                 service_name: Optional[str] = None,
                 volume_id: Optional[str] = None,
                 name: Optional[str] = None)
func NewVolumeBackup(ctx *Context, name string, args VolumeBackupArgs, opts ...ResourceOption) (*VolumeBackup, error)
public VolumeBackup(string name, VolumeBackupArgs args, CustomResourceOptions? opts = null)
public VolumeBackup(String name, VolumeBackupArgs args)
public VolumeBackup(String name, VolumeBackupArgs args, CustomResourceOptions options)
type: ovh:CloudProject:VolumeBackup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VolumeBackupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VolumeBackupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VolumeBackupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VolumeBackupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VolumeBackupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var volumeBackupResource = new Ovh.CloudProject.VolumeBackup("volumeBackupResource", new()
{
    RegionName = "string",
    ServiceName = "string",
    VolumeId = "string",
    Name = "string",
});
Copy
example, err := CloudProject.NewVolumeBackup(ctx, "volumeBackupResource", &CloudProject.VolumeBackupArgs{
	RegionName:  pulumi.String("string"),
	ServiceName: pulumi.String("string"),
	VolumeId:    pulumi.String("string"),
	Name:        pulumi.String("string"),
})
Copy
var volumeBackupResource = new VolumeBackup("volumeBackupResource", VolumeBackupArgs.builder()
    .regionName("string")
    .serviceName("string")
    .volumeId("string")
    .name("string")
    .build());
Copy
volume_backup_resource = ovh.cloud_project.VolumeBackup("volumeBackupResource",
    region_name="string",
    service_name="string",
    volume_id="string",
    name="string")
Copy
const volumeBackupResource = new ovh.cloudproject.VolumeBackup("volumeBackupResource", {
    regionName: "string",
    serviceName: "string",
    volumeId: "string",
    name: "string",
});
Copy
type: ovh:CloudProject:VolumeBackup
properties:
    name: string
    regionName: string
    serviceName: string
    volumeId: string
Copy

VolumeBackup Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The VolumeBackup resource accepts the following input properties:

RegionName This property is required. string
Region name
ServiceName This property is required. string
Service name
VolumeId This property is required. string
ID of the volume to backup
Name string
name of the backup
RegionName This property is required. string
Region name
ServiceName This property is required. string
Service name
VolumeId This property is required. string
ID of the volume to backup
Name string
name of the backup
regionName This property is required. String
Region name
serviceName This property is required. String
Service name
volumeId This property is required. String
ID of the volume to backup
name String
name of the backup
regionName This property is required. string
Region name
serviceName This property is required. string
Service name
volumeId This property is required. string
ID of the volume to backup
name string
name of the backup
region_name This property is required. str
Region name
service_name This property is required. str
Service name
volume_id This property is required. str
ID of the volume to backup
name str
name of the backup
regionName This property is required. String
Region name
serviceName This property is required. String
Service name
volumeId This property is required. String
ID of the volume to backup
name String
name of the backup

Outputs

All input properties are implicitly available as output properties. Additionally, the VolumeBackup resource produces the following output properties:

CreationDate string
Creation date of the backup
Id string
The provider-assigned unique ID for this managed resource.
Region string
Volume backup region
Size double
Size of the backup in GiB
Status string
Staus of the backup
CreationDate string
Creation date of the backup
Id string
The provider-assigned unique ID for this managed resource.
Region string
Volume backup region
Size float64
Size of the backup in GiB
Status string
Staus of the backup
creationDate String
Creation date of the backup
id String
The provider-assigned unique ID for this managed resource.
region String
Volume backup region
size Double
Size of the backup in GiB
status String
Staus of the backup
creationDate string
Creation date of the backup
id string
The provider-assigned unique ID for this managed resource.
region string
Volume backup region
size number
Size of the backup in GiB
status string
Staus of the backup
creation_date str
Creation date of the backup
id str
The provider-assigned unique ID for this managed resource.
region str
Volume backup region
size float
Size of the backup in GiB
status str
Staus of the backup
creationDate String
Creation date of the backup
id String
The provider-assigned unique ID for this managed resource.
region String
Volume backup region
size Number
Size of the backup in GiB
status String
Staus of the backup

Look up Existing VolumeBackup Resource

Get an existing VolumeBackup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VolumeBackupState, opts?: CustomResourceOptions): VolumeBackup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        creation_date: Optional[str] = None,
        name: Optional[str] = None,
        region: Optional[str] = None,
        region_name: Optional[str] = None,
        service_name: Optional[str] = None,
        size: Optional[float] = None,
        status: Optional[str] = None,
        volume_id: Optional[str] = None) -> VolumeBackup
func GetVolumeBackup(ctx *Context, name string, id IDInput, state *VolumeBackupState, opts ...ResourceOption) (*VolumeBackup, error)
public static VolumeBackup Get(string name, Input<string> id, VolumeBackupState? state, CustomResourceOptions? opts = null)
public static VolumeBackup get(String name, Output<String> id, VolumeBackupState state, CustomResourceOptions options)
resources:  _:    type: ovh:CloudProject:VolumeBackup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CreationDate string
Creation date of the backup
Name string
name of the backup
Region string
Volume backup region
RegionName string
Region name
ServiceName string
Service name
Size double
Size of the backup in GiB
Status string
Staus of the backup
VolumeId string
ID of the volume to backup
CreationDate string
Creation date of the backup
Name string
name of the backup
Region string
Volume backup region
RegionName string
Region name
ServiceName string
Service name
Size float64
Size of the backup in GiB
Status string
Staus of the backup
VolumeId string
ID of the volume to backup
creationDate String
Creation date of the backup
name String
name of the backup
region String
Volume backup region
regionName String
Region name
serviceName String
Service name
size Double
Size of the backup in GiB
status String
Staus of the backup
volumeId String
ID of the volume to backup
creationDate string
Creation date of the backup
name string
name of the backup
region string
Volume backup region
regionName string
Region name
serviceName string
Service name
size number
Size of the backup in GiB
status string
Staus of the backup
volumeId string
ID of the volume to backup
creation_date str
Creation date of the backup
name str
name of the backup
region str
Volume backup region
region_name str
Region name
service_name str
Service name
size float
Size of the backup in GiB
status str
Staus of the backup
volume_id str
ID of the volume to backup
creationDate String
Creation date of the backup
name String
name of the backup
region String
Volume backup region
regionName String
Region name
serviceName String
Service name
size Number
Size of the backup in GiB
status String
Staus of the backup
volumeId String
ID of the volume to backup

Import

A volume backup in a public cloud project can be imported using the service_name, region_name and id attributes. Using the following configuration:

terraform

import {

id = “<service_name>/<region_name>/

to = ovh_cloud_project_volume_backup.backup

}

You can then run:

bash

$ pulumi preview -generate-config-out=backup.tf

$ pulumi up

The file backup.tf will then contain the imported resource’s configuration, that can be copied next to the import block above. See https://developer.hashicorp.com/terraform/language/import/generating-configuration for more details.

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
ovh ovh/pulumi-ovh
License
Apache-2.0
Notes
This Pulumi package is based on the ovh Terraform Provider.