Class OpenSearchDataSource
(experimental) An Appsync datasource backed by OpenSearch.
Inherited Members
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.AWS.AppSync.dll
Syntax (csharp)
public class OpenSearchDataSource : BackedDataSource, IConstruct, IDependable, IGrantable
Syntax (vb)
Public Class OpenSearchDataSource
Inherits BackedDataSource
Implements IConstruct, IDependable, IGrantable
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.OpenSearchService;
GraphqlApi api;
var user = new User(this, "User");
var domain = new Domain(this, "Domain", new DomainProps {
Version = EngineVersion.OPENSEARCH_1_2,
RemovalPolicy = RemovalPolicy.DESTROY,
FineGrainedAccessControl = new AdvancedSecurityOptions { MasterUserArn = user.UserArn },
EncryptionAtRest = new EncryptionAtRestOptions { Enabled = true },
NodeToNodeEncryption = true,
EnforceHttps = true
});
var ds = api.AddOpenSearchDataSource("ds", domain);
ds.CreateResolver(new BaseResolverProps {
TypeName = "Query",
FieldName = "getTests",
RequestMappingTemplate = MappingTemplate.FromString(JSON.Stringify(new Dictionary<string, object> {
{ "version", "2017-02-28" },
{ "operation", "GET" },
{ "path", "/id/post/_search" },
{ "params", new Struct {
Headers = new Struct { },
QueryString = new Struct { },
Body = new Struct { From = 0, Size = 50 }
} }
})),
ResponseMappingTemplate = MappingTemplate.FromString(@"[
#foreach($entry in $context.result.hits.hits)
#if( $velocityCount > 1 ) , #end
$utils.toJson($entry.get(""_source""))
#end
]")
});
Synopsis
Constructors
OpenSearchDataSource(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
OpenSearchDataSource(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
OpenSearchDataSource(Construct, String, IOpenSearchDataSourceProps) |
Constructors
OpenSearchDataSource(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected OpenSearchDataSource(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
OpenSearchDataSource(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected OpenSearchDataSource(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
OpenSearchDataSource(Construct, String, IOpenSearchDataSourceProps)
public OpenSearchDataSource(Construct scope, string id, IOpenSearchDataSourceProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IOpenSearchDataSourceProps
Remarks
Stability: Experimental
Implements
Constructs.IConstruct