- Newest
- Most votes
- Most comments
Hello.
Looking at the Terraform code, when creating Opensearch, the password is stored in SecretsManager with "master_user_password = aws_secretsmanager_secret_version.secret.secret_string".
So, you can find the password you use to log in to Opensearch by opening the SecretsManager console and looking for secrets.
https://github.com/aws-samples/rag-using-langchain-amazon-bedrock-and-opensearch/blob/main/terraform/opensearch.tf
However, it's a bit too costly to store my credentials in SecretsManager for this sample proof of concept (~900USD/month, according to the AWS calculator).
How did you calculate $900?
SecretsManager fees vary depending on the number of API calls and the number of registered secrets.
So, I don't think it will reach $900 unless the number of requests is quite large.
https://aws.amazon.com/secrets-manager/pricing/?nc1=h_ls
In the application code, the Opensearch password is set on line 59 of the code below.
So, I thought that if you don't want to use SecretsManager, you can just replace this part with the password registered in SecretsManager.
https://github.com/aws-samples/rag-using-langchain-amazon-bedrock-and-opensearch/blob/main/load-data-to-opensearch.py
opensearch_password = secret.get_secret(name, region)
opensearch_client = opensearch.get_opensearch_cluster_client(name, opensearch_password, region)
Relevant content
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 10 months ago

Hi Riku,
Thank you very much for your prompt reply.
I've been sat with it for a few hours now, but can't seem to figure out why there are no Secrets stored in the SecretManager. I want to create a Secret for my OpenSearch username and password so that I can pass the Secret through the code, but can't even find my OpenSearch username and password in order to create a Secret for it.
Do you possibly have any suggestions? (:
Thank you
I believe SecretsManager is created in us-east-1. Looking at the Terraform code below, us-east-1 is specified. https://github.com/aws-samples/rag-using-langchain-amazon-bedrock-and-opensearch/blob/main/terraform/variables.tf
Therefore, try specifying the region as an argument as shown below.