Pulumi Proxmox VE Provider

repository·main·Indexed 42 days ago

https://github.com/muhlba91/pulumi-proxmoxve

A Pulumi provider for managing Proxmox Virtual Environment (VE) resources, derived from the BPG Terraform Proxmox provider. It enables provisioning of virtual machines, containers, and storage using TypeScript, JavaScript, Python, Go, .NET, and Java. Version 8 introduces breaking changes, including the transition to VmLegacy and the renaming of 'id' to 'resourceId' to align with the modern Terraform provider framework.

Tokens
54.4K
Snippets
152
Records
275
Agent score
50%

What's inside Pulumi Proxmox VE

  1. Overview of Pulumi Proxmox VE Provider

    main
    The Pulumi Proxmox VE Provider is a package designed for creating and managing Proxmox Virtual Environment (VE) cloud resources using Pulumi's Infrastructure as Code (IaC) capabilities. It allows developers to define and provision Proxmox resources (such as VMs, containers, and storage) using familiar programming languages like TypeScript, Python, Go, C#, and Java.
  2. Overview of the Pulumi Proxmox VE Provider

    main

    The Pulumi Proxmox VE Provider allows you to manage Proxmox Virtual Environment resources using Pulumi's Infrastructure as Code (IaC) capabilities. This provider is a derived work of the Terraform Provider and is distributed under the MPL 2.0 license.

    If you encounter bugs or missing features, you should first check the pulumi-proxmoxve repository. If the issue is not addressed there, you may need to consult the original terraform-provider-proxmox repository.

  3. Understand the origin of the Pulumi Proxmox VE Provider

    main

    The Pulumi Proxmox VE provider is a derived work of the Terraform Provider and is distributed under the MPL 2.0 license.

    If you encounter bugs or missing features, follow this escalation path:

    1. Check the pulumi-proxmoxve repo for issues specific to the Pulumi implementation.
    2. If no relevant issue is found, consult the source terraform-provider-proxmox repo to see if the issue exists in the upstream Terraform provider.
  4. Install the Pulumi Proxmox VE Provider

    main

    Install the provider using the package manager corresponding to your programming language:

    Node.js (JavaScript/TypeScript)

    npm install @muhlba91/pulumi-proxmoxve
    # or
    yarn add @muhlba91/pulumi-proxmoxve

    Python

    pip install pulumi-proxmoxve

    Go

    go get github.com/muhlba91/pulumi-proxmoxve/sdk/v6/go/proxmoxve

    .NET

    dotnet add package Pulumi.ProxmoxVE
    npm install @muhlba91/pulumi-proxmoxve
  5. Extend an existing Maven Central signing key

    main

    If your signing key is nearing expiration, you can extend the validity of the primary key and all its subkeys. Because expiration changes must be redistributed, you must re-publish the key to the keyserver after extending it.

    Workflow:

    1. Set up a temporary GNUPGHOME.
    2. Re-import the existing secret key using your SIGNING_KEY file and SIGNING_PASSWORD.
    3. Use --quick-set-expire to extend the validity (e.g., by 10 years).
    4. Re-publish the key to the keyserver.
    5. Re-export the secret key to update the self-signature with the new expiry.
    export GNUPGHOME=$(mktemp -d)
    
    # 1. Re-import the secret key
    gpg --batch --pinentry-mode loopback --passphrase "$SIGNING_PASSWORD" \
      --import signing_key.asc
    
    FPR=$(gpg -k --with-colons | awk -F: '/^fpr:/{print $10; exit}')
    
    # 2. Extend primary key + all subkeys by 10 years
    gpg --quick-set-expire "$FPR" 10y "*"
    
    # 3. Re-publish (expiration changes must be redistributed)
    gpg --keyserver keyserver.ubuntu.com --send-keys "$FPR"
    
    # 4. Re-export the updated secret key
    gpg --armor --export-secret-keys "$FPR" > signing_key.asc
  6. Validate an exported signing key

    main

    Before using a generated or extended key for a release, perform these four validation steps in a fresh, temporary GNUPGHOME to ensure the export is complete and functional:

    1. Structural Integrity: Verify the exported file contains both the :secret key packet: (primary) and the :secret sub key packet: (encryption subkey).
    2. Expiration Check: Import the key and verify it shows [expires: <future date>] rather than [expired: ...].
    3. Signing Capability: Test that the key can successfully create a detached signature and that the signature verifies.
    4. Public Availability: Confirm the public key is retrievable from the keyserver (keyserver.ubuntu.com) using the fingerprint.
    export GNUPGHOME=$(mktemp -d)
    printf '%s\n' "$SIGNING_KEY" > "$GNUPGHOME/key.asc"
    
    # 1) Check structural completeness
    gpg --dearmor < "$GNUPGHOME/key.asc" > "$GNUPGHOME/key.gpg"
    gpg --list-packets "$GNUPGHOME/key.gpg" | grep -E "packet:|expires"
    
    # 2) Check expiration
    gpg --batch --import "$GNUPGHOME/key.asc"
    gpg --list-secret-keys --keyid-format=long --with-fingerprint
    
    # 3) Test signing and verification
    echo "validation" > "$GNUPGHOME/test.txt"
    gpg --batch --pinentry-mode loopback --passphrase "$SIGNING_PASSWORD" \
      --local-user "$SIGNING_KEY_ID" --detach-sign "$GNUPGHOME/test.txt"
    gpg --verify "$GNUPGHOME/test.txt.sig" "$GNUPGHOME/test.txt"
    
    # 4) Check public key retrieval
    gpg --keyserver keyserver.ubuntu.com --recv-keys "$SIGNING_KEY_ID"
    
    rm -rf "$GNUPGHOME"
  7. Migrate from v7 to v8 (Breaking Changes)

    main

    Version 8 introduces breaking changes to align with the upstream Terraform provider's modern framework.

    Standardized Resource Names

    • Legacy Namespacing: Resources that previously started with proxmox_virtual_environment_ have moved to a Legacy naming format. For example, proxmoxve:VM/virtualMachine:VirtualMachine is now proxmoxve:index/vmLegacy:VmLegacy.
    • Standardized Resource IDs: For resources that have an id input exposed by the Terraform provider, this has been renamed to resourceId.

    State Migration

    To migrate an existing stack, export the state, update the resource tokens using a tool like sed, and re-import the state:

    pulumi stack export > stack.json
    # Example: updating the VirtualMachine resource token
    sed -i 's/proxmoxve:VM\/virtualMachine:VirtualMachine/proxmoxve:index\/vmLegacy:VmLegacy/g' stack.json
    pulumi stack import < stack.json

    ID Migration

    Update your code to use resourceId instead of id for applicable resources.

    pulumi stack export > stack.json
    sed -i 's/proxmoxve:VM\/virtualMachine:VirtualMachine/proxmoxve:index\/vmLegacy:VmLegacy/g' stack.json
    pulumi stack import < stack.json