AWS Secrets Manager access
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 12:56 AM - edited 03-04-2025 12:57 AM
Hi
I am trying to establish a method of accessing secrets from AWS Secrets Manager and understand this can be done with boto as suggested from AWS.
We have created all of the relevant IAM roles, instance profiles etc. Accessing S3 with this method is working well.
However, whenever I try to interact with Secrets Manager I keep getting the
"NoCredentialsError: Unable to locate credentials" error.
The role assigned to the EC2 after creation has the relevant permission to read/write from Secrets Manager.
I'm at a dead end and appreciate any help.
Many Thanks
Example code:
import boto3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 09:04 AM
Hi @patrykp,
Verify that the attached IAM policy includes the necessary secretsmanager:GetSecretValue
, secretsmanager:ListSecrets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 11:56 PM
Hi @Alberto_Umana,
Yes, the Role has the SecretsManagerReadWrite policy.
Also within my furthet investigation I tried running it via Personal Cluster and it worked!
Basically, 3 scenarios:
- Shared Cluster with applied InstanceProfile - Secrets failing
- Personal without InstanceProfile applied - Secrets failing
- Shared Cluster with applied InstanceProfile - Secrets received succesfully.
So I guess problem is with the Access mode of the cluster? Cannot find anything related to that in the docs.

