Skip to content

Commit f562308

Browse files
authored
feat: Support OpenSearch datasource (#481)
1 parent f76aa16 commit f562308

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/index.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,8 @@ class ServerlessAppsyncPlugin {
993993
defaultStatements.push(dbStatement, secretManagerStatement);
994994
break;
995995
}
996-
case 'AMAZON_ELASTICSEARCH': {
996+
case 'AMAZON_ELASTICSEARCH':
997+
case 'AMAZON_OPENSEARCH_SERVICE': {
997998
let arn;
998999
if (ds.config.domain) {
9991000
arn = {
@@ -1121,6 +1122,19 @@ class ServerlessAppsyncPlugin {
11211122
],
11221123
},
11231124
};
1125+
} else if (ds.type === 'AMAZON_OPENSEARCH_SERVICE') {
1126+
resource.Properties.OpenSearchServiceConfig = {
1127+
AwsRegion: ds.config.region || config.region,
1128+
Endpoint: ds.config.endpoint || {
1129+
'Fn::Join': [
1130+
'',
1131+
[
1132+
'https://',
1133+
{ 'Fn::GetAtt': [ds.config.domain, 'DomainEndpoint'] },
1134+
],
1135+
],
1136+
},
1137+
};
11241138
} else if (ds.type === 'RELATIONAL_DATABASE') {
11251139
resource.Properties.RelationalDatabaseConfig = {
11261140
RdsHttpEndpointConfig: {

0 commit comments

Comments
 (0)