@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-17T17:31:22.793Z") public class OpenSearchDataSource extends BackedDataSource
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_1_2) .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(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());
Modifier and Type | Class and Description |
---|---|
static class |
OpenSearchDataSource.Builder
(experimental) A fluent builder for
OpenSearchDataSource . |
IGrantable.Jsii$Default
IConstruct.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
OpenSearchDataSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
OpenSearchDataSource(software.amazon.jsii.JsiiObjectRef objRef) |
|
OpenSearchDataSource(software.constructs.Construct scope,
java.lang.String id,
OpenSearchDataSourceProps props) |
getGrantPrincipal
createFunction, createResolver, getApi, getDs, getName, getServiceRole, setApi, setServiceRole
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
protected OpenSearchDataSource(software.amazon.jsii.JsiiObjectRef objRef)
protected OpenSearchDataSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public OpenSearchDataSource(software.constructs.Construct scope, java.lang.String id, OpenSearchDataSourceProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.