Getting started with a MySQL database data source (console)
You can use the Amazon Kendra console to get started using a MySQL database as a data source. When you use the console you specify the connection information you need to index the contents of a MySQL database. For more information, see Using a database data source.
You first need to create a MySQL database, then you can create a data source for the database.
Use the following procedure to create a basic MySQL database. The procedure assumes that you have already created an index following step 1 of Getting started with the Amazon Kendra console.
To create a MySQL database
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
. -
From the navigation pane, choose Subnet groups and then choose Create DB Subnet Group.
-
Name the group and choose your Virtual Private Cloud (VPC). For more information on configuring a VPC, see Configuring Amazon Kendra to use a VPC.
-
Add your VPC's private subnets. Your private subnets are the ones that are not connected to your NAT. Choose Create.
-
From the navigation pane, choose Databases and then choose Create database.
-
Use the following parameters to create the database. Leave all of the other parameters at their defaults.
-
Engine options—MySQL
-
Templates—Free tier
-
Credential Settings—Enter and confirm a password
-
Under Connectivity, choose Additional connectivity configuration. Make the following choices.
-
Subnet group—Choose the subnet group that you created in step 4.
-
VPC security group—Choose the group that contains both inbound and outbound rules that you created in your VPC. For example,
DataSourceSecurityGroup
. For more information on configuring a VPC, see Configuring Amazon Kendra to use a VPC.
-
-
Under Additional configuration, set the Initial database name to
content
.
-
-
Choose Create database.
-
From the list of databases, choose your new database. Make a note of the database endpoint.
-
After you create your database, you must create a table to hold your documents. Creating a table is outside the scope of these instructions. When you create your table, note the following:
-
Database name—
content
-
Table name—
documents
-
Columns—
ID
,Title
,Body
, andLastUpdate
. You can include additional columns if you want.
-
Now that you have created your MySQL database, you can create a data source for the database.
To create a MySQL data source
-
Sign in to the AWS Management Console and open the Amazon Kendra console at https://console.aws.amazon.com/kendra/home
. -
From the navigation pane, choose Indexes and then choose your index.
-
Choose Add data sources and then choose Amazon RDS.
-
Type a name and description for the data source and then choose Next.
-
Choose MySQL.
-
Under Connection access, enter the following information:
-
Endpoint—The endpoint of the database that you created earlier.
-
Port—The port number for the database. For MySQL, the default is 3306.
-
Type of authentication—Choose New.
-
New secret container name—A name for the Secrets Manager container for the database credentials.
-
Username—The name of a user with administrative access to the database.
-
Password—The password for the user, and then choose Save authentication.
-
Database name—
content
. -
Table name—
documents
. -
IAM role—Choose Create a new role, and then type a name for the role.
-
-
In Column configuration enter the following:
-
Document ID column name—
ID
-
Document title column name—
Title
-
Document data column name—
Body
-
-
In Column change detection enter the following:
-
Change detecting columns—
LastUpdate
-
-
In Configure VPC & security group provide the following:
-
In Virtual Private Cloud (VPC), choose your VPC.
-
In Subnets, choose the private subnets that you created in your VPC.
-
In VPC security groups, choose the security group that contains both inbound and outbound rules that you created in your VPC for MySQL databases. For example,
DataSourceSecurityGroup
.
-
-
In Set sync run schedule, choose Run on demand and then choose Next.
-
In Data source field mapping, choose Next.
-
Review the configuration of your data source to make sure that it is correct. When you're satisfied that everything is correct, choose Create.