You can help by commenting or suggesting your edit directly into the transcript. We'll review any changes before posting them. All comments are completely anonymous. For any comments that need a reply, consider emailing training@inductiveautomation.com.
Version:
Supplemental Videos
LESSON
Connecting to an AWS RDS Database
Description
Learn how to connect Cloud Edition to an RDS database in AWS.
Video recorded using: Ignition 8.1
Transcript
(open in window)[00:00] In this lesson, I'll demonstrate how to connect to an AWS RDS Aurora database from Ignition running in an EC2 instance. I already have Ignition installed in an EC2 instance, and it's VPC has already been set up to accept incoming HTTP connections. To see how I set this up, you can refer to the Ignition AMI video. To start, from the RDS dashboard, I'll click Create Database. For my database creation method, I'm gonna choose standard create instead of easy create, and the reason for this is it'll give me the ability to specify more configuration options, such as an initial database name. Next, I'll pick the Aurora engine that's compatible with MySQL, and I'll scroll down. I'm gonna choose the dev/test template. Under settings, I'll need to specify a DB cluster identifier, which is how I'll identify this database in AWS. I'll leave the master username as admin, and I'll specify a master password.
[01:05] Make sure that you don't forget this as you'll need it later. For the instance configuration, I'm gonna leave the default values, since this is just a demonstration, but you can click this dropdown to pick a different database class to suit your needs. The next thing I wanna change is the connectivity settings. I'm gonna click this radio button to connect to an EC2 Compute resource, and then this dropdown appears and I can see my running instances, and I'll select my instance running Ignition. This will cause my database to automatically get added to the Ignition VPC. I'll let it automatically set up a DB subnet group. However, under VPC Security group, I'm gonna choose the security group that was created with my VPC stack. If you click additional configuration here, you can see the default database port and see that it's 3306. And if you want, you could change it here. I'll continue scrolling down toward, it says additional configuration here, and now I can expand it and specify my initial database name. Note that they say Amazon RDS does not create a database if nothing is specified here, but we'll need an initial database to exist to create our connection from Ignition. When I go to create the connection from Ignition, the default database name and the connect URL is gonna be "test".
[02:17] I can easily change that, but I'm just gonna name this database test to simplify the connecting process. Once I've done that, I'm gonna leave everything else as the default value and scroll down to the bottom and click create database. Once my database is up and running, I'm gonna click on the database instance and copy the endpoint. Now I can head over to my gateway webpage config page. I can go down to databases and click connections, and then click create a new database connection. The Aurora DB engine I chose is compatible with MySQL, so I'm gonna choose the MariaDB driver since that's included in the installation and is compatible with MySQL.
[03:07] I'll call this connection Aurora MySQL, and I'm gonna overwrite the "localhost" in the connect URL with the endpoint I just copied from AWS. I left the database port at 3306 and named the initial database test, so I'll leave the rest of the URL alone. The username for my database was admin, so I'll type that in along with the password, and then I can scroll down and create the connection. The connection will go valid, and I'm ready to start storing and retrieving data from my cloud database.