Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to use env variable in connection resource: Function calls not allowed #4433

Open
0xADD1E opened this issue Oct 24, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@0xADD1E
Copy link

0xADD1E commented Oct 24, 2024

Further to turbot/pipe-fittings#149 (and the fix turbot/pipe-fittings#150)

It would be beneficial in some cases to be able to setup steampipe connection resources as follows

connection "googledirectory" {
  plugin = "googledirectory"
  token_path = env("CLOUDSDK_ADC_MYDOMAIN")
}

but when attempting to run, this yields

steampipe query
Error: Internal Error: Failed to load config: Function calls not allowed: Functions may not be called here.
(/Users/kaja/Documents/Code/Steampipe/config/googledirectory.spc:3,16-56)

Version info: Steampipe v1.0.0 on arm64 macOS 15.1 (24B82)

@pskrbasu
Copy link
Contributor

Hey @0xADD1E it seems like Steampipe connections do not support functions currently.

The issue and the fix you have tagged are related to Flowpipe and not Steampipe. Flowpipe credentials currently support functions.

Hence I'm transferring this issue to the steampipe repo and marking it as a new Feature Request. This will be a good addition and we will work on it. Thanks for bringing this to our attention. 😊

@pskrbasu pskrbasu transferred this issue from turbot/pipe-fittings Oct 24, 2024
@pskrbasu pskrbasu added the enhancement New feature or request label Oct 24, 2024
@0xADD1E
Copy link
Author

0xADD1E commented Oct 24, 2024

Hey @pskrbasu - apologies for the confusion,
While the issue here is specific to Steampipe, I thought the config parser Steampipe used for connections was the same pipe-fittings/parse module that was used by Flowpipe (just connection.go instead of credential.go).
Am I misunderstanding the module structure here, or is this saying there's a better way of doing this for Steampipe?

@kaidaguerre
Copy link
Contributor

Hey @0xADD1E

You are correct that Steampipe connection parsing happens in pipe-fittings. However the connection structure of Steampipe connections and Flowpipe/Powerpipe connections (PipelingConnections) is different - thus there is a different set of parsing code. This this problem is Steampipe specific.

At present the Steampipe connection parsing code does not support functions. This is more a for historical reasons rather than any technical reason and I certainly think it's reasonable to add this support. I don't foresee issues buit let me take a look into it

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale No recent activity has been detected on this issue/PR and it will be closed label Dec 24, 2024
@pskrbasu pskrbasu removed the stale No recent activity has been detected on this issue/PR and it will be closed label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants