Skip to content

Commit c822933

Browse files
authored
Merge pull request #141 from aws-samples/remove_tf
chore(doc_explorer): remove dep to TF and link official repo
2 parents 3b70c48 + c4b67df commit c822933

File tree

8 files changed

+3
-303
lines changed

8 files changed

+3
-303
lines changed

samples/document_explorer/README.md

Lines changed: 3 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
The "Document Explorer" sample generative AI application demonstrates how to build end-to-end solutions leveraging AWS services and [AWS Generative AI CDK Constructs](https://github.com/awslabs/generative-ai-cdk-constructs).
66

7+
> Note: This sample can also be deployed through Terraform ! Please refer to the [Terraform sample code](https://github.com/aws-samples/aws-generative-ai-terraform-samples/tree/main/samples/document-explorer) for more details.
8+
79
It includes examples of key components needed in generative AI applications:
810

911
- [Data Ingestion Pipeline](https://github.com/awslabs/generative-ai-cdk-constructs/tree/main/src/patterns/gen-ai/aws-rag-appsync-stepfn-opensearch): Ingests documents, converts them to text, and stores them in a knowledge base for retrieval. This enables long context window approaches.
@@ -45,17 +47,6 @@ samples/document_explorer
4547
├── cdk-config-frontend
4648
│ └── frontend_stack.py # Frontend - CDK app
4749
48-
├── terraform-config-frontend # Frontend – Terraform
49-
│ │
50-
│ ├── main.tf # Terraform resources
51-
│ ├── outputs.tf # Outputs definition
52-
│ ├── variables.tf # Variables defintion
53-
│ └── terraform.tfvars # Variables values
54-
55-
├── terraform-config-backend # Backend – Terraform
56-
│ │
57-
│ ├── main.tf # Terraform resources
58-
│ └── outputs.tf # Outputs definition
5950
6051
├── bin
6152
│ └── document_explorer.ts # Backend - CDK app
@@ -153,7 +144,7 @@ Note: the CDK Front End deployment was adapted from [this blog](https://kawsaur.
153144
```shell
154145
cd cdk-config-frontend
155146
```
156-
2. Configure your environment variables in `client_app/Dockerfile`. Replace the property values with the values retrieved from the stack outputs/console. You will leave `APP_URI` as a placeholder for now because the URI will be the Cloudfront URL output from your Terraform deployment.
147+
2. Configure your environment variables in `client_app/Dockerfile`. Replace the property values with the values retrieved from the stack outputs/console. You will leave `APP_URI` as a placeholder for now because the URI will be the Cloudfront URL output from your CDK deployment.
157148

158149
```
159150
ENV COGNITO_DOMAIN = "<ApiStack.CognitoDomain>"
@@ -186,58 +177,6 @@ Note: the CDK Front End deployment was adapted from [this blog](https://kawsaur.
186177

187178
</details>
188179

189-
190-
191-
### Deploy with Terraform
192-
<details><summary>Terraform Instructions</summary>
193-
194-
#### Deploy the Backend
195-
1. Open the `/terraform-config-backend` folder
196-
```shell
197-
cd terraform-config-backend
198-
```
199-
2. Run `terraform init`
200-
3. Make sure you have Docker running and deploy the Terraform by running `terraform apply`
201-
4. When prompted with `Do you want to perform these actions?` enter `yes` and wait for the backend to be deployed.
202-
203-
204-
205-
#### Deploy the Front End
206-
207-
208-
209-
1. Open the `/terraform-config-frontend` folder
210-
```shell
211-
cd ../terraform-config-frontend
212-
```
213-
2. Configure your environment variables in `client_app/Dockerfile`. Replace the property values with the values the were outputted from the backend Terraform deployment in your terminal. You will leave `APP_URI` as a placeholder for now because the URI will be the Cloudfront URL output from your Front End Terraform deployment.
214-
```
215-
ENV COGNITO_DOMAIN = "<Output.CognitoDomain>"
216-
ENV REGION = "<Output.Region>"
217-
ENV USER_POOL_ID = "<Output.UserPoolId>"
218-
ENV CLIENT_ID = "<Output.ClientId>"
219-
ENV CLIENT_SECRET = "<COGNITO_CLIENT_SECRET>"
220-
ENV IDENTITY_POOL_ID = "<Output.IdentityPoolId>"
221-
ENV AUTHENTICATED_ROLE_ARN = "<Output.AuthenticatedRoleArn>"
222-
ENV GRAPHQL_ENDPOINT = "<Output.GraphQLEndpoint>"
223-
ENV S3_INPUT_BUCKET = "<Output.InputsAssetsBucket>"
224-
ENV S3_PROCESSED_BUCKET = "<Output.ProcessedAssetsBucket>"
225-
ENV CLIENT_NAME = "<Output.ClientName>"
226-
```
227-
228-
Note: The ```COGNITO_CLIENT_SECRET``` is a secret value that can be retrieved from the AWS Console. Go to the [Amazon Cognito page](https://console.aws.amazon.com/cognito/home) in the AWS console, then select the created user pool. Under App integration, select the corresponding app client. This will navigate you to a new page where the secret can be unhidden, and you will want to copy the value of the App client secret.
229-
230-
231-
3. Run `terraform init`
232-
4. Run `terraform import aws_cognito_user_pool_client.update_client {user-pool-id}/{client-id}` and make sure to update the `user-pool-id` and `client-id` values. In the `terraform.tfvars` folder, add the values for the `user_pool_id`, `client_name`, `client_id`, and `region`.
233-
5. Run `terraform import aws_cognito_identity_pool.update_pool {identity-pool-id}`.
234-
5. Deploy the Terraform by running `terraform apply`
235-
6. Now that you have the CloudFront URL, go back to your `client_app/Dockerfile` and paste in the value of your Cloudfront URL like `https://XXXXXXXXXXXXXX.cloudfront.net/` for your APP_URI. Save the Dockerfile and run `terraform apply` again.
236-
7. Once your changes have been applied, open your browser to the outputted URL. It may take a few moments for the webapp to become available.
237-
</details>
238-
239-
240-
241180
### Deploy the Front End Locally
242181

243182
<details>
@@ -402,12 +341,6 @@ First make sure to remove all data from the Amazon Simple Storage Service (Amazo
402341
$ cdk destroy --all
403342
```
404343
405-
Or if you deployed with Terraform:
406-
407-
```shell
408-
$ terraform destroy
409-
```
410-
411344
Then in the AWS Console delete the S3 buckets.
412345
413346
## Deployment Options

samples/document_explorer/terraform-config-backend/main.tf

Lines changed: 0 additions & 7 deletions
This file was deleted.

samples/document_explorer/terraform-config-backend/outputs.tf

Lines changed: 0 additions & 54 deletions
This file was deleted.

samples/document_explorer/terraform-config-frontend/.checkov.yml

Lines changed: 0 additions & 102 deletions
This file was deleted.

samples/document_explorer/terraform-config-frontend/main.tf

Lines changed: 0 additions & 36 deletions
This file was deleted.

samples/document_explorer/terraform-config-frontend/outputs.tf

Lines changed: 0 additions & 13 deletions
This file was deleted.

samples/document_explorer/terraform-config-frontend/terraform.tfvars

Lines changed: 0 additions & 4 deletions
This file was deleted.

samples/document_explorer/terraform-config-frontend/variables.tf

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)