AWS

4 Mins Read

Convert AWS Console Actions to Reusable Code with AWS Console to Code

Voiced by Amazon Polly

Introduction

AWS has announced the general availability of AWS Console to Code, a tool designed to help users convert actions performed in the AWS Management Console into reusable code snippets. This tool aims to bridge the gap between manual operations and automated infrastructure management by enabling developers to generate code automatically from their AWS console activities.

Transform Your Career with AWS Certifications

  • Advanced Skills
  • AWS Official Curriculum
  • 10+ Hand-on Labs
Enroll Now

Overview of AWS Console to Code

AWS Console to Code is a powerful tool that facilitates the translation of AWS Management Console actions into ready-to-use code. This code can be used to automate tasks, streamline workflows, and enhance collaboration across teams.

Key Features

1. Reusable Code Snippets

The tool generates reusable code snippets that can be integrated into existing codebases or used to kickstart new projects. This promotes consistency and efficiency across development teams.

2. Language Support

AWS Console to Code supports multiple programming languages, including Python, JavaScript, and TypeScript. This ensures compatibility with various development environments and preferences.

How to Use AWS Console to Code

Step-by-Step Guide

  1. Navigate to the AWS Console to Code tool.
  2. Perform an action in the AWS Management Console.
  3. Select the action you want to convert.
  4. Choose the desired programming language.
  5. Generate and download the code snippet.
  6. Integrate the code into your project or automation scripts.

Example Demo with Screenshots

Let’s walk through a straightforward example of launching an Amazon EC2 instance. First, navigate to the Amazon EC2 console. On the right-hand side, you’ll find the AWS Console-to-Code widget.

Click on “Start recording” to begin the recording process.

Now, launch an Amazon EC2 instance using the launch instance wizard in the Amazon EC2 console.

Assign a name to your EC2 instance for easy identification and management

Select the Amazon Machine Image (AMI) that defines the operating system and software for your instance.

Choose the t2.micro instance type, and select Proceed without a key pair for key pair configuration.

Leave the network settings at their default configuration.

Leave the storage settings at their default configuration.

Hit “Launch instance”

After the instance is launched, choose Stop to complete the recording.

In the Recorded actions table, review the actions that were recorded. Select the RunInstances action and use the Recorded actions dropdown list to review the options available

Select Generate CDK Python

You also have option to generate CDK for Java and TypeScript

Hit Copy.

You can modify the code as a foundation and adapt it to meet the requirements of your specific use case for production.

And paste it in CloudShell and hit enter

AWS CloudShell provides a browser-based shell environment for managing AWS resources with pre-configured access to AWS CLI.

Check it out in the Amazon EC2 console and new instance is getting launched

You can also generate CloudFormation template in YAML or JSON format

Infrastructure as a Code has been generated and you can use this is

You can use this Infrastructure as a Code generated in AWS CloudFormation

It’s recommended that you test and verify the generated IaC code before deployment.

Conclusion

AWS Console to Code is a valuable tool for developers and organizations looking to automate their AWS infrastructure management. By converting console actions into reusable code, the tool enhances efficiency, accuracy, and collaboration. With its general availability, AWS Console to Code is set to become an essential component of modern cloud development workflows.

Earn Multiple AWS Certifications for the Price of Two

  • AWS Authorized Instructor led Sessions
  • AWS Official Curriculum
Get Started Now

About CloudThat

CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.

WRITTEN BY Nehal Verma

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!