IAMfrom the services panel.
Rolesfrom the left navigation panel and click on
Create role. In the AWS Service group, choose
Redshift. Under Select your use case, choose
Redshift - Customizable, then choose Next: Permissions. On the Attach permissions policies page, choose
Amazon Redshift. Choose the AWS Region where you want to create the cluster, at upper right corner. I have chosen 'Asia Pacific (Mumbai)ap-south-1'. Click on
Create cluster. The Create cluster page appears.
Create cluster. It will take a while to create the cluster. When the cluster is created select the cluster and click on
Actions, under the 'permissions' section click on
Manage IAM roles. when the management screen appears in the 'Available IAM roles' dropbox select the IAM role that you had created earlier then click on
Associate IAM rolethen click on
Actionsbutton again and under 'Manage cluster' select
Manage publicly accessible settings. By default public accessibility is disabled, enable it to access it from the Appsmith application. Once this is done the next step is to insert data into the database.
IAMfrom the 'services' panel. Then choose
Usersfrom the navigation menu. Click on
Attach existing policies directly. For Policy names, choose
AmazonRedshiftReadOnlyAccess. Click on
Next: Tags. Add tags if you want to, it's optional here.
Next: Review. Review the user details and click on
Editorfrom the left navigation panel. click on
Connect to database, add the details asked for and click
Edit inbound rules.
Save rules. Remember to delete the new inbound rules after you have completed your task, for a long term use prefer creating a new security group.
+ NEWbutton on the top right corner.
+sign next to Datasources and scrolling to Databases under the '+ Create New' section. Select
Read/Write. We will mention the host address and port number, if you do not mention a port number by default Appsmith will try to connect to port 5439. The host address can be fetched from the Redshift cluster's 'General information' panel. Copy the
Endpointvalue and paste it in the Host address section of the Appsmith application(you have to trim the database name and port number from the Endpoint address, else you may encounter an error). Fill the database name you want to connect to, in our case it is 'dev'. For Authentication we will provide the username and password of the adminuser of your database in Redshift. you can skip the SSL by selecting
No SSLfrom the 'SSL Mode' dropdown list. Click on
Widgetsoption. It lists down different UI widgets that can be used to build our application's UI. Select the 'Table' widget then drag and drop that on the canvas. Something like this is visible:
book_idof datatype 'integer' and
readof 'boolean' datatype. Now let us convert our table into a list. Drag and drop the list UI widget and add some text widgets for, one for each table column. Now you can include the response for the list similar to the above procedure for table. Now to fetch values for each column we can click on the book id text widget's settings and edit the text field
onCheckChangeand select 'Execute a Query', click on
+ Create new Query.