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 a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.

CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training PartnerAWS Migration PartnerAWS Data and Analytics PartnerAWS DevOps Competency PartnerAWS GenAI Competency PartnerAmazon QuickSight Service Delivery PartnerAmazon EKS Service Delivery Partner AWS Microsoft Workload PartnersAmazon EC2 Service Delivery PartnerAmazon ECS Service Delivery PartnerAWS Glue Service Delivery PartnerAmazon Redshift Service Delivery PartnerAWS Control Tower Service Delivery PartnerAWS WAF Service Delivery PartnerAmazon CloudFrontAmazon OpenSearchAWS DMS and many more.

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!