Infrastructure Manager: Provision Google Cloud Resources with Terraform
cloud.google.com
cloud.google.com
This service will largely be used for deployments on Google Cloud, for which Google invests a lot of development effort in maintaining their own provider. It’s not like there’s not already significant contribution from Google to the code base.
https://cloud.google.com/infrastructure-manager/docs/view-re...
You, the customer, pay for everything deployed, and Google just pre-connects it to all their services for monitoring and maintenance. It would be like if Route53 on AWS was free, but it deployed a VM in your account, added gateways and nats, opened ports, etc., so that it all ran on discrete infrastructure for just you and you got charged for everything and had to do all the scaling.
If you’ve used their Apache Airflow product (Cloud Composer), it’s basically the same thing. With Cloud Composer, they are setting up an Airflow node and cluster on your behalf, in your account, that you pay for, and connecting it to their services.
This is no different than going to a consulting company and asking them to setup and maintain a Terraform automation platform in your account., which Hashicorp said was allowed. Google isn’t reselling it as a product. They’re setting it up on their platform on your behalf and giving it to you.
And there’s no reason you couldn’t switch it out to OpenTF.
I’m sure there’s some 100% subjective, hallucinated value statement but never felt a reason to bother.
I’ve only ever used an AWS SDK and “saved state” to git in the form of my SDK scripts.
Switched from Python+boto to Go+SDK a few years ago rather than learn some DSL the Lindy effect clock was ticking on.
- the problem: if something gets deleted, or if you make a bunch of changes and want to undo them, or if you need to make a change to a lot of stuff at once, or if you want to copy what you've built to a new region, how do you do it? or, if you're on a team, how do you as a team make and track changes to your cloud infrastructure?
- terraform as a solution: you describe your cloud infrastructure as yaml files. terraform can figure out what is different between what's in your cloud infrastructure and what your yaml files say it should look like. and, it can make changes to your cloud to e.g. build it from scratch, make wide-ranging changes, make a copy of it, etc.
- since your yaml files are code, you can also create a repo and do PRs to make and track changes to your cloud infrastructure as it evolves over time
Looked at the TF code; my solution implements similar functionality to handle AWS CRUD ops. What I avoid is all the DSL parsing and such.
For me an AWS account is a struct with fields of AWS SDK resource types, which it seems is what TF resources map to (they handle a lot more so there’s more to it, but kind of sort of if I squint just right). Either going to duplicate the internal logic or DSL chunks per project, would rather avoid the context switch between syntax, “learning the TF ecosystem”.
Thanks again, though.
Why just not writing idempotent resource creation? Terraform also uses this to calculate a "plan" that shows the diff of your changes with reality, which really helps to figure out what happens to your RDS when executing, especially when more abstraction (in form of Terraform modules) is involved.
We used Terraform also in a situation where writing custom code would be "prettier" but would have required to write this actual vs desired state code ourselves and could save us the work of doing so.
The DSL of Terraform is sometimes quite cumbersome though as it's derived JSON and not some actual programming language.
A simple example of what I mean by computed values is that let’s say you want to provision a k8s cluster on top of a network. The k8s provider might want the network name/id which you could normally get by setting it upstream. The problem is you can’t plan the network creation and k8s cluster in a single pass because you don’t get the network name until it’s actually provisioned. You actually need to apply the network tf first to get the inputs you need to plan the cluster. Meaning not only do you need to run tf twice, you also can’t E2E plan infra provisioning
If anyone has a solution/pattern for the above (or more generally how to chain these modules together when this limitation exists) I’m all ears
Doing that allows Terraform to create both resources in one plan/apply step, and it also helps Terraform understand the dependency between the resources so that they are created in the correct order.
For me using terraform is quicker than clicking things up or using CLI even when initially developing things, as if something goes wrong I can just destroy the state and re-apply the terraform config.
then you obviously have every single resource name, required values, and relationships between them memorized because in my experience post-facto encoding of something into TF can be valuable to the organization but trying to _discover_ the providers, iam, required fields to achieve a desired outcome is crawling over broken glass as compared to click-ops-ing something in place
Hell, there's even a browser extension to record the AWS calls so one can at least see what was done later for replay, but with GCP they have their own sneaky RPC something-something encoding so that idea's off the table
I don't.
> crawling over broken glass as compared to click-ops-ing something in place
I do not experience reading the terraform provider docs like crawling over broken glass but okay.
I program with Python also and it's not like I have memorized every class and function either, but still, I and millions of other people somehow manage get by.
Every tool I've seen that wraps Terraform in any way is just a solution looking for a problem.
Subjectively, the AWS provider will at least validate that fields have valid values during the plan step. The Google provider doesn't seem to validate actual values until apply, and then you get a failure
It (well, the provider) doesn’t validate fields until apply. That’s just so… sad. How is that acceptable? It’s like a car without a steering wheel, and people just go along with it.
It gets hairier when you delve into the details. The provider is typically an official provider that wraps some company's API, so that company ought to have a good set of validations, since it's their own API, right? Wrong. The team that writes the Terraform provider is typically different from the team that creates API methods, and the API methods themselves don't typically expose "dry-run" style functionality, so there's little for the team writing the Terraform provider to check. Meanwhile, the business doesn't care - the Terraform provider checkbox is already checked and validations/dry-running isn't a feature that affects revenue.
I know AWS doesn’t have managed TF support - and as a former AWS ProServe employee i know that they thought about it but didn’t do it because they didn’t want to step on Hashicorp’s business.
AWS does have its own hosted IAC service that was introduced before TF was a thing with CloudFormation.
I wouldn't be shocked to hear that licence fuckeries were the reasom why we don't have managed TF support of AWS.
https://docs.oracle.com/en-us/iaas/Content/ResourceManager/C...
But I agree, explicit support for OpenTF here would have been really nice to see, even if it delayed launch a little.
AWS shot themselves in the foot by making the Python version of CDK second-tier after Typescript; IaC is still done by DevOps people far more often than application people, and DevOps people use Python.
Another gripe is the number of services and new features which launch without CFn support, which also blocks CDK support; when Terraform supports a new platform feature before the vendors own tools do, that's a sign the product teams are being driven by the wrong metrics.
And as far as TF supports services before CFT. Guess which is easier for an AWS employee to do - getting the CF service team to support a new service or just contribute to Terraform’s open source project?
I know of at least one service where the service team introduced the needed APIs and then an employee of AWS wrote the TF provider and contributed to the project before AWS’s own internal team added it to CFT.
Source: former AWS ProServe employee. I am not referring to myself as the author.
What? It's not second-tier at all, every single feature in Python is in sync with TypeScript, the library versions are in sync, and the docs for all the languages are auto-generated. They're not second-tier, they're 100% single tier.
Also, the tooling you need to drive CDK is all TS-based, which means I now need to think about NPM and Node versions occasionally, which are not relevant in any other part of my workflow.
Admittedly as someone in scientific computing I am unusually far from the JS/TS ecosystem - but all I can tell you is that it feels second tier as a user.
(But there's CDKTF, FYI.)
It's not much different from high-level code compiling down to machine code. The benefit of writing high level code isn't that machine code is entirely gone. The benefit is instead that as a user you can mostly forget that machine code exists.
You can version the Terraform configuration, either in a public Git repository or in a Cloud Storage bucket. Use Object Versioning to version configurations in a storage bucket.
https://cloud.google.com/infrastructure-manager/docs/overvie...
As others have mentioned, this is not all that useful of a service - it doesn't seem to even have the concept of a "plan" let alone any approval system and seems to only allow for the most basic of workflows. Given that TF by default will store state in a bucket with true locking, I can't come up with any potential benefit this provides vs using Terraform directly.
The main question is whether this will be improved in the future or is intentionally just "Terraform Trial Edition" with terms of partnership preventing anything encroaching on Terraform Cloud. Perhaps for the former, the trial is important to understand usage to better inform revenue sharing for a future improved product.