DEV Community

Cover image for Join Us on the Journey to the Future of Developers
Bhuvaneswari Subramani for AWS Heroes

Posted on

Join Us on the Journey to the Future of Developers

To get started with using AI-driven development, it’s crucial to have the foundational setup ready. This involves several key components that ensure your development environment is robust and scalable.

You need a reliable infrastructure (powerful, if need arises but not to get started) and the right tools in place.

The instructions here is to help you use Amazon EC2 as your development server and connect remotely via VS-Code from your personal computer. Later install and configure Amazon Q and Anthropic Claude’s Cline as your development partner. Please note that the below instructions talks about using Macbook Pro as your personal computer.

Image description

Why do we need to use EC2 as your development environment instead of personal computer?

  • Development environment is available anytime for you to access from anywhere and any tool.
  • Leverage high-end servers with GPUs as applicable to accelerate your development.
  • Benefit from enhanced collaboration and version control, ensuring seamless teamwork and efficient project management.

Instructions to setup VS-Code connecting to remote EC2

  • Create a Linux EC2 instance with the configuration of your choice in your AWS account and store your keyfile (futuredev.pem) file for connecting from your personal computer.
  • Edit the /Users/<username>/.ssh/config file to add the following section
Host <future-of-developers-ssh>
  HostName <ec2 dns name>.<region>.compute.amazonaws.com
  User ec2-user
  IdentityFile /Users/<username>/<path>/futuredev.pem
Enter fullscreen mode Exit fullscreen mode
  • Ensure you have VS-Code is installed on your personal computer. If you have not installed already, you may follow the instructions here to install and configure VS-Code.
  • Install Remote-SSH Extensions on VS-Code to connect to your EC2 development server

Image description

  • Launch VS-Code, go to the search bar, click Show and Run Commands

Image description

  • A search bar would appear. Go and search for SSH and select Remote-SSH: Connect to Host. This will list all the available host names in /Users//.ssh/config file. Select the host name associated with your EC2 instance launched for your development server. In our example, it is future-of-developers-ssh

Image description

  • You might get a prompt indicating the incompatibility of your EC2 OS version but that can be ignored to start with [Note: From now on, you will see ssh:future-of-developers-ssh at the bottom right corner of the VS-Code IDE indicating that you are connected to your EC2 development server]

Image description

  • Now that you are connect to your EC2 development server and gained access to the root folder, you might get prompt to trust the authors of all files in the parent folder ‘home’. It's your own EC2 development server, hence feel free to choose trust the authors option to proceed further.

Image description

Once your VS-Code is ready and connected to the remote EC2 development server, next step is to have the right tooling in place to continue with the AI-Driven development.

I would like to branch that into two different ways — one with Cline from Anthropic Claude and the other with Amazon Q. Let’s see the instructions to setup and use them un VS-Code.

Instructions to use Amazon Q Developer

  • Go to Extensions in VS-Code, search for Amazon Q and Install

Image description

Image description

For your present AI-Driven development, choose Use for Free and continue.

Image description

Later proceed with AWS Builder ID authentication and you are set to start your software development conversation with Amazon Q

Image description

Instructions to use Anthropic Claude’s Cline

  • Ensure you have access to the Amazon Bedrock model by accepting the terms. In our demos, we will be using Anthropic Claude 3.5 Sonnet v2.0.
  • Warning: You will be billed in the AWS account you connected into for your Amazon Bedrock usage.
  • Go to Extensions in VS-Code, search for Cline and Install

Image description

When you are installing Cline extension, pay attention to the note that this installation is onto the remote SSH: future-of-developers-ssh.

You will find the highlighted Cline symbol on the VS-Code side bar. Click that the settings icon on the top right corner of Cline extension to configure Cline as in the below diagram.

Since you are going to use Amazon Bedrock for the demo,
— Choose AWS Bedrock in the API Provider
— Select the appropriate AWS region (say us-east-1) in this case.
— Leave AWS Access Key, AWS Secret Key and AWS Session Token blank as it will be picked from your .pem file added as a host
— Click Use cross-region inference checkbox
— Choose Anthropic Claude 3.5 Sonnet v2.0 model as in the image
— Pay attention to the model properties — especially max output tokens, input price and output price to be cognizant about the cost coming on your way
— Click Done to move forward

Image description

  • Before you start talking to Cline, check the following options to give green signal for Cline to Auto-approve: Read files and directories, Edit files, Execute safe commands and Use the browser in headless way
  • Leave the Max Requests to default value, 20 and set the execution mode in the bottom right corner to Plan

Image description

Now you are all set to use Cline environment for AI-Driven Development

Start working with Cline..
I asked my first prompt: My intention is to build a simple website for Rajee Subramani Public Charitable Trust. do not generate code yet but ask more questions to understand better.
You will see “No workspace detected. Please open Cline in a workspace to use checkpoints.”

Image description

Image description

To set the workspace, choose the file icon on the top right and click Open Folder. This takes you to /home/ec2-user/ , you may create folder and files as needed. Since the workspace is set, the “No Workspace detected warning…” disappears and you are set to chat with Cline to carry out your tasks.

Image description

The “429 Too many tokens” error occurs when there have been too many requests made to the API in a short period of time. This is a rate limiting mechanism to prevent overuse of the service.

To resolve this:

  1. Wait a few minutes before making new requests Break down your tasks into smaller chunks
  2. Avoid rapid successive requests
  3. The error should resolve itself after a brief waiting period.

You are all set!!

Instructions to setup Cursor with Amazon Bedrock

  • If you have followed the above instructions to setup VS-Code and connect to the remote EC2 development server, then follow the same process for connecting Cursor with EC2 development server.

Cost Saving measures and Clean-up instructions

  • Ensure you have an automated scheduler to keep your EC2 development server On only during your core working hours
  • Terminate the EC2 development server if you no longer need it.

In summary, a robust and scalable development environment is of paramount importance for AI-driven development. By setting up a strong infrastructure, utilizing the right tools and frameworks, managing data effectively, fostering collaboration, and implementing CI/CD pipelines, you can create a solid foundation for successful AI projects.

#FutureofDevelopers #AIDLC

Top comments (0)