Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-opensearchservice: Add OpenSearch custom package Resource and associated utils #29710

Open
1 of 2 tasks
fromsomnia opened this issue Apr 3, 2024 · 3 comments
Open
1 of 2 tasks
Labels
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@fromsomnia
Copy link

Describe the feature

Add support for instantiating OpenSearch custom package resources, usable when defining a Domain resource as well as for associating a package with existing domain resources.

Use Case

I'm looking to consistently use CDK to deploy/update my infrastructure rather than have a console-cdk hybrid in some cases, which has to be the case for my use of OpenSearch custom packages given the lack of CDK support at present.

Proposed Solution

// Define the S3 bucket containing the packages
const packagesBucket = s3.Bucket.fromBucketName(this, 'Bucket', 'my-packages');

// Define a custom package
const stopwords = new os.CustomPackage(this, 'StopWords', {
  packageName: 'stopwords',
  s3Bucket: packagesBucket,
  s3Key: 'stopwords.txt',
  hotReload: true,
});

// Reference an existing custom package
const synonyms = os.CustomPackage.fromCustomPackageAttributes(this, 'Synonyms', {
  packageArn: 'arn:aws:es:us-east-1:XXXX:domain/my-custom-package',
});

// Define an OpenSearch domain with pckages inline
new os.Domain(this, 'Domain', {
  ...
  packages: [
    stopwords,
    synonyms,
  ],
});

// Associate with an existing domain
const domain = os.Domain.fromDomainAttributes(this, 'MyDomain', {
  domainArn: 'arn:aws:es:us-east-1:XXXX:domain/my-domain',
});

domain.associatePackages(stopwords, synonyms);

Other Information

A CustomPackage Resource seems seems like a happy-path use case lacking simply pending further rollout of CDK support for OpenSearch. I'm currently using the console to get around this.

I imagine a custom Resource that wields CLI might be approachable but I haven't looked into it, especially since I'd expect this will be supported as an official Resource sooner rather than later.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.117

Environment details (OS name and version, etc.)

MacOS Sonoma 12.4 M1 Max

@fromsomnia fromsomnia added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 3, 2024
@github-actions github-actions bot added the @aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package label Apr 3, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Apr 3, 2024
@khushail khushail self-assigned this Apr 4, 2024
@khushail
Copy link
Contributor

khushail commented Apr 5, 2024

Thanks @fromsomnia for reaching out and requesting this feature. I checked the cloudformation docs, there is no support for custom packages as of now. So I wonder how your proposed solution would be implementable. However I have filed an internal ticket with Opensearchservice team (P125061378) and also added this feature to Cloudformation coverage roadmap.

@khushail khushail added p2 effort/medium Medium work item – several days of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Apr 5, 2024
@khushail khushail removed their assignment Apr 5, 2024
@fromsomnia
Copy link
Author

@khushail thank you for looking into this! In following the links you shared I found this: aws-cloudformation/cloudformation-coverage-roadmap#1570. It looks like packages are coming soon to cloudformation 🎉 Thank you again! 🙌

@khushail
Copy link
Contributor

khushail commented Apr 5, 2024

Thanks @fromsomnia for sharing the link. Please help us prioritise this by upvoting the created issue in Cloudformation coverage roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-opensearch Related to the @aws-cdk/aws-opensearchservice package effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants