Class OpenSearchDataSource
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.services.appsync.BaseDataSource
software.amazon.awscdk.services.appsync.BackedDataSource
software.amazon.awscdk.services.appsync.OpenSearchDataSource
- All Implemented Interfaces:
IGrantable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-21T06:34:03.622Z")
@Stability(Stable)
public class OpenSearchDataSource
extends BackedDataSource
An Appsync datasource backed by OpenSearch.
Example:
import software.amazon.awscdk.services.opensearchservice.*; GraphqlApi api; User user = new User(this, "User"); Domain domain = Domain.Builder.create(this, "Domain") .version(EngineVersion.OPENSEARCH_2_3) .removalPolicy(RemovalPolicy.DESTROY) .fineGrainedAccessControl(AdvancedSecurityOptions.builder().masterUserArn(user.getUserArn()).build()) .encryptionAtRest(EncryptionAtRestOptions.builder().enabled(true).build()) .nodeToNodeEncryption(true) .enforceHttps(true) .build(); OpenSearchDataSource ds = api.addOpenSearchDataSource("ds", domain); ds.createResolver("QueryGetTestsResolver", BaseResolverProps.builder() .typeName("Query") .fieldName("getTests") .requestMappingTemplate(MappingTemplate.fromString(JSON.stringify(Map.of( "version", "2017-02-28", "operation", "GET", "path", "/id/post/_search", "params", Map.of( "headers", Map.of(), "queryString", Map.of(), "body", Map.of("from", 0, "size", 50)))))) .responseMappingTemplate(MappingTemplate.fromString("[\n #foreach($entry in $context.result.hits.hits)\n #if( $velocityCount > 1 ) , #end\n $utils.toJson($entry.get(\"_source\"))\n #end\n ]")) .build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IGrantable
IGrantable.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
OpenSearchDataSource
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
OpenSearchDataSource
(software.amazon.jsii.JsiiObjectRef objRef) OpenSearchDataSource
(software.constructs.Construct scope, String id, OpenSearchDataSourceProps props) -
Method Summary
Methods inherited from class software.amazon.awscdk.services.appsync.BackedDataSource
getGrantPrincipal
Methods inherited from class software.amazon.awscdk.services.appsync.BaseDataSource
createFunction, createResolver, getApi, getDs, getName, getServiceRole, setApi, setServiceRole
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
OpenSearchDataSource
protected OpenSearchDataSource(software.amazon.jsii.JsiiObjectRef objRef) -
OpenSearchDataSource
protected OpenSearchDataSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
OpenSearchDataSource
@Stability(Stable) public OpenSearchDataSource(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull OpenSearchDataSourceProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-