A Public Registry for AWS CloudFormation
aws.amazon.com
aws.amazon.com
I'm in an enterprise and they do everything with CloudFormation, but it doesn't really make sense to me. None of the code is reusable, it's yaml or json, which isn't easy to write to begin with.
I remember in the early days there were 2 frameworks that would compile to CF. I googled recently and found Lono, and it looks nice, but there's a fraction of the modules available that are available for terraform and getting help is also limited by the number of users. And then there is the big question for me why are building things that make CF look like Terraform[0].
I'm not a fanboy of Terraform either, there's plenty of stuff that I didn't like about it. But even AWS themselves almost seem to have more reusable templates in Terraform than they do CF.
I (re)use a lot of templates as "products", e.g. I have an RDS PostgreSQL template that I've been maintaining and using for years.
CloudFormation modules are great for encapsulation and reuse if you actually have anything you want to reuse at sub-template granularity. I rarely do. For example, we have a bunch of API services that all work the same way. In that case, the granularity of reuse is the template. I don't have a bunch of different services/products that all need to reuse a given resource in the same way.
For the same reason, I'm not very excited by CDK and other CloudFormation-producing tools.
I started mucking around with Terraform, but immediately discovered I needed to create a provider (custom resource). That's an incredibly manual process to begin with, but almost all of it is translating between Terraform representation (structures based on HCL2) and the JSON representation of whatever API you're using. So much translation when 99.999% of the APIs you'll use will be JSON. Aaaaaarrrrghhhh.
Sorry.
That doesn't make any sense to me, if you're coming from CloudFormation. What for?
Which still gives all the power of HCL to generate the CF stacks. No need to create a new provider.
In a way, it's similar to how you'd treat C with inline assembly.
With Terraform you are mostly on your own, and you can easily end up in broken state, which needs to be manually fixed.
Until it doesn't and then you are in a completely unfixable state, must file support tickets and get AWS support to debug it and figure out how to unbork it.
Meanwhile terraform gives you tools to investigate and fix it.
There have been many times where someone provides me a small snippet of an error message from Terraform, and the error is so vague as to be useless. I then have to ask the customer for more detailed logging to even figure out what APIs Terraform is even calling. After that I can maybe cobble things together with CloudTrail to figure out the issue.
But that's only because I have personal experience with Terraform. If you get a support agent who isn't familiar with DevOps generally and only knows CloudFormation? You're not going to get the same level of support. Meanwhile, we have a full team and competent internal tooling to troubleshoot CloudFormation. Using Terraform instead of CloudFormation limits the speed and competency of the support you can get from AWS.
Speaking as someone who plays with both at work and personally, here's what I think:
If you're in an AWS monolith with a large team that uses AWS Support as your primary support channel (i.e. you don't have in-house AWS experts), go with CloudFormation. Terraform doesn't do anything on AWS that CloudFormation can't, and AWS can better support you.
If you're in a multi-cloud scenario, it's better to use Terraform (if only because you don't have to learn two different syntaxes).
If you're a one-person shop or don't rely on AWS Support for support? Do whatever you want.
(And while I do work at AWS, please know I could care less whether you use CloudFormation. I'd rather you use the tool best for the job, even if it isn't an AWS product. While some people may conspiratorially say that AWS tries to lock you into AWS services to the exclusion of anything else, most people at AWS just want you to use the right tool for the right job. I have no problem telling someone not to use AWS if it doesn't work for their usecase -- nor do most of my co-workers)
It is in Amazon's interest to drive lock-in and it certainly seems their biggest goal.
If you don't like Terraform, perhaps you would consider Pulumi? It's similar, but doesn't pretend that yaml is sufficient. Infrastructure as Actual Code.
Keen to hear of similar tools myself.
How does Terraform achieve that better than CF besides that it has the ability to provision other providers? If you want to switch from say AWS to Azure, you are still required to reconfigure each and every resource as they are named differently, behave probably differently and have different parameters. In that time you probably have learned the equivalent of CF in Azure (if there is some).
It‘s not unachievable, but saying it‘s „easy“ is far away from the truth.
Is that actually a question you are seriously asking?
The providers for AWS/Azure/Openstack/VSphere look very similar, to the extent that terragrunt templates can smooth over the differences.
Calling renaming provider resources 'reconfiguring' is a stretch. If that's the worst thing you ever have to do, then I would suggest you're not doing much that is complicated in this space at all.
templates, not scripts, Declarative. And CFN is much more lean and reliable than TF, I recommend it for new to AWS people.
It's warts, all the way down.
I'm willing to trust Datadog for configuring their own services, but the community providers scare me from a security perspective. What I can see from the early uploads are community providers accessing secrets manager to fetch API keys. What happens when a provider requests permissions for all secrets? How well will the UI surface broad permission grants? What if providers bake in "telemetry" to spy on me ?
One controversial opinion: I feel AWS should reduce surface area and deprecate the CLI in favor of CDK (requiring CDK support for launching a new service and/or feature). To emulate the deprecated AWS CLI, developers can write/edit "CDK scripts" that are uploaded via an AWS CLI-lite.
Disclaimer: I work at Amazon, but not on AWS and have no insight or influence over anything AWS does. Please read this as "just another developer who uses AWS".
Operations is an exercise in complexity management, not feeling smart.
I mostly mean to say AWS doesn’t need a full featured CLI. Devs should just use CF/CDK through a CLI-lite.
That also force AWS to block feature launches till CF supports them.