Working with Amazon CodeWhisperer by using AWS Cloud9 - AWS Cloud9

Working with Amazon CodeWhisperer by using AWS Cloud9

What is CodeWhisperer?

Amazon CodeWhisperer is a machine learning powered service that helps improve developer productivity by generating code recommendations based on developers’ comments in natural language and their code in the IDE. CodeWhisperer is available for the Java, JavaScript, Python, C# and TypeScript programming languages and also supports code generation for Ruby, Go, PHP, C++, C, Shell, Scala, Rust, Kotlin and SQL. The service integrates with multiple integrated development environments (IDEs), including JetBrains (IntelliJ, PyCharm, WebStorm, and Rider), Visual Studio Code, AWS Cloud9, and the AWS Lambda console. For examples of how CodeWhisperer integrates with AWS Cloud9 and displays code suggestions in the AWS Cloud9 IDE, see Code Examples in the Amazon CodeWhisperer User Guide.

For more information on using CodeWhisperer with AWS Cloud9, see the Amazon CodeWhisperer User Guide.

AWS Identity and Access Management permissions for AWS Cloud9

For CodeWhisperer to provide recommendations in the AWS Cloud9 console, you must enable the correct IAM permissions for either your IAM user or role. You must add the codewhisperer:GenerateRecommendations permission, as outlined in the sample IAM policy below:

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

It is best practice to use IAM policies to grant restrictive permissions to IAM principals.