Configuring AWS RDS

We have broadly divided the PostgreSQL AWS RDS configuration process into the following steps:

  1. Create the PostgreSQL AWS RDS database
  2. Create a bastion host
  3. Configure the AWS RDS security group
  4. Connect to the AWS RDS database from the bastion host
  5. Create the databases for Digital.ai Deploy
  6. Connect the AWS RDS instance with Digital.ai Deploy

Note: The procedure specifies the important steps to consider while installing your AWS RDS instance.

Create the PostgreSQL AWS RDS database

To create the PostgreSQL AWS RDS database, follow the procedure described in the link below:

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_GettingStarted.CreatingConnecting.PostgreSQL.html#CHAP_GettingStarted.Creating.PostgreSQL

Important

Under Connectivity section:

  1. In the VPC subsection, we recommend that you create AWS RDS instance in the same VPC where AWS EKS cluster is created.

image1

  1. In the Public access subsection, ensure that No is selected to make your AWS RDS instance private.

image1

  1. Select the security groups applicable in your VPC to which AWS EKS belongs.

image

  1. Ensure 5432 is selected as database port.

image1

Create an EC2 instance as a bastion host

Create a bastion host in the public subnet using the same VPC which we have used while creating the RDS instance.

Configure the security group for the AWS RDS instance

Navigate inside the security group settings of your RDS instance and add a new inbound rule with type Custom TCP, port range 5432 and source is private IP of the bastion host as shown in the image below:

image1

Connect to the AWS RDS database from the bastion host

Login to your PostgreSQL instance from the bastion host using the following command:

psql --host=<aws-rds-Endpoint> --port=5432 --username=<master-user-name> -W

image5

Note: Replace the host value with your endpoint of RDS and username with your Master username.

Create the databases for Digital.ai Deploy

To create the databases for Digital.ai Deploy, follow the steps shown below:

CREATE USER <xld-username> WITH
NOSUPERUSER
NOCREATEDB
NOCREATEROLE
ENCRYPTED PASSWORD '<xld-password>';

CREATE DATABASE <xld-database-name>;

ALTER ROLE <xld-username> WITH PASSWORD '<xld-password>';
ALTER DATABASE <xld-database-name> OWNER to <xld-username>;

Connect the AWS RDS instance with Digital.ai Deploy

You must configure the following parameters in the values.yaml file, in order to connect the RDS instance with Digital.ai Deploy:

postgresql:
  install: false
UseExistingDB:
  Enabled: true
  # If you want to use an existing database, set 'postgresql.install' to 'false' and 'UseExistingDB.Enabled' to 'true'.
  # Uncomment the following lines and provide the values.
  XL_DB_URL: "jdbc:postgresql://<aws-rds-Endpoint>:5432/<xld-database-name>"
  XL_DB_USERNAME: <xld-username>
  XL_DB_PASSWORD: <xld-password>

Next Step