Comments (6)
Jest might be useful here. Relevant links
[1] searchbox-io/Jest#248
[2] https://github.com/inreachventures/aws-signing-request-interceptor
from amazon-elasticsearch-lambda-samples.
But what if I don't want to use Jest? I have my app written to use plain rest calls. Does the sdk facilitate a way to sign the requests (or generate the headers) for me? I want to stick to the sdk so as things change, I don't have to constantly update custom code.
Is there an HttpRequest method in the sdk?
from amazon-elasticsearch-lambda-samples.
Hey @malpani I updated to use Jest and the request interceptor and that works. BUT, when I use credentials from "EnvironmentVariableCredentialsProvider" I get at 403 "message":"The security token included in the request is invalid.".. When I use my personal credentials it works fine. I've setup my execution role to have the following permissions (note I've removed my private data inside the carrots). Is there anything further to setup to allow my execution role to access elastic?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:*:*:*"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::*"
]
},
{
"Effect": "Allow",
"Action": "es:*",
"Resource": [
"arn:aws:es:us-east-1:<account>:domain/<domain>/*"
]
}
]
}
from amazon-elasticsearch-lambda-samples.
Native java SDK relies on binary protocol and I don't think it has an HttpClient.
Regarding the error you see, I have personally not used the request interceptor and it might be worth reporting an issue at https://github.com/inreachventures/aws-signing-request-interceptor with the code snippet for invoking it
from amazon-elasticsearch-lambda-samples.
Any updates on this? Is it really that hard to accomplish this from Java?
from amazon-elasticsearch-lambda-samples.
I was able to get it working with the Jest client and using the REST interface.
from amazon-elasticsearch-lambda-samples.
Related Issues (17)
- kinesis -> lambda -> ES only posting some records HOT 5
- for .gz log files
- Access Denied Error
- To push .log.gz (Application ELB) Logs to ElasticSearch HOT 1
- allow passing values from variables defined in lambda function
- CloudTrial to ElasticSearch HOT 1
- Elasticsearch 6.x compatibility issue HOT 6
- Error in ElasticSearch is not mapped to errorCallback of NodeHttpClient.handleRequest HOT 1
- js folder exposed to anonymous users
- Suggested IAM Policy for Lambda functions is too broad.
- Async Client? HOT 2
- Getting "Error: write after end" on every other log file that is ingested from s3 HOT 1
- Sign error HOT 6
- context.succeed would be called multiple times HOT 1
- Elastic search configuration policy during lambda execution HOT 1
- Unable to import module es HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-elasticsearch-lambda-samples.