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

Plugin SDK written in a language other than Go #1357

Closed
wata727 opened this issue Apr 16, 2022 · 1 comment
Closed

Plugin SDK written in a language other than Go #1357

wata727 opened this issue Apr 16, 2022 · 1 comment
Labels
enhancement needs-design Detailed design is required for implementation

Comments

@wata727
Copy link
Member

wata727 commented Apr 16, 2022

In order to write a plugin, there is a limitation that you have to use Go because tflint-plugin-sdk is written in Go. This isn't a big limitation if you want to provide uniform rules for all workspaces in your organization, but if you want to add simple rules to a particular workspace, you need to build a binary and publish it to the GitHub release. It's a laborious task.

Since v0.35.0, gRPC is used for the plugin system, so you can write plugins in any language that supports gRPC. For example, if you could write a plugin in Python, you would include custom rules in the repository, and editing the rule would be as quick as editing the *.py file.

However, there are some considerations to support this. The first is that the language needs to support HCL and cty. Python has an HCL2 parser, so it's relatively easy in this regard, but libraries like python-cty will need to be invented. Next is the security issue. Being able to execute arbitrary scripts can increase the attack surface, and its impact should be evaluated. The last is the performance issue. Python should be slower than Go, so inspection time can be slower. This can affect for #1356.

@wata727 wata727 added needs-design Detailed design is required for implementation enhancement labels Dec 28, 2022
@wata727
Copy link
Member Author

wata727 commented Feb 1, 2023

We have no plans to work on this now, so closing it.
Alternatively, you can take advantage of custom policies by Rego introduced in #1358.

@wata727 wata727 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs-design Detailed design is required for implementation
Development

No branches or pull requests

1 participant