Voiced by Amazon Polly |
Amazon CodeWhisperer
Amazon CodeWhisperer is a Machine learning-powered service trained on billions of lines of code. It generates code recommendations and helps to improve developers’ productivity. CodeWhisperer automatically generates code recommendations ranging from code snippets to full functions based on the comments and code written in natural languages.
Customized Cloud Solutions to Drive your Business Success
- Cloud Migration
- Devops
- AIML & IoT
Features of Amazon CodeWhisperer
- Get more done faster: It reduces the coding time and accelerates code-building tasks with unfamiliar APIs.
- Code with confidence: You can easily review and add attribution using CodeWhisperer based on the open-source projects repository URL and License.
- Enhance code security: It scans your code to detect vulnerabilities that are hard to find, such as those that don’t meet security or crypto library best practices that are hard to find, and gives you code recommendations to remediate them immediately.
- Use your favorite tools: CodeWhisperer supports code generation for 15 programming languages, and the accuracy and quality of code generated depend on the size and quality of training data. These languages include Python, JavaScript, TypeScript, C#, Ruby, Go, PHP, C++, C, Shell, Scala, Rust, Kotlin, and SQL.CodeWhisperer is available as an AWS toolkit extensions for interactive development environments (IDEs) like Amazon Sagemaker Studio, JupyterLab, Visual Studio Code, JetBrains, AWS Cloud9, AWS Lambda, and AWS Glue Studio.
This blog mainly focuses on how to set up Amazon CodeWhisperer with AWS Lambda and activate code recommendations, followed by one example.
AWS Lambda
Lambda is a serverless computing service that runs code in response to events without provisioning or managing servers. You just need to write your code and supply it to runtime that lambda supports. AWS Lambda runs your code on compute infrastructure and performs all management tasks like server and operating system maintenance, capacity provision, scaling, and logging.
AWS Lambda runs your code in response to the event, and you pay only for the compute time you consume to run the code.
Set up Amazon CodeWhisperer with AWS Lambda
Amazon CodeWhisperer can be integrated with AWS Lambda to get code recommendations for the comments and code written in the AWS Lambda function.
You can integrate Amazon CodeWhisperer with AWS Lambda using the following steps.
Step 1: Create a lambda function. Add Function Name and Runtime. Create a lambda function. Add Function Name and Runtime.
Step 2: Click on “Change default execution role” and select a role to assign permission to access Amazon S3. Click on “Create Function”
Permission attached to IAM Role
Step 3: Open the Function, go to “Tools,” and select “Amazon CodeWhisperer Code Suggestions.” This will activate the CodeWhisperer code recommendation for the AWS Lambda function.
Step 4: Another way to activate Amazon CodeWhisperer is to click on “+” and select “Preferences.”
Step 5: Go to “User Settings” and enable “Amazon CodeWhisperer Code Suggestions.”
Code Recommendation to create an S3 bucket in the AWS Lambda function
Here is an example lambda function to create an Amazon S3 bucket using Python code. Once you type the comment like “#import json python library” and click “Alt+c”, Amazon CodeWhisperer will generate a code recommendation, and you will able to add code to the Function
The below snippets will show the code recommendations generated by Amazon CodeWhisperer to create an Amazon S3 bucket.
Conclusion
Amazon CodeWhisperer service generates code recommendations using the comments and code written in natural language. It is a machine learning-based code generator service that helps to improve developers’ productivity. One can easily activate Amazon CodeWhisperer with AWS Lambda and get code recommendations.
Get your new hires billable within 1-60 days. Experience our Capability Development Framework today.
- Cloud Training
- Customized Training
- Experiential Learning
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 850k+ professionals in 600+ cloud certifications and completed 500+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, AWS GenAI Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, Amazon ECS Service Delivery Partner, AWS Glue Service Delivery Partner, Amazon Redshift Service Delivery Partner, AWS Control Tower Service Delivery Partner, AWS WAF Service Delivery Partner, Amazon CloudFront Service Delivery Partner, Amazon OpenSearch Service Delivery Partner, AWS DMS Service Delivery Partner, AWS Systems Manager Service Delivery Partner, Amazon RDS Service Delivery Partner, AWS CloudFormation Service Delivery Partner, AWS Config, Amazon EMR and many more.

WRITTEN BY Rashmi D
Rashmi Dhumal is working as a Subject Matter Expert in AWS Team at CloudThat, India. Being a passionate trainer, “technofreak and a quick learner”, is what aptly describes her. She has an immense experience of 20+ years as a technical trainer, an academician, mentor, and active involvement in curriculum development. She trained many professionals and student graduates pan India.
Comments