Strange error when trying to use codeWhisper on Cloud9 targeting a Lightsail instance

0

I'm able to connect to my lightsail instance in cloud9 but as soon as I type in the editor, (any filetype for which codeWhisper makes suggestions), I get this error message ...

...assumed-role/AmazonLightsailInstanceRole/i-08e42184b53ebfe76 is not authorized to perform: codewhisperer:GenerateRecommendations because no identity-based policy allows the codewhisperer:GenerateRecommendations action

both my root user and the IAM user I created for cloud9 have the available and required cloud 9 and codewhisper policies attached at the user and group level but I can find neither of the "AmazonLightsailInstanceRole", nor the "codewhisperer:GenerateRecommendations" action at any of the user, role, nor policy levels.

All of the other elements of Cloud9 are working correctly but I can't find this permission to add it.

Can anyone give a suggestion on how to add this permission?

1 Answer
1

Hello.

When you connect to Lightsail and execute the command below, you will see that "AmazonLightsailInstanceRole" is set.
"AmazonLightsailInstanceRole" is an IAM role set on the Lightsail infrastructure side, so I don't think it can be changed.

aws sts get-caller-identity

So, why not try setting the AWS credentials for the Linux user you set up in Cloud9?
Try attaching the necessary IAM policy such as "codewhisperer:GenerateRecommendations" to this AWS authentication information.
Please refer to the following document for setting AWS credentials.
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html

profile picture
EXPERT
answered 3 months ago
  • AmazonLightsailInstanceRole role is not usable Cloud9. You will need to create a dedicated IAM User with permissions that are necessary for Cloud9, and then do aws configure on the instance, and it will prompt you to enter the IAM user's access key and the secret key. aws configure will store these credentials on instance in ~/.aws/` as described in the doc link provided by Riku.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions