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

[1] Feature/terraform snippets #379

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CsBigDataHub
Copy link
Contributor

@AndreaCrotti

This is the first breakdown of multiple commits I have made when the previous pull request was active.

This PR contains bunch of terraform snippets

@@ -0,0 +1 @@
_-mode
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this parent mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice @CsBigDataHub , just one last question, how do we maintain such a massive amount of snippets?
I mean if you generated them do you need to rerun the generation process periodically to update in case there are new properties for some of the snippets?
Or they are supposed to never change anyway?

I am using Terraform with Azure for more than year now. I can tell you with confidence that these snippets would not change except for one or two variable that gets added or removed depending on Azure evolution. It would be same for other platforms.

I would defiantly maintain Azure part of terraform because I use it for work. I would expect if people working on other platforms who are using yasnippets would create pull request.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this parent mode?

Every thing here is terraform-mode. I guess I missed to delete this file. Does it effect anything?

@AndreaCrotti
Copy link
Owner

Nice @CsBigDataHub , just one last question, how do we maintain such a massive amount of snippets?
I mean if you generated them do you need to rerun the generation process periodically to update in case there are new properties for some of the snippets?
Or they are supposed to never change anyway?

@staticaland
Copy link

This would be pretty awesome. Did you use a script to generate the snippets? It would be very interesting to see how you managed to create all these snippets.

@CsBigDataHub
Copy link
Contributor Author

@staticaland
Copy link

staticaland commented Sep 13, 2020

Thanks. It may be possible to generate snippets with the data from terraform providers schema -json (https://www.terraform.io/docs/commands/providers/schema.html).

I'll give it a shot at https://github.com/staticaland/terraform-generate-snippets/blob/master/tgs.py

@staticaland
Copy link

I just added AWS, Azure and Google snippets to https://github.com/staticaland/yasnippet-terraform by generating them with https://github.com/staticaland/terraform-generate-snippets

Hopefully it will solve the problem of keeping the snippets updated automatically.

I will work on organizing them a little better and might add support for other snippet systems as well.

@CsBigDataHub
Copy link
Contributor Author

@staticaland thanks. Good work on the python scripts.

@AndreaCrotti does it make sense to create a travis ci pipeline to run @staticaland's script periodically to reflect any changes from terraform snippets?

@staticaland
Copy link

@CsBigDataHub I just ran through almost all the providers, and ended up with a 7GB providers folder and around 6000 snippets. It may be better to keep all this building stuff outside this repo I think. CI pipeline would take very long without some form of caching, and it may use a lot of processing time. I wish Hashicorp had this data available through an API. It would make it much easier. Terraform provider argument reference API.

Hmm, that got me thinking, maybe I should save the JSON for every provider and just commit everything to git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants