High level construct for an AppSync Elasticsearch data source
See original GitHub issueWhile working on an application I needed to setup an AppSync API which accesses Elasticsearch.
Use Case
Currently this has to be done through the CfnXyz
construct. Implementing a higher level construct would simplify the usage of Elasticsearch as a data source.
Proposed Solution
A simple class to create an Elasticsearch data source would do. Implementation could be done similar to the existing DynamoDbDataSource
and LambdaDataSource
.
Implementation could be as simple as this:
/**
* Properties for an AppSync Elasticsearch data source
*/
export interface ElasticsearchDataSourceProps extends BaseDataSourceProps {
/**
* Region for the Amazon Elasticsearch Service domain
*/
readonly region: string;
/**
* Endpoint for the Amazon Elasticsearch Service domain
*/
readonly endpoint: string;
}
/**
* An AppSync data source backed by Elasticsearch
*/
export class ElasticsearchDataSource extends BaseDataSource {
constructor(scope: Construct, id: string, props: ElasticsearchDataSourceProps) {
super(scope, id, props, {
type: 'AMAZON_ELASTICSEARCH',
elasticsearchConfig: {
awsRegion: props.region,
endpoint: props.endpoint
}
});
}
}
Other
There was a PR which already added a base class for a data source> This makes it easy to add a new resolver.
- 👋 I may be able to implement this feature request
- ⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:16 (9 by maintainers)
Top Results From Across the Web
aws-cdk/aws-appsync module - AWS Documentation
The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or ......
Read more >Build an AppSync API Using ElasticSearch and Lambda as ...
Create an IAM role for AppSync Data Source to invoke Lambda functions. ... Associate this role with the data source designated for the...
Read more >Build a Serverless Data API with AppSync and DynamoDB
Introduction. Please find below a tutorial to create a serverless data api using AWS DynamoDB as the backend data store and AWS AppSync...
Read more >AWS AppSync - The Ultimate Guide - Serverless Framework
In addition, AppSync provides a convenient way to connect each resolver function to a data source. The data sources supported by default include...
Read more >Find your way in AppSync - AWS AppSync Architecture
The data of the API is delivered by any of the AWS data sources on the right: an Amazon DynamoDB, Amazon Elasticsearch or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the reminder! Will get back to this shortly.
Any ETA on the L2 ElasticSearch data source availability, please? We’ve lost days trying to go the CfnDataSource / CfnResolver route, but that seems to have its own issues (type_name lookup issues). Thank you.