-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
@aws-cdk/aws-appsyncRelated to AWS AppSyncRelated to AWS AppSync@aws-cdk/aws-elasticsearchRelated to Amazon Elasticsearch ServiceRelated to Amazon Elasticsearch Serviceeffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-appsyncRelated to AWS AppSyncRelated to AWS AppSync@aws-cdk/aws-elasticsearchRelated to Amazon Elasticsearch ServiceRelated to Amazon Elasticsearch Serviceeffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2