elastic: Can't put document into AWS ES service.
Which version of Elastic are you using?
elastic.v2 (for Elasticsearch 1.x)
Please describe the expected behavior
Successful document put into the index.
Please describe the actual behavior
Error is returned:
elastic: Error 403 (Forbidden)
Any steps to reproduce the behavior?
Setup:
creds := credentials.NewEnvCredentials()
signer := v4.NewSigner(creds)
awsClient, err := aws_signing_client.New(signer, nil, "es", "us-west-2")
if err != nil {
return nil, err
}
return elastic.NewClient(
elastic.SetURL(...),
elastic.SetScheme("https"),
elastic.SetHttpClient(awsClient),
elastic.SetSniff(false),
)
Put:
_, err = e.Client.Index().Index(indexName).Type(indexType).
Id(doc.ID).
BodyJson(doc).
Do()
Not sure if this is elastic or aws_signing_client issue.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 26 (13 by maintainers)
I’ve solved that by creating http.Transport based on https://github.com/smartystreets/go-aws-auth
Usage