You can clean up the ingestion resources immediately after ingesting the documents into your OpenSearch index. The ingestion executes as a one-off Amazon ECS task. For a production scenario with changes to the source documents you should consider scheduling Amazon ECS tasks for ingesting the latest version of documents on a schedule.
- In your terminal navigate to the ingestion directory
cd ~/semantic-search-aws-docs/ingestion
in this repository. - Run
terraform destroy -var-file="awsdocs.tfvars" -var="infra_region=$REGION" -var="infra_tf_state_s3_bucket=$S3_BUCKET" -var="docs_src=(eval sed -e 's/^"//' -e 's/"$//' <<< (terraform output docs_src))"
to clean up the ingestion resources. - Enter
yes
when Terraform prompts you "Do you really want to destroy all resources?".