Search HQ CLI Guide¶
The search-hq
command-line interface (CLI) allows you to manage and interact with the Search HQ application. Below is an overview of the available commands and their descriptions.
Getting Started¶
To get started with the search-hq
CLI, run the following command to see an overview of available options and commands:
This command will display a summary of the CLI usage, including available commands and options:
Usage: search-hq [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
deploy Deploy the complete Search HQ application.
destroy Destroy the complete Search HQ application.
hybrid-search Operate Hybrid Search service.
opensearch-auto-scaling Operate OpenSearch Auto Scaling service.
opensearch-gateway Operate OpenSearch API Gateway service.
resources List CloudFormation stack resources.
status List CloudFormation stack statuses.
Download Configurations¶
Deploy Application¶
Manage the Complete Application¶
Use the search-hq deploy
command to deploy the entire Search HQ application, including all services and infrastructure. This encompasses:
- Application Infrastructure: Sets up the foundational infrastructure for the application.
- OpenSearch Auto Scaling service: Deploys auto scaling functionality for OpenSearch to handle varying loads.
- Search API Service: Deploys the API Gateway service for managing search operations.
- Hybrid Search service: Deploys the SageMaker service for advanced embedding inference.
To execute the deployment process, use the following command:
Option | Type | Required | Description |
---|---|---|---|
auto_approve |
Boolean | Optional | Automatically approve all prompts during deployment without manual confirmation. Default is True . |
model_overwrite |
Boolean | Optional | Overwrite the existing model artifact in the Amazon S3 bucket if it already exists. Default is False . |
If you want to deploy individual services separately, use the following commands:
Manage the Hybrid Search service¶
To get detailed usage instructions for managing the Hybrid Search service, including embedding model deployment and semantic index schema generation, run:
For comprehensive documentation on Hybrid Search commands, please see the Hybrid Search CLI Guide.
Manage OpenSearch Auto Scaling service¶
To get detailed usage instructions for managing the OpenSearch Auto Scaling service, including deployment and destruction, run:
For comprehensive documentation on OpenSearch Auto Scaling commands, please see the OpenSearch Auto Scaling CLI Guide.
Manage the OpenSearch API Gateway service¶
To get detailed usage instructions for managing the OpenSearch API Gateway service, including deployment, destruction, and retrieval of API information, run:
For comprehensive documentation on OpenSearch API Gateway commands, please see the OpenSearch API Gateway CLI Guide.
List CloudFormation Stack Resources¶
The search-hq resources
command lists the resources for CloudFormation stacks. This is useful for reviewing the components that have been deployed, including infrastructure, services, and other resources managed by the application.
To list resources for all CloudFormation stacks, use:
To list resources for particular CloudFormation stacks, use:
Replace <STACK_NAMES>
with the names of the stacks you want to query.
Display CloudFormation Stack Statuses¶
Use the search-hq status
command to display the statuses of CloudFormation stacks, including current status, creation time, and last updated time.
To list the statuses of all CloudFormation stacks, use:
To list the statuses of specific CloudFormation stacks, use:
Replace <STACK_NAMES>
with the names of the stacks you want to query.
Destroy Application¶
Destroy the Full Search HQ¶
Use the search-hq destroy
command to remove the entire Search HQ application and all associated resources. This command performs a comprehensive cleanup of the following components:
- OpenSearch Auto Scaling service: Removes the auto scaling functionality for OpenSearch.
- OpenSearch API Gateway service: Deletes the API Gateway service managing search operations.
- SageMaker Inference Service: Destroys the SageMaker service used for advanced embedding inference.
- Application Infrastructure: Cleans up the foundational infrastructure set up for the application.
To execute the destruction process, use the following command:
Option | Type | Required | Description |
---|---|---|---|
auto_approve |
Boolean | Optional | Automatically approve all prompts during destruction without manual confirmation. Default is True . |
If you need to destroy individual services separately, use the following commands:
Destroy the OpenSearch Auto Scaling service¶
To get detailed usage instructions for destroying the OpenSearch Auto Scaling service, including specific options and commands, run:
For comprehensive documentation on OpenSearch Auto Scaling commands, please see the OpenSearch Auto Scaling CLI Guide.
Destroy the OpenSearch API Gateway service¶
To get detailed usage instructions for destroying the OpenSearch API Gateway service, including specific options and commands, run:
For comprehensive documentation on OpenSearch API Gateway commands, please see the OpenSearch API Gateway CLI Guide.
Destroys the SageMaker Inference Service¶
To get detailed usage instructions for destroying the SageMaker inference service, including specific options and commands, run:
For comprehensive documentation on Hybrid Search commands, please see the Hybrid Search CLI Guide.
Remove Associated Resources¶
By default, the destroy
command will retain the Amazon S3 bucket and AWS Systems Manager Parameter Store associated with your search-hq
deployment. You can choose to manually delete these resources if needed.
-
Remove Objects from Amazon S3 Bucket: To delete the entire Amazon S3 bucket associated with your
search-hq
deployment, use the following command. This will remove the entire bucket and all objects within it:If you only need to delete a single object from the Amazon S3 bucket, use:
Replace
<S3_OBJECT_KEY>
with the key of the object you want to delete from the Amazon S3 bucket. -
Remove Parameters from SSM: To delete all parameters associated with your
search-hq
deployment from AWS Systems Manager Parameter Store, use:If you only need to delete a single parameter, use:
Replace
<PARAMETER_NAME>
with the name of the parameter you want to delete from the AWS Systems Manager Parameter Store.