AWS Developer Tools Blog

Seamlessly connect to RDS and Redshift Instances with the AWS Toolkit for JetBrains

The AWS Toolkit for JetBrains is a plugin for JetBrains’s IDEs that makes it easier to develop applications for AWS. Features include debugging Lambda functions locally, browsing S3 buckets, and viewing CloudWatch Logs.

Recently, we announced a new feature to connect to databases instances without leaving your IDE. As of version 1.19 of the Toolkit, you can connect to RDS and Redshift databases with short-lived credentials using either IAM or Secrets Manager. This feature builds upon the database support present in IntelliJ IDEA Ultimate, DataGrip, and other paid JetBrains products to provide an easy to use and secure way to access your databases on AWS. You no longer need to use long-lived database credentials, or copy paste authentication tokens from the AWS CLI: database credentials are generated as they are needed, and never saved to the disk.

Below are the steps for setting up a connection to an RDS Instance:

RDS Setup

Once you have an RDS database set up for IAM authentication (RDS guide to setting up IAM authentication), connecting is simple:

  1. Follow the getting started guide for the AWS Tooklit for JetBrains
  2. Open the AWS Explorer, then select the credential profile and region your database resides in:
  3. Next, open the RDS node and navigate to the database you want to connect to, right click on it, then select “Connect with IAM…”
    Showing action on database node, action reads "Connect with IAM"
  4. This will open the connection menu and auto-fill connection data. Make sure the user and database match the ones you set up earlier. Then, click “Test Connection”
  5. If everything is set up correctly, a green check mark will appear. Press “Apply” or “OK” to save the data source.
  6. Open the Database panel, and press refresh on the new data source. The database tools will connect to the database and introspect the database schema.
    JetBrains database structure window with added database showing schema inspection
  7. Once that finishes, use the database tools as normal. The database connection will use the credentials profile and region to generate temporary credentials whenever they are needed.

Further reading and documentation

You can find the full documentation for how to set up RDS/Redshift using IAM/Secrets Manager is here. If you encounter any issues with this or any other feature, please file an issue on our GitHub repo. The AWS Toolkit for JetBrains is open source and always open to feedback and contributions on GitHub.

– Hunter