2023-10-02|閱讀時間 ‧ 約 6 分鐘

Working with Amazon CodeWhisperer by using AWS Cloud9


What is CodeWhisperer?

Amazon CodeWhisperer is a machine learning service that improves developer productivity by generating code suggestions based on their natural language comments and code in their IDE.

CodeWhisperer supports programming languages such as Java, JavaScript, Python, C#, and TypeScript, and also supports code generation for Ruby, Go, PHP, C++, C, Shell, Scala, Rust, Kotlin, and SQL. The service integrates with several integrated development environments (IDEs), including JetBrains (IntelliJ, PyCharm, WebStorm, and Rider), Visual Studio Code, AWS Cloud9, and AWS Lambda Console.


Setting up


AWS IAM CodeWhisperer permissions for AWS Cloud9

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CodeWhispererPermissions",
"Effect": "Allow",
"Action": ["codewhisperer:GenerateRecommendations"],
"Resource": "*"
}
]
}


Activating Amazon CodeWhisperer with AWS Cloud9

From inside your existing AWS Cloud9 environment, choose the AWS logo on the left edge of the window. A panel will expand rightward.

In the lower part of the panel, under Developer tools, open the CodeWhisperer dropdown.

Choose Enable CodeWhisperer.


Enter your description :# add two numbers in the python

It will give you tips on what to do.

Bubble Sort


All in all, CodeWhisperer is a powerful AI coding companion that helps developers build applications faster and more securely.


Security scans

CodeWhisperer offers a valuable Security Scan feature for your project files. It enhances application resilience by identifying security concerns like cross-site scripting vulnerabilities, log injections, weak file permissions, and hardcoded credentials. This security scan seamlessly integrates with CodeGuru, which applies multiple layers of filtering to prioritize critical issues. CodeGuru filters unsupported languages and conducts preliminary code testing, even for open source code, before initiating security scans.


Next article Using Amazon CodeGuru Security to find out if code is vulnerable


Reference

https://aws.amazon.com/tw/codewhisperer/

https://docs.aws.amazon.com/codewhisperer/latest/userguide/cloud9-setup.html

分享至
成為作者繼續創作的動力吧!
嗨嗨 https://www.linkedin.com/in/puff666/
© 2024 vocus All rights reserved.