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 the CodeWhisperer experimental feature

To activate CodeWhisperer, complete the following procedure.

  1. In AWS Cloud9, choose the AWS Toolkit icon from the left nav.

  2. Under Developer Tools, choose CodeWhisperer -> Request access.

  3. Check back regularly, reloading your browser each time. When you have been given access, this option will change from Request access to Enable CodeWhisperer.

  4. Choose Enable CodeWhisperer.

  5. A tab will open, displaying the terms of service for the Amazon CodeWhisperer preview.

    Review the terms, and then choose Accept and Enable CodeWhisperer.

Activating auto-suggestions for the AWS Cloud9

For CodeWhisperer to run in AWS Cloud9, the auto-suggestions feature must be active in AWS Cloud9. To activate auto-suggestions, complete these steps.

  1. In AWS Cloud9, choose the AWS Toolkit icon from the left navigation panel.

  2. Choose CodeWhisperer -> Activate auto-suggestions.

  3. A window will open containing the CodeWhisperer terms of service. Read them, and if you accept the terms, choose Accept.

  4. Under Developer Tools, under CodeWhisperer (Preview), choose Enable CodeWhisperer.

  5. Read the CodeWhisperer terms of service and choose Accept.