Comments (5)
Hi @muhlba91 -
Pulumi resource providers are run as plugins on your local system, so any environment variables set on your system are usually available to your provider.
How did you try setting the nested environment variables, and what behavior did you expect? It may well be that this is not currently supported, but I want to make sure I fully understand :)
from pulumi-proxmoxve.
thanks for getting back to me here. Let me give you a short overview of my assumptions and tries so far. :)
First, the terraform provider defines it's configuration schema here: https://github.com/bpg/terraform-provider-proxmox/blob/main/proxmoxtf/provider.go#L71 - as you can see it generates a nested schema with - for example - those environment variables:
PROXMOX_VE_ENDPOINT
PROXMOX_VE_INSECURE
PROXMOX_VE_PASSWORD
PROXMOX_VE_USERNAME
Those I define in my environment variables like:
export PROXMOX_VE_USERNAME="root@pam"
export PROXMOX_VE_PASSWORD="<password>"
export PROXMOX_VE_ENDPOINT="https://<ip_address>:8006/"
export PROXMOX_VE_INSECURE="true"
Based on the schema generated by the terraform bridge, the configuration is picked up correctly.
See https://github.com/muhlba91/pulumi-proxmoxve/blob/main/provider/cmd/pulumi-resource-proxmoxve/schema.json#L1474 for the nesting, and https://github.com/muhlba91/pulumi-proxmoxve/blob/main/provider/cmd/pulumi-resource-proxmoxve/schema.json#L1395 for the nested schema.
If I now execute Pulumi using this provider, I receive error: You must specify the virtual environment details in the provider configuration
(defined here: https://github.com/bpg/terraform-provider-proxmox/blob/main/proxmoxtf/provider.go#L210).
Hence, my conclusion that the environment variables are not passed through to the provider configuration properly. To me it looks like the nested configuration for the provider is initialised (empty) and passed, leading to the terraform provider not calling the initialisation functions (default functions for each variable).
Then I thought I can simply define the configuration in the resources.go
file like:
Config: map[string]*tfbridge.SchemaInfo{
"virtualEnvironment": {
Type: makeType("virtualEnvironment", "VirtualEnvironment"),
Elem: &tfbridge.SchemaInfo{
Fields: map[string]*tfbridge.SchemaInfo{
"endpoint": &tfbridge.SchemaInfo{
Type: makeType("endpoint", "Endpoint"),
Default: &tfbridge.DefaultInfo{
EnvVars: []string{"PROXMOX_VE_ENDPOINT", "PM_VE_ENDPOINT"},
},
},
"insecure": &tfbridge.SchemaInfo{
Type: makeType("insecure", "Insecure"),
Default: &tfbridge.DefaultInfo{
EnvVars: []string{"PROXMOX_VE_INSECURE", "PM_VE_INSECURE"},
},
},
"otp": &tfbridge.SchemaInfo{
Type: makeType("otp", "OTP"),
Default: &tfbridge.DefaultInfo{
EnvVars: []string{"PROXMOX_VE_OTP", "PM_VE_OTP"},
},
},
"password": &tfbridge.SchemaInfo{
Type: makeType("password", "Password"),
Default: &tfbridge.DefaultInfo{
EnvVars: []string{"PROXMOX_VE_PASSWORD", "PM_VE_PASSWORD"},
},
},
"username": &tfbridge.SchemaInfo{
Type: makeType("username", "Username"),
Default: &tfbridge.DefaultInfo{
EnvVars: []string{"PROXMOX_VE_USERNAME", "PM_VE_USERNAME"},
},
},
},
},
},
},
Apart from the fact that I would expect it to work without such addition, I think I did something wrong here since I receive the following error when using the plugin now error: could not load plugin for proxmoxve provider 'urn:pulumi:dev::pve-test::pulumi:providers:proxmoxve::default_0_0_1_alpha_1637516154_bcc93c62_dirty': could not read plugin [/Users/daniel/go/bin/pulumi-resource-proxmoxve] stdout: EOF
.
from pulumi-proxmoxve.
@guineveresaenger bumping this thread for support.
from pulumi-proxmoxve.
Hi again - apologies for the long delay.
To the best of my knowledge, our tooling does not have this capacity at this point, since every provider is ever so slightly different and may expect different settings/nesting.
We recommend the following:
- Continue with the workaround as listed in your README.
- File an issue in the pulumi-terraform bridge so that we can triage and track this issue properly at the source and see if it's feasible.
- As with anything, we of course welcome pull requests and you may find a fair bit of assistance on our community slack from other community members as well.
from pulumi-proxmoxve.
Moved to pulumi/pulumi-terraform-bridge#423.
from pulumi-proxmoxve.
Related Issues (20)
- Startup/Shutdown options require the up_delay and down_delay to be set up HOT 4
- Are there any plans on supporting LXC containers? HOT 2
- VirtualMachineDiskSpeedArgs HOT 1
- Lack of python documentation
- No parity with upstream tf proxmox provider HOT 3
- Disable default values? HOT 1
- Get config of existing vm HOT 7
- Empty/non set container features forces replacement on import
- How to disable replacing CTs on `pulumi up`? HOT 4
- Resizing disk on a clone endless loop HOT 2
- C# SDK CloudInit not take care or configuration on deploy HOT 3
- Add HA group support HOT 4
- Missing pool id after pool import leads to recreating the pool HOT 3
- timeouts does not apply all the time HOT 2
- Invalid Go SDK module HOT 2
- error retrieving next VM ID: received an HTTP 401 response - Reason: no such token 'TOKENID' for user 'dev@pve' HOT 1
- how to specifiy a config file to uploaded to vm then genereate seed.iso to setup vm with cloudinit? HOT 3
- pulumi hangs if passing the 'started: true' option. HOT 4
- How to print the local IP out that qemu-guest-agent displays? HOT 3
- No option to Link clone a container HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pulumi-proxmoxve.