1. Packages
  2. Proxmox Virtual Environment (Proxmox VE)
  3. API Docs
  4. Storage
  5. File
Proxmox Virtual Environment (Proxmox VE) v6.18.1 published on Tuesday, Jan 7, 2025 by Daniel Muehlbachler-Pietrzykowski

proxmoxve.Storage.File

Explore with Pulumi AI

Use this resource to upload files to a Proxmox VE node. The file can be a backup, an ISO image, a snippet, or a container template depending on the content_type attribute.

Example Usage

Backups (dump)

The resource with this content type uses SSH access to the node. You might need to configure the ssh option in the provider section.

The provider currently does not support restoring backups. You can use the Proxmox VE web interface or the qmrestore / pct restore command to restore VM / Container from a backup.

import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";

const backup = new proxmoxve.storage.File("backup", {
    contentType: "dump",
    datastoreId: "local",
    nodeName: "pve",
    sourceFile: {
        path: "vzdump-lxc-100-2023_11_08-23_10_05.tar",
    },
});
Copy
import pulumi
import pulumi_proxmoxve as proxmoxve

backup = proxmoxve.storage.File("backup",
    content_type="dump",
    datastore_id="local",
    node_name="pve",
    source_file={
        "path": "vzdump-lxc-100-2023_11_08-23_10_05.tar",
    })
Copy
package main

import (
	"github.com/muhlba91/pulumi-proxmoxve/sdk/v6/go/proxmoxve/Storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Storage.NewFile(ctx, "backup", &Storage.FileArgs{
			ContentType: pulumi.String("dump"),
			DatastoreId: pulumi.String("local"),
			NodeName:    pulumi.String("pve"),
			SourceFile: &storage.FileSourceFileArgs{
				Path: pulumi.String("vzdump-lxc-100-2023_11_08-23_10_05.tar"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ProxmoxVE = Pulumi.ProxmoxVE;

return await Deployment.RunAsync(() => 
{
    var backup = new ProxmoxVE.Storage.File("backup", new()
    {
        ContentType = "dump",
        DatastoreId = "local",
        NodeName = "pve",
        SourceFile = new ProxmoxVE.Storage.Inputs.FileSourceFileArgs
        {
            Path = "vzdump-lxc-100-2023_11_08-23_10_05.tar",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.proxmoxve.Storage.File;
import com.pulumi.proxmoxve.Storage.FileArgs;
import com.pulumi.proxmoxve.Storage.inputs.FileSourceFileArgs;
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 File("backup", FileArgs.builder()
            .contentType("dump")
            .datastoreId("local")
            .nodeName("pve")
            .sourceFile(FileSourceFileArgs.builder()
                .path("vzdump-lxc-100-2023_11_08-23_10_05.tar")
                .build())
            .build());

    }
}
Copy
resources:
  backup:
    type: proxmoxve:Storage:File
    properties:
      contentType: dump
      datastoreId: local
      nodeName: pve
      sourceFile:
        path: vzdump-lxc-100-2023_11_08-23_10_05.tar
Copy

Images

Consider using proxmoxve.Download.File resource instead. Using this resource for images is less efficient (requires to transfer uploaded image to node) though still supported.

import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";

const ubuntuContainerTemplate = new proxmoxve.storage.File("ubuntuContainerTemplate", {
    contentType: "iso",
    datastoreId: "local",
    nodeName: "pve",
    sourceFile: {
        path: "https://cloud-images.ubuntu.com/jammy/20230929/jammy-server-cloudimg-amd64-disk-kvm.img",
    },
});
Copy
import pulumi
import pulumi_proxmoxve as proxmoxve

ubuntu_container_template = proxmoxve.storage.File("ubuntuContainerTemplate",
    content_type="iso",
    datastore_id="local",
    node_name="pve",
    source_file={
        "path": "https://cloud-images.ubuntu.com/jammy/20230929/jammy-server-cloudimg-amd64-disk-kvm.img",
    })
Copy
package main

import (
	"github.com/muhlba91/pulumi-proxmoxve/sdk/v6/go/proxmoxve/Storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Storage.NewFile(ctx, "ubuntuContainerTemplate", &Storage.FileArgs{
			ContentType: pulumi.String("iso"),
			DatastoreId: pulumi.String("local"),
			NodeName:    pulumi.String("pve"),
			SourceFile: &storage.FileSourceFileArgs{
				Path: pulumi.String("https://cloud-images.ubuntu.com/jammy/20230929/jammy-server-cloudimg-amd64-disk-kvm.img"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ProxmoxVE = Pulumi.ProxmoxVE;

return await Deployment.RunAsync(() => 
{
    var ubuntuContainerTemplate = new ProxmoxVE.Storage.File("ubuntuContainerTemplate", new()
    {
        ContentType = "iso",
        DatastoreId = "local",
        NodeName = "pve",
        SourceFile = new ProxmoxVE.Storage.Inputs.FileSourceFileArgs
        {
            Path = "https://cloud-images.ubuntu.com/jammy/20230929/jammy-server-cloudimg-amd64-disk-kvm.img",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.proxmoxve.Storage.File;
import com.pulumi.proxmoxve.Storage.FileArgs;
import com.pulumi.proxmoxve.Storage.inputs.FileSourceFileArgs;
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 ubuntuContainerTemplate = new File("ubuntuContainerTemplate", FileArgs.builder()
            .contentType("iso")
            .datastoreId("local")
            .nodeName("pve")
            .sourceFile(FileSourceFileArgs.builder()
                .path("https://cloud-images.ubuntu.com/jammy/20230929/jammy-server-cloudimg-amd64-disk-kvm.img")
                .build())
            .build());

    }
}
Copy
resources:
  ubuntuContainerTemplate:
    type: proxmoxve:Storage:File
    properties:
      contentType: iso
      datastoreId: local
      nodeName: pve
      sourceFile:
        path: https://cloud-images.ubuntu.com/jammy/20230929/jammy-server-cloudimg-amd64-disk-kvm.img
Copy

Container Template (vztmpl)

Consider using proxmoxve.Download.File resource instead. Using this resource for container images is less efficient (requires to transfer uploaded image to node) though still supported.

import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";

const ubuntuContainerTemplate = new proxmoxve.storage.File("ubuntuContainerTemplate", {
    contentType: "vztmpl",
    datastoreId: "local",
    nodeName: "first-node",
    sourceFile: {
        path: "https://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz",
    },
});
Copy
import pulumi
import pulumi_proxmoxve as proxmoxve

ubuntu_container_template = proxmoxve.storage.File("ubuntuContainerTemplate",
    content_type="vztmpl",
    datastore_id="local",
    node_name="first-node",
    source_file={
        "path": "https://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz",
    })
Copy
package main

import (
	"github.com/muhlba91/pulumi-proxmoxve/sdk/v6/go/proxmoxve/Storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Storage.NewFile(ctx, "ubuntuContainerTemplate", &Storage.FileArgs{
			ContentType: pulumi.String("vztmpl"),
			DatastoreId: pulumi.String("local"),
			NodeName:    pulumi.String("first-node"),
			SourceFile: &storage.FileSourceFileArgs{
				Path: pulumi.String("https://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ProxmoxVE = Pulumi.ProxmoxVE;

return await Deployment.RunAsync(() => 
{
    var ubuntuContainerTemplate = new ProxmoxVE.Storage.File("ubuntuContainerTemplate", new()
    {
        ContentType = "vztmpl",
        DatastoreId = "local",
        NodeName = "first-node",
        SourceFile = new ProxmoxVE.Storage.Inputs.FileSourceFileArgs
        {
            Path = "https://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.proxmoxve.Storage.File;
import com.pulumi.proxmoxve.Storage.FileArgs;
import com.pulumi.proxmoxve.Storage.inputs.FileSourceFileArgs;
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 ubuntuContainerTemplate = new File("ubuntuContainerTemplate", FileArgs.builder()
            .contentType("vztmpl")
            .datastoreId("local")
            .nodeName("first-node")
            .sourceFile(FileSourceFileArgs.builder()
                .path("https://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz")
                .build())
            .build());

    }
}
Copy
resources:
  ubuntuContainerTemplate:
    type: proxmoxve:Storage:File
    properties:
      contentType: vztmpl
      datastoreId: local
      nodeName: first-node
      sourceFile:
        path: https://download.proxmox.com/images/system/ubuntu-20.04-standard_20.04-1_amd64.tar.gz
Copy

Create File Resource

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

Constructor syntax

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

@overload
def File(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         datastore_id: Optional[str] = None,
         node_name: Optional[str] = None,
         content_type: Optional[str] = None,
         file_mode: Optional[str] = None,
         overwrite: Optional[bool] = None,
         source_file: Optional[_storage.FileSourceFileArgs] = None,
         source_raw: Optional[_storage.FileSourceRawArgs] = None,
         timeout_upload: Optional[int] = None)
func NewFile(ctx *Context, name string, args FileArgs, opts ...ResourceOption) (*File, error)
public File(string name, FileArgs args, CustomResourceOptions? opts = null)
public File(String name, FileArgs args)
public File(String name, FileArgs args, CustomResourceOptions options)
type: proxmoxve:Storage:File
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. FileArgs
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. FileArgs
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. FileArgs
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. FileArgs
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. FileArgs
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 proxmoxveFileResource = new ProxmoxVE.Storage.File("proxmoxveFileResource", new()
{
    DatastoreId = "string",
    NodeName = "string",
    ContentType = "string",
    FileMode = "string",
    Overwrite = false,
    SourceFile = new ProxmoxVE.Storage.Inputs.FileSourceFileArgs
    {
        Path = "string",
        Changed = false,
        Checksum = "string",
        FileName = "string",
        Insecure = false,
        MinTls = "string",
    },
    SourceRaw = new ProxmoxVE.Storage.Inputs.FileSourceRawArgs
    {
        Data = "string",
        FileName = "string",
        Resize = 0,
    },
    TimeoutUpload = 0,
});
Copy
example, err := Storage.NewFile(ctx, "proxmoxveFileResource", &Storage.FileArgs{
	DatastoreId: pulumi.String("string"),
	NodeName:    pulumi.String("string"),
	ContentType: pulumi.String("string"),
	FileMode:    pulumi.String("string"),
	Overwrite:   pulumi.Bool(false),
	SourceFile: &storage.FileSourceFileArgs{
		Path:     pulumi.String("string"),
		Changed:  pulumi.Bool(false),
		Checksum: pulumi.String("string"),
		FileName: pulumi.String("string"),
		Insecure: pulumi.Bool(false),
		MinTls:   pulumi.String("string"),
	},
	SourceRaw: &storage.FileSourceRawArgs{
		Data:     pulumi.String("string"),
		FileName: pulumi.String("string"),
		Resize:   pulumi.Int(0),
	},
	TimeoutUpload: pulumi.Int(0),
})
Copy
var proxmoxveFileResource = new File("proxmoxveFileResource", FileArgs.builder()
    .datastoreId("string")
    .nodeName("string")
    .contentType("string")
    .fileMode("string")
    .overwrite(false)
    .sourceFile(FileSourceFileArgs.builder()
        .path("string")
        .changed(false)
        .checksum("string")
        .fileName("string")
        .insecure(false)
        .minTls("string")
        .build())
    .sourceRaw(FileSourceRawArgs.builder()
        .data("string")
        .fileName("string")
        .resize(0)
        .build())
    .timeoutUpload(0)
    .build());
Copy
proxmoxve_file_resource = proxmoxve.storage.File("proxmoxveFileResource",
    datastore_id="string",
    node_name="string",
    content_type="string",
    file_mode="string",
    overwrite=False,
    source_file={
        "path": "string",
        "changed": False,
        "checksum": "string",
        "file_name": "string",
        "insecure": False,
        "min_tls": "string",
    },
    source_raw={
        "data": "string",
        "file_name": "string",
        "resize": 0,
    },
    timeout_upload=0)
Copy
const proxmoxveFileResource = new proxmoxve.storage.File("proxmoxveFileResource", {
    datastoreId: "string",
    nodeName: "string",
    contentType: "string",
    fileMode: "string",
    overwrite: false,
    sourceFile: {
        path: "string",
        changed: false,
        checksum: "string",
        fileName: "string",
        insecure: false,
        minTls: "string",
    },
    sourceRaw: {
        data: "string",
        fileName: "string",
        resize: 0,
    },
    timeoutUpload: 0,
});
Copy
type: proxmoxve:Storage:File
properties:
    contentType: string
    datastoreId: string
    fileMode: string
    nodeName: string
    overwrite: false
    sourceFile:
        changed: false
        checksum: string
        fileName: string
        insecure: false
        minTls: string
        path: string
    sourceRaw:
        data: string
        fileName: string
        resize: 0
    timeoutUpload: 0
Copy

File 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 File resource accepts the following input properties:

DatastoreId
This property is required.
Changes to this property will trigger replacement.
string
The datastore id.
NodeName
This property is required.
Changes to this property will trigger replacement.
string
The node name.
ContentType Changes to this property will trigger replacement. string
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
FileMode Changes to this property will trigger replacement. string
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
Overwrite bool
Whether to overwrite an existing file (defaults to true).
SourceFile Changes to this property will trigger replacement. Pulumi.ProxmoxVE.Storage.Inputs.FileSourceFile
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
SourceRaw Changes to this property will trigger replacement. Pulumi.ProxmoxVE.Storage.Inputs.FileSourceRaw
The raw source (conflicts with source_file).
TimeoutUpload int
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
DatastoreId
This property is required.
Changes to this property will trigger replacement.
string
The datastore id.
NodeName
This property is required.
Changes to this property will trigger replacement.
string
The node name.
ContentType Changes to this property will trigger replacement. string
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
FileMode Changes to this property will trigger replacement. string
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
Overwrite bool
Whether to overwrite an existing file (defaults to true).
SourceFile Changes to this property will trigger replacement. FileSourceFileArgs
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
SourceRaw Changes to this property will trigger replacement. FileSourceRawArgs
The raw source (conflicts with source_file).
TimeoutUpload int
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
datastoreId
This property is required.
Changes to this property will trigger replacement.
String
The datastore id.
nodeName
This property is required.
Changes to this property will trigger replacement.
String
The node name.
contentType Changes to this property will trigger replacement. String
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
fileMode Changes to this property will trigger replacement. String
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
overwrite Boolean
Whether to overwrite an existing file (defaults to true).
sourceFile Changes to this property will trigger replacement. FileSourceFile
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
sourceRaw Changes to this property will trigger replacement. FileSourceRaw
The raw source (conflicts with source_file).
timeoutUpload Integer
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
datastoreId
This property is required.
Changes to this property will trigger replacement.
string
The datastore id.
nodeName
This property is required.
Changes to this property will trigger replacement.
string
The node name.
contentType Changes to this property will trigger replacement. string
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
fileMode Changes to this property will trigger replacement. string
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
overwrite boolean
Whether to overwrite an existing file (defaults to true).
sourceFile Changes to this property will trigger replacement. FileSourceFile
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
sourceRaw Changes to this property will trigger replacement. FileSourceRaw
The raw source (conflicts with source_file).
timeoutUpload number
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
datastore_id
This property is required.
Changes to this property will trigger replacement.
str
The datastore id.
node_name
This property is required.
Changes to this property will trigger replacement.
str
The node name.
content_type Changes to this property will trigger replacement. str
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
file_mode Changes to this property will trigger replacement. str
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
overwrite bool
Whether to overwrite an existing file (defaults to true).
source_file Changes to this property will trigger replacement. storage.FileSourceFileArgs
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
source_raw Changes to this property will trigger replacement. storage.FileSourceRawArgs
The raw source (conflicts with source_file).
timeout_upload int
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
datastoreId
This property is required.
Changes to this property will trigger replacement.
String
The datastore id.
nodeName
This property is required.
Changes to this property will trigger replacement.
String
The node name.
contentType Changes to this property will trigger replacement. String
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
fileMode Changes to this property will trigger replacement. String
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
overwrite Boolean
Whether to overwrite an existing file (defaults to true).
sourceFile Changes to this property will trigger replacement. Property Map
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
sourceRaw Changes to this property will trigger replacement. Property Map
The raw source (conflicts with source_file).
timeoutUpload Number
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).

Outputs

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

FileModificationDate string
The file modification date (RFC 3339).
FileName string
The file name.
FileSize int
The file size in bytes.
FileTag string
The file tag.
Id string
The provider-assigned unique ID for this managed resource.
FileModificationDate string
The file modification date (RFC 3339).
FileName string
The file name.
FileSize int
The file size in bytes.
FileTag string
The file tag.
Id string
The provider-assigned unique ID for this managed resource.
fileModificationDate String
The file modification date (RFC 3339).
fileName String
The file name.
fileSize Integer
The file size in bytes.
fileTag String
The file tag.
id String
The provider-assigned unique ID for this managed resource.
fileModificationDate string
The file modification date (RFC 3339).
fileName string
The file name.
fileSize number
The file size in bytes.
fileTag string
The file tag.
id string
The provider-assigned unique ID for this managed resource.
file_modification_date str
The file modification date (RFC 3339).
file_name str
The file name.
file_size int
The file size in bytes.
file_tag str
The file tag.
id str
The provider-assigned unique ID for this managed resource.
fileModificationDate String
The file modification date (RFC 3339).
fileName String
The file name.
fileSize Number
The file size in bytes.
fileTag String
The file tag.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing File Resource

Get an existing File 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?: FileState, opts?: CustomResourceOptions): File
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        content_type: Optional[str] = None,
        datastore_id: Optional[str] = None,
        file_mode: Optional[str] = None,
        file_modification_date: Optional[str] = None,
        file_name: Optional[str] = None,
        file_size: Optional[int] = None,
        file_tag: Optional[str] = None,
        node_name: Optional[str] = None,
        overwrite: Optional[bool] = None,
        source_file: Optional[_storage.FileSourceFileArgs] = None,
        source_raw: Optional[_storage.FileSourceRawArgs] = None,
        timeout_upload: Optional[int] = None) -> File
func GetFile(ctx *Context, name string, id IDInput, state *FileState, opts ...ResourceOption) (*File, error)
public static File Get(string name, Input<string> id, FileState? state, CustomResourceOptions? opts = null)
public static File get(String name, Output<String> id, FileState state, CustomResourceOptions options)
resources:  _:    type: proxmoxve:Storage:File    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:
ContentType Changes to this property will trigger replacement. string
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
DatastoreId Changes to this property will trigger replacement. string
The datastore id.
FileMode Changes to this property will trigger replacement. string
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
FileModificationDate Changes to this property will trigger replacement. string
The file modification date (RFC 3339).
FileName string
The file name.
FileSize Changes to this property will trigger replacement. int
The file size in bytes.
FileTag Changes to this property will trigger replacement. string
The file tag.
NodeName Changes to this property will trigger replacement. string
The node name.
Overwrite bool
Whether to overwrite an existing file (defaults to true).
SourceFile Changes to this property will trigger replacement. Pulumi.ProxmoxVE.Storage.Inputs.FileSourceFile
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
SourceRaw Changes to this property will trigger replacement. Pulumi.ProxmoxVE.Storage.Inputs.FileSourceRaw
The raw source (conflicts with source_file).
TimeoutUpload int
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
ContentType Changes to this property will trigger replacement. string
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
DatastoreId Changes to this property will trigger replacement. string
The datastore id.
FileMode Changes to this property will trigger replacement. string
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
FileModificationDate Changes to this property will trigger replacement. string
The file modification date (RFC 3339).
FileName string
The file name.
FileSize Changes to this property will trigger replacement. int
The file size in bytes.
FileTag Changes to this property will trigger replacement. string
The file tag.
NodeName Changes to this property will trigger replacement. string
The node name.
Overwrite bool
Whether to overwrite an existing file (defaults to true).
SourceFile Changes to this property will trigger replacement. FileSourceFileArgs
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
SourceRaw Changes to this property will trigger replacement. FileSourceRawArgs
The raw source (conflicts with source_file).
TimeoutUpload int
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
contentType Changes to this property will trigger replacement. String
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
datastoreId Changes to this property will trigger replacement. String
The datastore id.
fileMode Changes to this property will trigger replacement. String
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
fileModificationDate Changes to this property will trigger replacement. String
The file modification date (RFC 3339).
fileName String
The file name.
fileSize Changes to this property will trigger replacement. Integer
The file size in bytes.
fileTag Changes to this property will trigger replacement. String
The file tag.
nodeName Changes to this property will trigger replacement. String
The node name.
overwrite Boolean
Whether to overwrite an existing file (defaults to true).
sourceFile Changes to this property will trigger replacement. FileSourceFile
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
sourceRaw Changes to this property will trigger replacement. FileSourceRaw
The raw source (conflicts with source_file).
timeoutUpload Integer
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
contentType Changes to this property will trigger replacement. string
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
datastoreId Changes to this property will trigger replacement. string
The datastore id.
fileMode Changes to this property will trigger replacement. string
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
fileModificationDate Changes to this property will trigger replacement. string
The file modification date (RFC 3339).
fileName string
The file name.
fileSize Changes to this property will trigger replacement. number
The file size in bytes.
fileTag Changes to this property will trigger replacement. string
The file tag.
nodeName Changes to this property will trigger replacement. string
The node name.
overwrite boolean
Whether to overwrite an existing file (defaults to true).
sourceFile Changes to this property will trigger replacement. FileSourceFile
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
sourceRaw Changes to this property will trigger replacement. FileSourceRaw
The raw source (conflicts with source_file).
timeoutUpload number
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
content_type Changes to this property will trigger replacement. str
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
datastore_id Changes to this property will trigger replacement. str
The datastore id.
file_mode Changes to this property will trigger replacement. str
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
file_modification_date Changes to this property will trigger replacement. str
The file modification date (RFC 3339).
file_name str
The file name.
file_size Changes to this property will trigger replacement. int
The file size in bytes.
file_tag Changes to this property will trigger replacement. str
The file tag.
node_name Changes to this property will trigger replacement. str
The node name.
overwrite bool
Whether to overwrite an existing file (defaults to true).
source_file Changes to this property will trigger replacement. storage.FileSourceFileArgs
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
source_raw Changes to this property will trigger replacement. storage.FileSourceRawArgs
The raw source (conflicts with source_file).
timeout_upload int
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).
contentType Changes to this property will trigger replacement. String
The content type. If not specified, the content type will be inferred from the file extension. Valid values are:
datastoreId Changes to this property will trigger replacement. String
The datastore id.
fileMode Changes to this property will trigger replacement. String
The file mode in octal format, e.g. 0700 or 600. Note that the prefixes 0o and 0x is not supported! Setting this attribute is also only allowed for root@pam authenticated user.
fileModificationDate Changes to this property will trigger replacement. String
The file modification date (RFC 3339).
fileName String
The file name.
fileSize Changes to this property will trigger replacement. Number
The file size in bytes.
fileTag Changes to this property will trigger replacement. String
The file tag.
nodeName Changes to this property will trigger replacement. String
The node name.
overwrite Boolean
Whether to overwrite an existing file (defaults to true).
sourceFile Changes to this property will trigger replacement. Property Map
The source file (conflicts with source_raw), could be a local file or a URL. If the source file is a URL, the file will be downloaded and stored locally before uploading it to Proxmox VE.
sourceRaw Changes to this property will trigger replacement. Property Map
The raw source (conflicts with source_file).
timeoutUpload Number
Timeout for uploading ISO/VSTMPL files in seconds (defaults to 1800).

Supporting Types

FileSourceFile
, FileSourceFileArgs

Path
This property is required.
Changes to this property will trigger replacement.
string
A path to a local file or a URL.
Changed Changes to this property will trigger replacement. bool
Whether the source file has changed since the last run
Checksum Changes to this property will trigger replacement. string
The SHA256 checksum of the source file.
FileName Changes to this property will trigger replacement. string
The file name to use instead of the source file name. Useful when the source file does not have a valid file extension, for example when the source file is a URL referencing a .qcow2 image.
Insecure Changes to this property will trigger replacement. bool
Whether to skip the TLS verification step for HTTPS sources (defaults to false).
MinTls Changes to this property will trigger replacement. string
The minimum required TLS version for HTTPS sources. "Supported values: 1.0|1.1|1.2|1.3 (defaults to 1.3).
Path
This property is required.
Changes to this property will trigger replacement.
string
A path to a local file or a URL.
Changed Changes to this property will trigger replacement. bool
Whether the source file has changed since the last run
Checksum Changes to this property will trigger replacement. string
The SHA256 checksum of the source file.
FileName Changes to this property will trigger replacement. string
The file name to use instead of the source file name. Useful when the source file does not have a valid file extension, for example when the source file is a URL referencing a .qcow2 image.
Insecure Changes to this property will trigger replacement. bool
Whether to skip the TLS verification step for HTTPS sources (defaults to false).
MinTls Changes to this property will trigger replacement. string
The minimum required TLS version for HTTPS sources. "Supported values: 1.0|1.1|1.2|1.3 (defaults to 1.3).
path
This property is required.
Changes to this property will trigger replacement.
String
A path to a local file or a URL.
changed Changes to this property will trigger replacement. Boolean
Whether the source file has changed since the last run
checksum Changes to this property will trigger replacement. String
The SHA256 checksum of the source file.
fileName Changes to this property will trigger replacement. String
The file name to use instead of the source file name. Useful when the source file does not have a valid file extension, for example when the source file is a URL referencing a .qcow2 image.
insecure Changes to this property will trigger replacement. Boolean
Whether to skip the TLS verification step for HTTPS sources (defaults to false).
minTls Changes to this property will trigger replacement. String
The minimum required TLS version for HTTPS sources. "Supported values: 1.0|1.1|1.2|1.3 (defaults to 1.3).
path
This property is required.
Changes to this property will trigger replacement.
string
A path to a local file or a URL.
changed Changes to this property will trigger replacement. boolean
Whether the source file has changed since the last run
checksum Changes to this property will trigger replacement. string
The SHA256 checksum of the source file.
fileName Changes to this property will trigger replacement. string
The file name to use instead of the source file name. Useful when the source file does not have a valid file extension, for example when the source file is a URL referencing a .qcow2 image.
insecure Changes to this property will trigger replacement. boolean
Whether to skip the TLS verification step for HTTPS sources (defaults to false).
minTls Changes to this property will trigger replacement. string
The minimum required TLS version for HTTPS sources. "Supported values: 1.0|1.1|1.2|1.3 (defaults to 1.3).
path
This property is required.
Changes to this property will trigger replacement.
str
A path to a local file or a URL.
changed Changes to this property will trigger replacement. bool
Whether the source file has changed since the last run
checksum Changes to this property will trigger replacement. str
The SHA256 checksum of the source file.
file_name Changes to this property will trigger replacement. str
The file name to use instead of the source file name. Useful when the source file does not have a valid file extension, for example when the source file is a URL referencing a .qcow2 image.
insecure Changes to this property will trigger replacement. bool
Whether to skip the TLS verification step for HTTPS sources (defaults to false).
min_tls Changes to this property will trigger replacement. str
The minimum required TLS version for HTTPS sources. "Supported values: 1.0|1.1|1.2|1.3 (defaults to 1.3).
path
This property is required.
Changes to this property will trigger replacement.
String
A path to a local file or a URL.
changed Changes to this property will trigger replacement. Boolean
Whether the source file has changed since the last run
checksum Changes to this property will trigger replacement. String
The SHA256 checksum of the source file.
fileName Changes to this property will trigger replacement. String
The file name to use instead of the source file name. Useful when the source file does not have a valid file extension, for example when the source file is a URL referencing a .qcow2 image.
insecure Changes to this property will trigger replacement. Boolean
Whether to skip the TLS verification step for HTTPS sources (defaults to false).
minTls Changes to this property will trigger replacement. String
The minimum required TLS version for HTTPS sources. "Supported values: 1.0|1.1|1.2|1.3 (defaults to 1.3).

FileSourceRaw
, FileSourceRawArgs

Data
This property is required.
Changes to this property will trigger replacement.
string
The raw data.
FileName
This property is required.
Changes to this property will trigger replacement.
string
The file name.
Resize Changes to this property will trigger replacement. int
The number of bytes to resize the file to.
Data
This property is required.
Changes to this property will trigger replacement.
string
The raw data.
FileName
This property is required.
Changes to this property will trigger replacement.
string
The file name.
Resize Changes to this property will trigger replacement. int
The number of bytes to resize the file to.
data
This property is required.
Changes to this property will trigger replacement.
String
The raw data.
fileName
This property is required.
Changes to this property will trigger replacement.
String
The file name.
resize Changes to this property will trigger replacement. Integer
The number of bytes to resize the file to.
data
This property is required.
Changes to this property will trigger replacement.
string
The raw data.
fileName
This property is required.
Changes to this property will trigger replacement.
string
The file name.
resize Changes to this property will trigger replacement. number
The number of bytes to resize the file to.
data
This property is required.
Changes to this property will trigger replacement.
str
The raw data.
file_name
This property is required.
Changes to this property will trigger replacement.
str
The file name.
resize Changes to this property will trigger replacement. int
The number of bytes to resize the file to.
data
This property is required.
Changes to this property will trigger replacement.
String
The raw data.
fileName
This property is required.
Changes to this property will trigger replacement.
String
The file name.
resize Changes to this property will trigger replacement. Number
The number of bytes to resize the file to.

Import

ant Notes

The Proxmox VE API endpoint for file uploads does not support chunked transfer encoding, which means that we must first store the source file as a temporary file locally before uploading it.

You must ensure that you have at least Size-in-MB * 2 + 1 MB of storage space available (twice the size plus overhead because a multipart payload needs to be created as another temporary file).

By default, if the specified file already exists, the resource will unconditionally replace it and take ownership of the resource. On destruction, the file will be deleted as if it did not exist before. If you want to prevent the resource from replacing the file, set overwrite to false.

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

Package Details

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