Setting up CodeWhisperer with AWS Cloud9 - AWS Cloud9

Setting up CodeWhisperer with AWS Cloud9

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. For details about working with IAM for AWS Cloud9, see Identity and access management in AWS Cloud9.

Activating CodeWhisperer within the AWS Cloud9 IDE

Once you have accessed the AWS Cloud9 IDE you need to activate CodeWhisperer.

  1. From the AWS Cloud9 IDE, choose aws-explorer from the AWS Cloud9 IDE sidebar.

  2. From the Developer Tools navigation pane, choose CodeWhisperer (Preview).

  3. Choose Enable CodeWhisperer to accept the Terms of Service and activate CodeWhisperer within AWS Cloud9 IDE.

                    Selecting the CodeWhisperer option from AWS Cloud9 IDE