- Newest
- Most votes
- Most comments
Based on the error message, it appears that your Java client is trying to use a profile named 'profile-name' which doesn't exist in your credentials file. The error shows that your credentials file contains three profiles: 'PowerUserAccess-441168212764', '441168212764', and 'sphof'.
There are two ways to fix this issue:
- Update your Java code to use one of the existing profiles. For example, if you want to use the 'PowerUserAccess-441168212764' profile, you would modify your code to use that profile name when creating the credentials provider:
AWSCredentials credentials = new ProfileCredentialsProvider("PowerUserAccess-441168212764").getCredentials();
- Alternatively, you could add a 'default' profile to your credentials file if your code is using the default profile. In your credentials file, add:
[default]
aws_access_key_id = YOUR_AWS_ACCESS_KEY_ID
aws_secret_access_key = YOUR_AWS_SECRET_ACCESS_KEY
Replace the placeholder values with your actual AWS access key ID and secret access key.
Make sure that the profile you're using has the necessary permissions for Amazon Rekognition. You mentioned that you've granted the PowerUserAccess-441168212764 user the necessary permissions, so using that profile should work if configured correctly in your code.
Also, ensure that your credentials file is saved in the correct location:
- On Windows: C:\Users<yourUserName>.aws\credentials
- On Linux, macOS, or Unix: ~/.aws/credentials
Remember not to include a file extension when saving the credentials file.
Sources
Create a shared credentials file - Amazon Simple Email Service
DescribeCertificateAuthority - AWS Private Certificate Authority
ProfileCredentialsUtils (AWS SDK for Java - 2.21.29)
AWS IAM credentials - AWS Toolkit for VS Code
Relevant content
- asked 2 years ago
- asked 4 years ago
