question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

High level construct for an AppSync Elasticsearch data source

See original GitHub issue

While 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:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
adamelmorecommented, Nov 8, 2020

Hi @adamelmore - looks like the L2 may be ready? Would love this ES data source!

Thanks for the reminder! Will get back to this shortly.

3reactions
tsykora-verimatrixcommented, Dec 4, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found