https://pulumi.com logo
#general
Title
# general
s

some-notebook-86727

01/27/2024, 3:39 PM
Can anyone help me to understand how I can use token authentication for proxmox using
pulumi_proxmoxve
python library? I see in the short documentation in pypi that there are some variables that you can set:
Copy code
const provider = new proxmox.Provider('proxmoxve', {
  endpoint: process.env.PROXMOX_VE_ENDPOINT,
  insecure: process.env.PROXMOX_VE_INSECURE,
  username: process.env.PROXMOX_VE_USERNAME,
  password: process.env.PROXMOX_VE_PASSWORD
});
But there's no mention if api tokens. How can I find out if this is supported? I see here that there some variables set in the code, one of which is related to the token: https://github.com/bpg/terraform-provider-proxmox/blob/main/fwprovider/provider.go#L55-L62 Maybe I could just add something like that?
Copy code
provider = proxmox.Provider('proxmoxve',
                            apitoken=os.getenv("PROXMOX_TOKEN"), <-- this
                            endpoint=os.getenv("PROXMOX_ENDPOINT"),
                            insecure=os.getenv("PROXMOX_INSECURE"),
                            username=os.getenv("PROXMOX_USERNAME"),
                            password=os.getenv("PROXMOX_PASSWORD"),
                            )
This doesn't seem to work, I get:
Copy code
TypeError: Provider._internal_init() got an unexpected keyword argument 'apitoken'
I think I've got it. It was "api_token", with an underscore.