Using generic CI/CD tools for your IaC automation? đ¤âď¸
Affinityâs relationship intelligence platform is designed to structure and analyze millions of data points across emails, calendars, and third-party sources. It uses AI to assess relationship strength and highlight the best route to warm introductions, automating the management of key relationships and revealing overlooked opportunities for dealmakers.
Senior software engineer Chris Nantau is part of the infrastructure team at Affinity. He spoke to us about the ways Spacelift has enhanced their Terraform experience.Â
The team at Affinity was intent on adopting a more modern approach to infrastructure, prioritizing small workspace workflows in Terraform and maximizing segregation. However, they were struggling to overcome some key pain points:
The Affinity team relied on small applies for their workflows, but their existing Terraform setup was generally poor at picking up runs or detecting what was causing the blockage if something was blocked.
The user experience (UX) was also inadequate, making it difficult to see why something wasnât working when the team was merging multiple runs. From an integrations perspective, it didnât give developers an easy way to get visibility on groupings or whatever they wanted to see. âHandling permissions was a real slog,â adds Chris.
Chris discovered Spacelift through a friend of his, who had read about the platform on the Console.dev newsletter. Having done his research, Chris concluded that Spacelift would resolve the bulk of their problems with Terraform. âSo I pitched it to the team, and then we started the proof-of-concept (POC) process. And the rest is history,â he recalls. The company has since moved 239 stacks to Spacelift. âWe did assess other options after the POC process, but Spacelift seemed to have all of the features we needed â like user management, policy, and the right UX.â Â
Open Policy Agent (OPA) is a key consideration for Affinity â and for Spacelift. An open-source engine that allows you to declaratively write policies as code and incorporate those policies in a decision-making process, OPA has many benefits that Spacelift users can enjoy without having to implement everything from scratch.
Previously, the Affinity team used Terraform both as their runner and for state management. Now, they use Amazon S3 for state management, but because this is connected to the Spacelift provider, state management is something they donât have to worry about. They use Terraform primarily as their runner, as a single point to coordinate on role-assumption. Before the migration to Spacelift, infrastructure devs would have to make manual changes in test environments because their Terraform providerâs performance and responsiveness would break up the development workflow and slow down iteration.
Moving to Spacelift has transformed the Terraform experience for Affinity developers. âWe have a very split team when it comes to liking or hating Terraform,â explains Chris. âHalf of us really like it, and half of us really hate it â but a lot of that hate comes from working with our previous Terraform platform.â Its approach to managing infrastructure did not align with the way Affinity developers think about infrastructure, and they experienced multiple issues using it. That has changed since the company migrated to Spacelift. âEven our Terraform haters are more willing to work in it without audibly groaning,â laughs Chris.Â
Integrating Affinityâs existing systems with Spacelift has been a smooth process. Because of the companyâs complex infrastructure setup, they had made little use of potential Terraform platform integrations, apart from integrating it with their version control system (VCS) provider. However, now they plan to do more with Terraform, using Spacelift APIs for some of the operations involved in work like refactoring. This was not a realistic prospect with their previous platform because of shortcomings in the API and support.Â
Now that Affinity developers donât have to spend so much time on manual tasks, they are working far more productively â even from a policy perspective. âWhen we know something is going to a certain environment and the risk is really low, we just apply the change automatically now, as soon as it hits our main branch. Previously, even for a very simple change, we would have to individually approve it for each of our five environments.â Anything that requires even minimal diligence is likely to fail due to human error, with people simply forgetting to roll out a change in a specific environment, for example. âWeâve saved a heap of time and annoyance just by using Spacelift policies,â Chris reveals.
Affinity is using Spaceliftâs Terraform provider for all its dependency trees, so the team can spin up and tear down ephemeral environments much more easily on a cadence, allowing them to guarantee certain invariants with the organization. âGenerally, itâs facilitated a lot of automation we would have had to build ourselves and grow manually.â
Another Spacelift feature that makes Chris and his team really happy is performing bulk actions on Stacks. âItâs like the best thing that has ever been invented in the history of anything related to Terraform!â This feature means you donât have to click through multiple screens to perform a small number of actions. âBeing able to just go âsafe, safe, safe, safeâ and then bulk apply has been a godsend because Iâm usually the one to go in and clean it up,â he says.
Affinity is committing solidly to Spacelift. Plans include using it for the Red Hat Ansible automation platform and also for DataDog. âWeâve set up the Datadog integration but havenât started using it yet. Itâs our observability platform, so that was a nice recent feature,â Chris points out.
The team is also looking forward to integrating drift detection. âWeâre pretty excited about leveraging it,â says Chris. âDrift is one of the reasons we ended up buying private workers; otherwise we would have just used public ones.â
And if something doesnât go exactly as planned, the team never worries. Getting accessible, friendly support precisely when they need it has been key to Affinityâs successful migration. Thatâs where Chris singles out Spacelift for special praise: âYour support guys are the best Iâve ever interacted with in a software vendor. Please keep doing what youâre doing there!âÂ