BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News AWS Console-to-Code: Convert Console Actions to Reusable IaC

AWS Console-to-Code: Convert Console Actions to Reusable IaC

AWS has announced the general availability of Console-to-Code, a service that converts actions performed in the AWS Management Console into reusable code for the AWS CLI, Cloudformation, or CDK, which developers can download. In preview since last November, Console-to-Code currently supports Amazon EC2, RDS, and VPC.

According to the cloud provider, the service enables code generation from actions performed in the console, simplifying the transition from prototyping to production deployments. Abhishek Gupta, principal developer advocate at AWS, explains how to convert console actions to reusable code, stating:

With just a few clicks, Amazon Q can generate code for you using the infrastructure-as-code (IaC) format of your choice, including AWS CloudFormation template (YAML or JSON), and AWS Cloud Development Kit (AWS CDK) (TypeScript, Python or Java). This can be used as a starting point for infrastructure automation and further customized for your production workloads.

Source: AWS Blog

The general availability release offers a new user experience for managing prototyping, recording, and code generation workflows, along with AWS CDK and CloudFormation code generation powered by Amazon Q machine learning models. Randall Hunt, technologist and VP of Cloud at Caylent, comments:

So, Amazon Q Console to Code came out ~7 years after Former2 (og ConsoleRecorder). Q supports CloudFormation and CDK only. Oh, and it also only supports EC2, VPC, and RDS. Former2 (7 years ago) supported many more services, was basically the work of one guy, and could output all of the above plus Terraform.

Corey Quinn, chief cloud economist at The Duckbill Group, agrees:

Console-to-Code is now an official version of the far more capable Former2, which has the temerity to exist without being "AI Powered."

Console-to-Code also supports a code preview option for Amazon EC2 and Amazon EC2 Auto Scaling groups, allowing developers to generate infrastructure code without actually creating the resources. Gupta adds:

The single-click CLI code generation experience is based on the API commands that were used when actions were executed (while launching the EC2 instance). Its interesting to note that the companion screen surfaces recorded actions as you complete them in console. And thanks to the interactive UI with start and stop functionality, its easy to clearly scope actions for prototyping.

While generated AWS CLI commands for infrastructure workflows are always free, there is a limit of 25 generations per month for AWS CDK and CloudFormation formats. Additional requests require an Amazon Q Developer subscription.

In a popular Reddit thread, many developers noted that Azure and GCP have already offered similar features and highlighted the limited number of supported AWS services. User dmurawsky adds:

After many many years of doing projects in AWS, specifically looking at using new technologies as they come out, I have found the best way to try to roll out something new is to manually set it up once using the console/clickops. (...) So in that use case, after setting up manually, being able to export the IaC is fantastic!

The recorded actions table only displays actions taken during the current session within a specific browser tab; it does not retain actions from previous sessions or other tabs. Console-to-Code is now available in all AWS regions.

About the Author

Rate this Article

Adoption
Style

BT