Replies: 1 comment
|
CDK doesn't have an L2 construct for OpenSearch direct query S3 datasources yet. You'll need to use the L1 Using AwsCustomResourceimport { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from "aws-cdk-lib/custom-resources";
const dataSource = new AwsCustomResource(this, "OpenSearchS3DataSource", {
onCreate: {
service: "OpenSearchService",
action: "createDataSource",
parameters: {
DomainName: domain.domainName,
Name: "my-s3-datasource",
DataSourceType: {
S3GlueDataCatalog: {
RoleArn: glueAccessRole.roleArn,
},
},
},
physicalResourceId: PhysicalResourceId.of("s3-datasource"),
},
onDelete: {
service: "OpenSearchService",
action: "deleteDataSource",
parameters: {
DomainName: domain.domainName,
Name: "my-s3-datasource",
},
},
policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE }),
});The S3 direct query feature works through Glue Data Catalog -- OpenSearch queries S3 data via a Glue catalog table, not directly. So you'll need:
Reference: Creating direct query S3 datasources There's also an open feature request for native L2 support -- worth upvoting if you find one, or opening a new one if not. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
The Amazon OpenSearch Service development guide says that it is possible to add S3 data source integration.
...like this:

How this could be done using CDK? I had not found any example to do so.
All reactions