I’ve configured Opensearch domain in AWS. As part of automating configurations in opensearch, I want to create a set of index patterns.
I’ve tried so many APIs available online, but could not succeed. Has anyone managed to create index pattern in AWS Opensearch?
2
Answers
I've figured it out,
I used the python code provided by aws to create index patterns.
https://repost.aws/knowledge-center/opensearch-index-pattern
CURL command provided in the doc did not work as it gave me 404 not found error.
Please note that if you are creating index patterns in custom domain, please pass the headers as securitytenant instead of security_tenant mentioned in doc.
In my case (I use nodejs) I write typescript script which create opensearch index, I use
@opensearch-project/opensearch
npm packagethis is example code for nodejs, you can implements functionality like this in python.