The last fika โฐ๏ธ
Provision resources with code
What bucket are you in? ๐ชฃ- "I have full complete access to creating Pub/Sub resources on GCP and know fully what I'm doing" ๐ธ
- "I have now gained access but am unsure if I'm following the right steps while creating resources" ๐
- "I just slack/walk up to a 'senior' dev with access (preferably one that knows what they're doing too) and request them to create the resources for me" ๐ฃ
So in best case๐:Developers need to log into the console and provision the resources on staging + production
And in not-so-best case๐:Developers need to reach out to others with access and explain to them what needs to be created - somtimes even wait a bit with their requests

What's wrong with all this?- Features can take longer to build, especially running around for accesses- May/may not cause frustration among devs
- Could potentially lead to wrong configuration due to mis-comminucation / lack of "reviews"How do we fix this?๐ ๏ธdev with
accessdev with
request
raises a requestHey mate, could you please create xxx.xxx on staging + prod?

Sure, Let me have a lookLooks good, let's create itThank you, senpai ๐ฅทAutomate as much as we can ๐ฆพdev with
access
raises a requestSure, Let me have a look

a GA workflow with a service account with correct accesses???Are we missing something?๐จ"Umm, Shubham...All's great but...what do I write in the PR?"
Don't worry, I gotchu ๐ค
you just need a shot of
Going forward, we'll just create a terraform template for the resources we want in
anyfin-pubsubWhat !#@ fuck is terraform?Wiki: "Terraform is an infrastructure-as-code software tool created by HashiCorp. Users define and provide data center infrastructure using a declarative configuration language known as HCL"
Let's break this down...
Terraform is an IaC toolBasically, instead of performing actions on the GCP console, you write a bit of code and this tool handles the creation, updating and if needed, deletion of resources for you
It always stores the state of the latest resources in a state file (we put ours in cloud storage buckets) and everytime there's a change in the terraform code (which will happen through your PRs), it will compare against the state file, make required changes and update the state file
Users define infra using HCLHCL = HashiCorp Configuration Language
Basically a declarative config file (like JSON, YAML) but with a different syntax
Wanna see? ๐
DEMOIs this better than earlier? ๐- Tiny step towards creating a flatter engg org - the devs closest to the requirement have the power to fulfill it
- Develops a new skill amoung us - terraform is great to know these days
- Less prone to issues like misconfiguration
- Allows for an easy way to revert back to an older stable version
- Hopefully, provides a better DX at the end of it all
What's next? ๐ฎ- Let's use it, get annoyed by it, and think of ways to improve it together
- Creating scripts (like yarn knex migrate) to generate preconfigured template files so devs have to spend less time copy-pasting config
Who should I go to to get help?๐ค- Struggle (in a time-boxed manner) a little; you might crack it yourself ๐
- But if you feel out of your depth, do reach out๐ค


Questions? ๐Yours truly,
Shubham ๐ฅฐ
The last fika
By Shubham Zanwar
The last fika
- 55