- Newest
- Most votes
- Most comments
I might be missing this to check somewhere in your script or profile from where you run the script, can you make sure that correct region is passed either in profile or in command directly. With AWS Secretsmanager, this error message is most common when we miss to specify the region, can you please add --region in this command and see how it goes.
Providing this suggestion with a guess that your CLI profile might not have the same region, in which secret exists. Let's assume your secret is in us-east-1 and profile you setup was for us-east-2, then secret won't show up if you only specify profile name not region explicitly
ADMIN_SECRET=$(aws secretsmanager list-secrets --profile $BBBPROFILE --filter Key="name",Values="BBBAdministratorlogin" --region us-east-1 --query 'SecretList[0].Name' --output text)
ADMIN_AUTH=$(aws secretsmanager get-secret-value --profile $BBBPROFILE --secret-id $ADMIN_SECRET --region us-east-1)
I'm providing you a live example of same situation, where, I have my profile setup for us-east-1 and my secret is also in us-east-1 but in same account, there is no secret in us-east-2. Now see the results below(In your case, it sounds opposite that secret doesn't exist in default region which is setup in profile):
Same profile but different region and so different result.
I'd suggest you to check that once and comment here, if there are additional questions.
Hi reda.
The error message states a problem with accessing a secret.
in setup.sh lines 169-171 you have the following:
#get the secrets
ADMIN_SECRET=$(aws secretsmanager list-secrets --profile $BBBPROFILE --filter Key="name",Values="BBBAdministratorlogin" --query 'SecretList[0].Name' --output text)
ADMIN_AUTH=$(aws secretsmanager get-secret-value --profile $BBBPROFILE --secret-id $ADMIN_SECRET)
Please make sure the secret BBBAdministratorlogin
exist and you have permissions to access it. I didn't find it in any CloudFormation template, therefore, I must assume that it is supposed to be create manually.
I hope this helps.
how i can make sure the BBBAdministratorlogin exist?
Check the AWS Secrets Manager Console. If it is not there, you can create it. Also, again, ensure the credentials you are using have permissions to access Secrets Manager and this particular secret.
Relevant content
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 4 months ago
Hey, thanks for the detailed explanation , where should i add --region in the script or when running the ./deploy.sh?
Inside the script, in the command where you are listing the secret and getting secret value. I mentioned in my answer already, how commands should look like, region can be different in your case, so change value accordingly. Let me know how it goes.