forked from ExamProCo/AWS-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Oliver Twist Book | ||
|
||
chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://e-school.kmutt.ac.th/elibrary/Upload/EBook/DSIL_Lib_E1312881157.pdf | ||
|
||
## Create bucket | ||
|
||
aws s3 mb s3://kendra-exp-223 --region us-east-1 | ||
cd split | ||
aws s3 sync . s3://kendra-exp-223 --region us-east-1 | ||
|
||
## Creating our Index | ||
|
||
```sh | ||
aws kendra create-index \ | ||
--edition DEVELOPER_EDITION \ | ||
--name my-index \ | ||
--description "My Index" \ | ||
--region us-east-1 \ | ||
--role-arn arn:aws:iam::982383527471:role/KendraIndexRole | ||
``` | ||
|
||
## Creating our Data Source | ||
|
||
aws kendra create-data-source \ | ||
--index-id 62b0d9f1-b38b-44a6-8152-ff7427fdff08 \ | ||
--name my-data-source \ | ||
--role-arn arn:aws:iam::982383527471:role/KendraDataSourceRole \ | ||
--type S3 \ | ||
--configuration '{"S3Configuration":{"BucketName": "kendra-exp-223"}}' \ | ||
--region us-east-1 | ||
|
||
|
||
|
||
## Sync | ||
|
||
```sh | ||
aws kendra start-data-source-sync-job \ | ||
--id e3ceb99f-8574-4ff7-95c7-2e113c2ffc75 \ | ||
--index-id 62b0d9f1-b38b-44a6-8152-ff7427fdff08 \ | ||
--region us-east-1 | ||
``` | ||
|
||
# Query | ||
|
||
```sh | ||
aws kendra query \ | ||
--index-id 62b0d9f1-b38b-44a6-8152-ff7427fdff08 \ | ||
--query-text "You can talk as you eat, can't you?" \ | ||
--region us-east-1 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"s3:GetObject" | ||
], | ||
"Resource": [ | ||
"arn:aws:s3:::kendra-exp-223/*" | ||
], | ||
"Effect": "Allow" | ||
}, | ||
{ | ||
"Action": [ | ||
"s3:ListBucket" | ||
], | ||
"Resource": [ | ||
"arn:aws:s3:::kendra-exp-223" | ||
], | ||
"Effect": "Allow" | ||
}, | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"kendra:BatchPutDocument", | ||
"kendra:BatchDeleteDocument" | ||
], | ||
"Resource": [ | ||
"arn:aws:kendra:us-east-1:982383527471:index/index-id" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Action": "cloudwatch:PutMetricData", | ||
"Resource": "*", | ||
"Condition": { | ||
"StringEquals": { | ||
"cloudwatch:namespace": "AWS/Kendra" | ||
} | ||
} | ||
}, | ||
{ | ||
"Effect": "Allow", | ||
"Action": "logs:DescribeLogGroups", | ||
"Resource": "*" | ||
}, | ||
{ | ||
"Effect": "Allow", | ||
"Action": "logs:CreateLogGroup", | ||
"Resource": "arn:aws:logs:us-east-1:982383527471:log-group:/aws/kendra/*" | ||
}, | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"logs:DescribeLogStreams", | ||
"logs:CreateLogStream", | ||
"logs:PutLogEvents" | ||
], | ||
"Resource": "arn:aws:logs:us-east-1:982383527471:log-group:/aws/kendra/*:log-stream:*" | ||
} | ||
] | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.