How are you automating AWS at scale?

I have been working to scale AWS automation since we are growing through partner marketing. We are looking at different automation options out there and this is what I have today. Feel free to add your view and feedback.

Inhouse:

- AWS SDK

- boto3

- inhouse resources to make and manage the automation scripts

Third-Party: Prebuilt frameworks -

OpsWorks, TotalCloud, Chef

How are you guys automating today? Any feedback, information, and insights are appreciated.


Related discussions:

We’re using Pulumi to write our infra in python. Coupled with gitlab gives us quite a nice deployment method

For scaling we are using fargate and cloudwatch

Do you use the self hosted version of Pulumi? If not, how does your company feel about another company having all the state/layout of your infra? If it is like Terrafrom this also includes all passwords you have setup.

From the deployment side CodeBuild and OctopusDeploy + CloudFormation.

We are trying to get away from servers entirely and move to either Lambda where we can and Fargate when we hit one of the lambda limitations.

I would stay away from Elastic beanstalk, Code Pipeline or OpsWorks. Code Deploy is not bad but relatively featureless.

I’m really interested in hearing about your experiences with Pulumi vs Terraform vs CF

I really want to Love pulumi. Wish they were completely open source and didn’t require accounts/login

Absolute winner stack - codebuild + codepipeline, cloudformation, cloudwatch, lambdas, step functions and EMR steps.

I’m going to be very honest, I’ve never heard of pulumi until this very minute. I get a lot of crap and get called an old fart for saying I prefer cloud formation over terraform, and My best one-sentence reason is that cfn is SUPPORTABLE. I did a deep dive into terraform about 3 years ago and I’m about to get back into it as an initiative with a group of smart guys at my gig.

But right this minute? I have a fantastic stack that cfn builds an instance, and based on parameters and tags, user data gets loaded and executed that sets up an instance (latest AMI that packer builds gets loaded into param store) and user data sets up whatever the client uses- puppet, chef, ansible, whatever.

I need to dive further into terraform and utilizing it as a multi-cloud situation maybe.

EDIT - for context, I’m engineering manager for a cloud focused MSP that manages 100+ clients and there’s tons of moving targets, initiatives, environments, etc

I come from a cloud formation background but we’ve been building out my fortune 400 companies cloud network with terraform and I’m trying to encourage teams to use what’s best for them to manage their applications.

We’re not allowing ec2 though, only Serverless and ECS/EKS unless you have a real business purpose. Everything here is already in on prem Open Shift so that won’t be bad.

I’m kind of hoping teams will use CF to build the applications and tracking state within CF, but for the networking and Organizational Units terraform has been fantastic.

Pulumi seems like it might be a best of both worlds scenario and make Infra as code easier for teams to do since they’ll know the languages better

We have grown quite fond of the AWS CDK for all our infrastructure as code, and github actions for CI/CD, all paired with inhouse CLI/API toolings for managing blue/green promotions, multi account management etc.

We are running entirely serverless, mostly Lambda and DynamoDB.

Only thing we are currently missing quite alot is stackset support in the CDK.

Atlassian stack locally. A bunch of cloud formation scripts running as part of our bamboo deployment phase.
Airflow to schedule everything in production.

Just to have several different data ingestion/processing pipelines. Making use of the ease of having everything serverless using Glue as a managed Spark environment for the heavy lifting.

I would stay away from Elastic beanstalk

I cannot upvote this enough. This product was awesome when it was new but it is now steaming pile of dogshit compared to other solutions available.

I’ve had success stitching together multiple code deploys in a pipeline for continuous integration.

I’d be curious to know more about octopus deploy.

can you share a little about what you disliked about code pipeline?

The biggest issue I had with CodePipeline is that it’s convoluted to setup for cross account builds when you have different environments in different accounts.

We also use Octopus Deploy variables in our CF templates to reference resources that are different across accounts (subnets, acm certificates etc). Yes I know that we could do the same with maps (convoluted and a beast to maintain), or Parameter Store. But I wouldn’t wish Parameter Store on my worse enemy.

Besides OctopusDeploy has built in steps for everything including running CF templates and managing IIS deployments. When you have lots of projects, Octopus is much more manageable including and creating a library of variables is much easier.

That being said, for small, simple personal projects I would use CodePipeline.

Interested in hearing what is wrong with EB? (honest question)

While Elastic Beanstalk is built on top of CloudFormation, it’s extremely limited and keeps you on its rails. For every use case, you get a lot more flexibility by just using AWS building blocks like CodeBuild, Code Deploy, CodePipeline and CloudFormation.

If you want an easy to setup getting started template and you want flexibility as your needs and/or knowledge changes, use CodeStar.

First, make sure you have a good vision. Automation “at all costs” means that you pave cowpaths instead of designing roads.

Chef is great, but has two massive flaws: 1) it has very high overhead (i.e. fairly large runtime on disk). 2) it is a leaky abstraction: If you say “install apache”, then delete that line, it doesn’t delete Apache. So now you have some boxes with Apache, and some without.. That will bite you eventually.

On-Prem, I might accept a little bit of Salt or Ansible. But in the cloud, there are so many ways to build things without Chef. For example, when you build AMIs, a bash script or Packer is way better than Chef. Sure it might look a little ugly, but will be much smaller and easier to change.

The best infrastructure I’ve found is Kubernetes + TerraForm/CloudFormation/Pulumi + CI/CD (Jenkins) so that all your codebases, including infrastructure always deploy to production unless they fail their tests, possibly including testing on a staging AWS account.)

Anything that is configured via GUI means that you aren’t capturing something in Git, which makes it harder to roll back, harder to audit, harder to resolve change conflicts, etc. Avoid as much as you can.

It’s fine to write a few tiny scripts in Boto/AWS SDK to perform runbook actions (migrations, DNS manipulations, etc). But if they get large, you need to re-design.

I’ve been toying with this setup: https://aws.amazon.com/quickstart/architecture/serverless-cicd-for-enterprise/

It offers a few benefits:

  • CloudFormation manages all infrastructure

  • Splits dev and prod environments into separate AWS accounts

  • Supports setup and tear down of feature branches in dev

  • CodePipeline CD of whatever YAML you define

The biggest drawback so far has been that it takes some work to integrate with GitHub instead of CodeCommit.

It’s been great so far, but I’m admittedly very new to this setup…it hasn’t been battle tested yet.

Most of the “magic” of EB can now be done better and with much more control using CFN, as Scarface74 said.

Beyond that, it’s fairly easy to get EB environments “stuck” in a mysterious half updated state requiring heavy handed tactics to unstick them.

Lastly, the CLI for EB is a dependency hell and really makes me hate and fear running any sort of updates to it or any of its ecosystem at all.