TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Create Terraform files using Python scripts

60 pointsby sharjeelsayedover 4 years ago

14 comments

fishnchipsover 4 years ago
Not sure about that. It’s a clever trick alright but it adds a possibly unnecessary layer of leaky abstraction and makes code reuse more difficult when working with “vanilla” Terraform. If you really want to use a full programming language with infra as code, I’d suggest looking into Pulumi. Or, if you want to (or need to) stick to Terraform, try the official CDK.
beastman82over 4 years ago
This exists because terraform DSL, yaml, and Json are not programming languages and are thus tragic choices for making declarative statements
评论 #25612640 未加载
评论 #25612605 未加载
评论 #25614530 未加载
评论 #25613016 未加载
dkdk8283over 4 years ago
What I don’t get about “modern” development is lack of complexity management.<p>It feels like 8 degrees of work to write HCL that any component developer can do.<p>What maddened me was the lack of support for the count parameter for modules. Made me rage. But not enough to switch to tools like this or troposphere.<p>Not to mention the supply chain implications and security risk that comes with it.
评论 #25611567 未加载
评论 #25612352 未加载
pramover 4 years ago
Terraform added a lot of these procedural functions natively in the time since this was created.<p>At any rate if you want to stick with Python, I&#x27;d say Pulumi would be a safer choice these days.
评论 #25612109 未加载
mirekrusinover 4 years ago
I find cue lang [1] very practical&#x2F;useful&#x2F;terse, their idea of lattice based type system is very intuitive and expressive with very little code.<p>[1] <a href="https:&#x2F;&#x2F;cuelang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cuelang.org&#x2F;</a>
评论 #25612878 未加载
评论 #25612238 未加载
TabTwoover 4 years ago
Now we need some Perl scripts to generate the Python scripts.
评论 #25611611 未加载
评论 #25611592 未加载
0xbadcafebeeover 4 years ago
Does anyone know if there&#x27;s OSS projects we could use to replace Terraform with Python + boto3? I specifically do not want to use Pulumi. The dependency validation wouldn&#x27;t be too hard to implement, but all the inter-resource and feature-specific logic would need to be duplicated.<p>The reason I won&#x27;t use Pulumi is 1) licensing and 2) corporate ownership. I&#x27;d rather use CloudFormation.
programmerslaveover 4 years ago
CDK from AWS usurps cloud formation
评论 #25611924 未加载
ramaroover 4 years ago
Kapitan allows you to achieve the same using (python) Kadet to compile JSON tf files <a href="https:&#x2F;&#x2F;kapitan.dev&#x2F;compile&#x2F;#kadet" rel="nofollow">https:&#x2F;&#x2F;kapitan.dev&#x2F;compile&#x2F;#kadet</a>
vr46over 4 years ago
Code to generate DSL to call APIs? This is somewhat outdated now, although I wouldn’t have even used it five years ago TBH. Abstraction pile-up.
评论 #25615176 未加载
评论 #25617541 未加载
birdyroosterover 4 years ago
Did someone just put me in a time machine to 10 years ago?
milkshakesover 4 years ago
we&#x27;ve been doing this a while with streamalert. nice to see it generalized though.
ohuhuover 4 years ago
Planning any support for Azure?
kesorover 4 years ago
Why not just use Python to create the &quot;things&quot; in whenever you need to create them in the first place?<p>Just write the code taking idempotency in mind, and no reason to use Terraform at all.
评论 #25612577 未加载
评论 #25614410 未加载