arazzo: 1.0.1 info: title: Amazon Kendra Teardown Data Source and Index summary: Delete a data source connector, confirm it is gone, then delete the index that owned it. description: >- Cleanly decommissions an Amazon Kendra index by first deleting its data source connector, polling ListDataSources until the deleted connector no longer appears, and then deleting the index itself. Tearing the connector down before the index avoids orphaned crawl state. Each step inlines its request, including the AWS JSON protocol X-Amz-Target header, so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: kendraApi url: ../openapi/amazon-kendra-openapi.yml type: openapi workflows: - workflowId: teardown-data-source-and-index summary: Delete a data source, wait until it is gone, then delete the index. description: >- Deletes a data source connector, polls ListDataSources until it is gone, and deletes the owning index. inputs: type: object required: - indexId - dataSourceId properties: indexId: type: string description: The identifier of the index to tear down. dataSourceId: type: string description: The identifier of the data source connector to delete first. steps: - stepId: deleteDataSource description: >- Delete the data source connector so the index no longer crawls the source repository. operationId: DeleteDataSource parameters: - name: IndexId in: path value: $inputs.indexId - name: DataSourceId in: path value: $inputs.dataSourceId - name: X-Amz-Target in: header value: AWSKendraFrontendService.DeleteDataSource successCriteria: - condition: $statusCode == 200 - stepId: waitForDataSourceGone description: >- Poll the data source list until the deleted connector no longer appears, confirming deletion finished before removing the index. operationId: ListDataSources parameters: - name: IndexId in: path value: $inputs.indexId - name: X-Amz-Target in: header value: AWSKendraFrontendService.ListDataSources successCriteria: - condition: $statusCode == 200 outputs: summaryItems: $response.body#/SummaryItems onSuccess: - name: dataSourceGone type: goto stepId: deleteIndex criteria: - context: $response.body condition: $.SummaryItems[?(@.Id=="$inputs.dataSourceId")] empty type: jsonpath onFailure: - name: retryListDataSources type: retry stepId: waitForDataSourceGone retryAfter: 20 retryLimit: 15 criteria: - context: $response.body condition: $.SummaryItems[?(@.Id=="$inputs.dataSourceId")] anyof type: jsonpath - stepId: deleteIndex description: >- Delete the index now that its data source connector has been removed. operationId: DeleteIndex parameters: - name: IndexId in: path value: $inputs.indexId - name: X-Amz-Target in: header value: AWSKendraFrontendService.DeleteIndex successCriteria: - condition: $statusCode == 200 outputs: deletedIndexId: $inputs.indexId deletedDataSourceId: $inputs.dataSourceId