Introducing IaC Snippets for Ansible, Docker Compose, Serverless Framework and Terraform

...
  • Release 1.7
  • IaC
  • Ansible
  • Serverless Framework
  • Terraform
About 3 min

# Introducing IaC Snippets for Ansible, Docker Compose, Serverless Framework and Terraform

In our upcoming release, we are excited to announce 'IaC Snippets'. One of the beauties of IaC is that you can define your system in code, and deploy it everywhere in a consistent and most importantly repeatable way. Until now, you had to write this code manually. And worst of all, if you post a question on reddit about building your Infra on AWS Console, you will just get the response of "If you are using the console, you are doing it wrong".

Commandeer output for Ansible, Docker Compose, Serverless Framework, and Terraform

Download the Commandeer App - 15-day Free Trial - The #1 developer IDE to manage your serverless and container infrastructures, both locally and in the cloud. With support for 30+ of the best cloud services out there.

This is an unfortunate effect of how cloud computing has been setup. Because AWS builds such great CLI's and API's for all of their tools, they tend to out lap their UI counterparts on the AWS Console. Not only that, but they will sometimes do things in the background, like setting up service to service roles, that are obfuscated from you as a developer.

So, you might get it setup in the browser correctly, and then when you try to replicate in code, you realize you have to do some special bash, or have to find or create a plugin of our own. For instance, connecting DynamoDB Streams to a lambda for existing tables in Serverless Framework was not possible, until we made the plugin to allow for it.


# A Change is Brewing

At Commandeer, we are constantly trying to break down the barriers to entry for developers using the cloud. One of the barriers is IaC. Because of the concept of NoOps, developers are expected to create and manage their own infrastructure.

While we strongly believe in the importance of managing your infrastructure as code, we also find it is not a valid argument that you have to use up your precious brain capacity as a developer memorizing the syntax for Ansible, Terraform, Serverless Framework, Docker Compose and the myriad of other IaC frameworks out there.

# Example 1 - Docker Containers to Docker Compose Snippets

By allowing you to export your currentcontainers into the correct docker-compose.yml format, we can save you time and frustration of getting your container to finally run with the correct ports, mounts, etc. Only to have to go back, and build the compose yaml or scour the internet for one that is valid. We continually run into this problem, where we are trying to add a new service, and have to tweak a lot of the settings to actually get it running.

Now you can simply click the 'IaC Snippets' button on the Docker Container Dashboard, or in the Side Navigation Treeview, top menu, or an individual component. Below you can see the button on the Dashboard in the top right.

Once you click the 'IaC Snippets' button, you will be presented with a dialog that gives you the docker-compose.yml snippet for each container.

# Example 2 - S3 to Ansible, Serverless Framework, and Terraform Snippets

In S3, you have buckets, which are basically root folders for storing files. You can create S3 buckets using many different IaC tools. We currently support Ansible, Serverless Framework, and Terraform. We will be adding output for AWS CDK, CloudFormation, Pulumi and others in the near future.

Below you can see the 'IaC Snippet' button presented on the S3 Dashboard. It can also be found in the side navigation, top menu for S3, and any of the bucket detail pages you navigate to.

Clicking on it will bring up the 'IaC Snippet' dialog. Below you can see the IaC code that is auto-generated for each language. You can switch languages in the drop down box.

# Ansible Snippet

Ansible IaC Snippet

# Serverless Framework Snippet

Serverless Framework IaC Snippet

# Terraform Snippet

# Conclusion

IaC is a very important and required necessity when building out cloud infrastructure. The ability to replicate your infrastructure across local, development, staging, and production environments is critical.

Stay tuned as we continue to expand on this offering, providing snippets for more services like DynamoDB, SNS, SQS, as well as more IaC tools, like Pulumi, CDK, and CloudFormation.

Happy Developing!

Last update: February 6, 2021 21:46