Automating AWS Config using CloudFormation - or not.

Today I tried automating AWS Config setup using CloudFormation. After all, we should be using AWS Config right?

Anyway, after the usual one step forward and n steps back getting the template to succeed and an hour or so with AWS support, it turns out that there is no way to delete a Config recorder once it has been created - you’ll get the error, “Maximum number of recorder reached: 1” when deploying your template.

Ref: Forums | AWS re:Post

This CLI command will show you if you have any Config recorders setup:

aws configservice describe-configuration-recorders

Even if you tried to deploy AWS Config using CloudFormation and then rollback by deleting the stack, the recorder will still be there.

Hopefully this will save someone hours of head banging frustration.


Related discussions:

I want to love CloudFormation. On paper it sounds awesome: fully declarative provisioning, among other things. I even made an embedded domain specific language for templates so I don’t have to work with raw JSON (see here). However, quirks like this feel all-too-common.

My strategy is to just write them down and work around them. I also just try to structure templates so I can make an exact copy of an environment to see exactly what a new change will do. I still think CloudFormation is better than other provisioning tools I’ve used though. Declarative provisioning, and especially making declarative modifications to existing resources, is a pretty complex problem to solve.

here

Stratosphere - wow very nice. Will check it out!

Totally gave up on cloudformation, using terraform and configuration management now instead.

I took a look at terraform but it seemed to just be a higher layer (not much higher) abstraction of CF in which I’d have to learn yet another syntax to do the exact same thing. Considering CF weak spots and Terraform just abstracts CF with the weak spots what is the benefit?

Disclaimer - I spent literally 5 minutes going through the Terraform intro and was turned off as it seemed that I had to use another syntax to basically do the same thing…with the same weak spots. I know that Terraform is all the rage so obviously I’m missing something. :frowning:

Very cool. Were you inspired by Troposphere? How does your DSL differ (besides being in Haskell)?

I was inspired troposphere, but I didn’t use many ideas from it. Troposphere has a very imperative API, and relies on calling the correct functions to check arguments.

Haskell has an extremely powerful type system, so creating a template in stratosphere is really just adding arguments directly to types. Oftentimes it is possible to have the Haskell source look very similar in structure to what you would see in a raw JSON template. Here are two examples to give you an idea: