1. Packages
  2. Proxmox Virtual Environment (Proxmox VE)
  3. API Docs
  4. Apt
  5. Repository
Proxmox Virtual Environment (Proxmox VE) v7.0.0 published on Tuesday, Apr 1, 2025 by Daniel Muehlbachler-Pietrzykowski

proxmoxve.Apt.Repository

Explore with Pulumi AI

Manages an APT repository of a Proxmox VE node.

Example Usage

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

const example = new proxmoxve.apt.Repository("example", {
    enabled: true,
    filePath: "/etc/apt/sources.list",
    index: 0,
    node: "pve",
});
Copy
import pulumi
import pulumi_proxmoxve as proxmoxve

example = proxmoxve.apt.Repository("example",
    enabled=True,
    file_path="/etc/apt/sources.list",
    index=0,
    node="pve")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apt.NewRepository(ctx, "example", &apt.RepositoryArgs{
			Enabled:  pulumi.Bool(true),
			FilePath: pulumi.String("/etc/apt/sources.list"),
			Index:    pulumi.Int(0),
			Node:     pulumi.String("pve"),
		})
		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 example = new ProxmoxVE.Apt.Repository("example", new()
    {
        Enabled = true,
        FilePath = "/etc/apt/sources.list",
        Index = 0,
        Node = "pve",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.proxmoxve.Apt.Repository;
import com.pulumi.proxmoxve.Apt.RepositoryArgs;
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 example = new Repository("example", RepositoryArgs.builder()
            .enabled(true)
            .filePath("/etc/apt/sources.list")
            .index(0)
            .node("pve")
            .build());

    }
}
Copy
resources:
  example:
    type: proxmoxve:Apt:Repository
    properties:
      enabled: true
      filePath: /etc/apt/sources.list
      index: 0
      node: pve
Copy

Create Repository Resource

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

Constructor syntax

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

@overload
def Repository(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               file_path: Optional[str] = None,
               index: Optional[int] = None,
               node: Optional[str] = None,
               enabled: Optional[bool] = None)
func NewRepository(ctx *Context, name string, args RepositoryArgs, opts ...ResourceOption) (*Repository, error)
public Repository(string name, RepositoryArgs args, CustomResourceOptions? opts = null)
public Repository(String name, RepositoryArgs args)
public Repository(String name, RepositoryArgs args, CustomResourceOptions options)
type: proxmoxve:Apt:Repository
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. RepositoryArgs
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. RepositoryArgs
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. RepositoryArgs
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. RepositoryArgs
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. RepositoryArgs
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 repositoryResource = new ProxmoxVE.Apt.Repository("repositoryResource", new()
{
    FilePath = "string",
    Index = 0,
    Node = "string",
    Enabled = false,
});
Copy
example, err := apt.NewRepository(ctx, "repositoryResource", &apt.RepositoryArgs{
	FilePath: pulumi.String("string"),
	Index:    pulumi.Int(0),
	Node:     pulumi.String("string"),
	Enabled:  pulumi.Bool(false),
})
Copy
var repositoryResource = new Repository("repositoryResource", RepositoryArgs.builder()
    .filePath("string")
    .index(0)
    .node("string")
    .enabled(false)
    .build());
Copy
repository_resource = proxmoxve.apt.Repository("repositoryResource",
    file_path="string",
    index=0,
    node="string",
    enabled=False)
Copy
const repositoryResource = new proxmoxve.apt.Repository("repositoryResource", {
    filePath: "string",
    index: 0,
    node: "string",
    enabled: false,
});
Copy
type: proxmoxve:Apt:Repository
properties:
    enabled: false
    filePath: string
    index: 0
    node: string
Copy

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

FilePath This property is required. string
The absolute path of the source list file that contains this repository.
Index This property is required. int
The index within the defining source list file.
Node This property is required. string
The name of the target Proxmox VE node.
Enabled bool
Indicates the activation status.
FilePath This property is required. string
The absolute path of the source list file that contains this repository.
Index This property is required. int
The index within the defining source list file.
Node This property is required. string
The name of the target Proxmox VE node.
Enabled bool
Indicates the activation status.
filePath This property is required. String
The absolute path of the source list file that contains this repository.
index This property is required. Integer
The index within the defining source list file.
node This property is required. String
The name of the target Proxmox VE node.
enabled Boolean
Indicates the activation status.
filePath This property is required. string
The absolute path of the source list file that contains this repository.
index This property is required. number
The index within the defining source list file.
node This property is required. string
The name of the target Proxmox VE node.
enabled boolean
Indicates the activation status.
file_path This property is required. str
The absolute path of the source list file that contains this repository.
index This property is required. int
The index within the defining source list file.
node This property is required. str
The name of the target Proxmox VE node.
enabled bool
Indicates the activation status.
filePath This property is required. String
The absolute path of the source list file that contains this repository.
index This property is required. Number
The index within the defining source list file.
node This property is required. String
The name of the target Proxmox VE node.
enabled Boolean
Indicates the activation status.

Outputs

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

Comment string
The associated comment.
Components List<string>
The list of components.
FileType string
The format of the defining source list file.
Id string
The provider-assigned unique ID for this managed resource.
PackageTypes List<string>
The list of package types.
Suites List<string>
The list of package distributions.
Uris List<string>
The list of repository URIs.
Comment string
The associated comment.
Components []string
The list of components.
FileType string
The format of the defining source list file.
Id string
The provider-assigned unique ID for this managed resource.
PackageTypes []string
The list of package types.
Suites []string
The list of package distributions.
Uris []string
The list of repository URIs.
comment String
The associated comment.
components List<String>
The list of components.
fileType String
The format of the defining source list file.
id String
The provider-assigned unique ID for this managed resource.
packageTypes List<String>
The list of package types.
suites List<String>
The list of package distributions.
uris List<String>
The list of repository URIs.
comment string
The associated comment.
components string[]
The list of components.
fileType string
The format of the defining source list file.
id string
The provider-assigned unique ID for this managed resource.
packageTypes string[]
The list of package types.
suites string[]
The list of package distributions.
uris string[]
The list of repository URIs.
comment str
The associated comment.
components Sequence[str]
The list of components.
file_type str
The format of the defining source list file.
id str
The provider-assigned unique ID for this managed resource.
package_types Sequence[str]
The list of package types.
suites Sequence[str]
The list of package distributions.
uris Sequence[str]
The list of repository URIs.
comment String
The associated comment.
components List<String>
The list of components.
fileType String
The format of the defining source list file.
id String
The provider-assigned unique ID for this managed resource.
packageTypes List<String>
The list of package types.
suites List<String>
The list of package distributions.
uris List<String>
The list of repository URIs.

Look up Existing Repository Resource

Get an existing Repository 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?: RepositoryState, opts?: CustomResourceOptions): Repository
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        comment: Optional[str] = None,
        components: Optional[Sequence[str]] = None,
        enabled: Optional[bool] = None,
        file_path: Optional[str] = None,
        file_type: Optional[str] = None,
        index: Optional[int] = None,
        node: Optional[str] = None,
        package_types: Optional[Sequence[str]] = None,
        suites: Optional[Sequence[str]] = None,
        uris: Optional[Sequence[str]] = None) -> Repository
func GetRepository(ctx *Context, name string, id IDInput, state *RepositoryState, opts ...ResourceOption) (*Repository, error)
public static Repository Get(string name, Input<string> id, RepositoryState? state, CustomResourceOptions? opts = null)
public static Repository get(String name, Output<String> id, RepositoryState state, CustomResourceOptions options)
resources:  _:    type: proxmoxve:Apt:Repository    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:
Comment string
The associated comment.
Components List<string>
The list of components.
Enabled bool
Indicates the activation status.
FilePath string
The absolute path of the source list file that contains this repository.
FileType string
The format of the defining source list file.
Index int
The index within the defining source list file.
Node string
The name of the target Proxmox VE node.
PackageTypes List<string>
The list of package types.
Suites List<string>
The list of package distributions.
Uris List<string>
The list of repository URIs.
Comment string
The associated comment.
Components []string
The list of components.
Enabled bool
Indicates the activation status.
FilePath string
The absolute path of the source list file that contains this repository.
FileType string
The format of the defining source list file.
Index int
The index within the defining source list file.
Node string
The name of the target Proxmox VE node.
PackageTypes []string
The list of package types.
Suites []string
The list of package distributions.
Uris []string
The list of repository URIs.
comment String
The associated comment.
components List<String>
The list of components.
enabled Boolean
Indicates the activation status.
filePath String
The absolute path of the source list file that contains this repository.
fileType String
The format of the defining source list file.
index Integer
The index within the defining source list file.
node String
The name of the target Proxmox VE node.
packageTypes List<String>
The list of package types.
suites List<String>
The list of package distributions.
uris List<String>
The list of repository URIs.
comment string
The associated comment.
components string[]
The list of components.
enabled boolean
Indicates the activation status.
filePath string
The absolute path of the source list file that contains this repository.
fileType string
The format of the defining source list file.
index number
The index within the defining source list file.
node string
The name of the target Proxmox VE node.
packageTypes string[]
The list of package types.
suites string[]
The list of package distributions.
uris string[]
The list of repository URIs.
comment str
The associated comment.
components Sequence[str]
The list of components.
enabled bool
Indicates the activation status.
file_path str
The absolute path of the source list file that contains this repository.
file_type str
The format of the defining source list file.
index int
The index within the defining source list file.
node str
The name of the target Proxmox VE node.
package_types Sequence[str]
The list of package types.
suites Sequence[str]
The list of package distributions.
uris Sequence[str]
The list of repository URIs.
comment String
The associated comment.
components List<String>
The list of components.
enabled Boolean
Indicates the activation status.
filePath String
The absolute path of the source list file that contains this repository.
fileType String
The format of the defining source list file.
index Number
The index within the defining source list file.
node String
The name of the target Proxmox VE node.
packageTypes List<String>
The list of package types.
suites List<String>
The list of package distributions.
uris List<String>
The list of repository URIs.

Import

#!/usr/bin/env sh

An APT repository can be imported using a comma-separated list consisting of the name of the Proxmox VE node,

the absolute source list file path, and the index in the exact same order, e.g.:

$ pulumi import proxmoxve:Apt/repository:Repository example pve,/etc/apt/sources.list,0
Copy

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.