AWS Builder Center
Setting up your dev environment

Setting up your dev environment

Configure your dev environment to build and deploy on AWS from your terminal.

Developer Advocate @ AWS
So you created your AWS account, logged into the console, and now you're wondering what's next.
Setting up your development environment lets you write code, build, and deploy your projects to AWS straight from your terminal. Once it's set up, you can use the same tools for every project after that.

What you're building

By the end of this post, you'll have:
  • The AWS CLI installed and connected to your account
  • An AI coding assistant connected to live AWS documentation
  • Your first app deployed to AWS from the command line

What you will need

  • Your preferred terminal

Step 1: Install the AWS CLI

The  AWS Command Line Interface (CLI)  is how you use AWS from your terminal. Anything you can do in the console (launch servers, create databases, set up APIs) you can do from the command line with the CLI.
It's available for macOS, Linux, and Windows:
macOS:
Bash
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
Linux:
Bash
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
If you need help installing the CLI, here's the  full install guide .
After installing, run  aws --version  to make sure it's there:
Bash
aws --version
You should see something like  aws-cli/2.x.x . As long as it starts with  2 , you're good.

Step 2: Connect to your AWS account

Right now, the CLI is installed but it doesn't know which AWS account to use.   aws login   opens your browser and lets you sign in, the same way you sign in to the console:
Bash
aws login
If you're already signed in, you'll see your account ID and IAM user. Click on it and you're in.
Now let's make sure it actually worked. This command confirms which account and user your terminal is connected to:
Bash
aws sts get-caller-identity
You should see your account ID and your username:
JSON
{
"UserId": "AIDACKCEVSQ6C2EXAMPLE",
"Account": "111122223333",
"Arn": "arn:aws:iam::111122223333:user/admin"
}
Your terminal is now connected to your AWS account. By default, everything you create goes to  us-east-1  (N. Virginia) unless you specify a different region.

Step 3: Install Kiro CLI

The AWS CLI handles talking to AWS, and  Kiro CLI  helps you write the code. It's an AI coding assistant that runs in your terminal, so you describe what you want to build and Kiro helps you build it.
Linux or macOS:
Bash
curl -fsSL https://cli.kiro.dev/install | bash
Windows (Powershell):
Bash
irm 'https://cli.kiro.dev/install.ps1' | iex
If you need help, here's the  full install guide  . 
After installing, Kiro opens your browser to sign in. Once you're authenticated, you're ready to go.

Step 4: Give Kiro access to AWS documentation (optional)

AI models have a training cutoff date. They can give you outdated answers and sound completely sure about it.  MCP (Model Context Protocol)  lets you connect live knowledge sources to Kiro, so it works with current information instead of guessing from what it learned during training months ago.
We'll add the  Agent Toolkit for AWS , which gives Kiro access to up-to-date AWS documentation, best practices, and curated skills for common tasks. AWS releases new features all the time, and you want your tools working with the latest information.
The  AWS MCP Server  runs remotely, so there's nothing to install. Kiro can use it to read the docs without logging in, but the first time it needs to do something in your AWS account, it opens your browser so you can log in.
Add the server to Kiro:
Bash
kiro-cli mcp add --name aws-mcp --url https://aws-mcp.us-east-1.api.aws/mcp
If you hit an authentication error, check the  troubleshooting guide  . 
Kiro can now search AWS docs and use skills, but it won't always do it on its own. This adds  a rules file  to your  global steering  that tells Kiro to always check the docs, look for relevant skills, and build with code instead of clicking around the console when working with AWS. It applies globally, so you only set it up once:
Bash
mkdir -p ~/.kiro/steering
curl -fsSL https://raw.githubusercontent.com/aws/agent-toolkit-for-aws/main/rules/aws-agent-rules.md \
-o ~/.kiro/steering/aws-agent-rules.md

Step 5: Build and deploy with CDK

Infrastructure as Code
When you build on AWS, your app needs more than just code. It needs infrastructure: all the cloud resources your code runs on and connects to, like servers, databases, and permissions. You could set all of that up by clicking through the console, but then there's no record of what you did, and doing it again means clicking through everything again. If something breaks, good luck figuring out which checkbox you missed.
Infrastructure as Code lets you describe what you want in a programming language and deploy it with a single command.  AWS CDK  is one way to do that. You write TypeScript, Python, Java, whatever language you already know, and CDK figures out the permissions and wiring for you.
Let's put everything together. You'll describe what you want, Kiro will write the infrastructure code, you'll deploy it with CDK, and then trigger it from the CLI. The goal is to prove your tools work end-to-end.
We'll create an SNS topic that sends a message to your email. It's a small project, but when that email lands in your inbox, you'll know your entire setup is working.
Start by creating a project folder and initializing a CDK app:
Bash
mkdir my-notifications
cd my-notifications
npx aws-cdk init app --language typescript
Now start Kiro CLI:
Bash
kiro-cli
Ask it to generate the CDK code:
Create an SNS topic that sends email notifications. Subscribe my email address to the topic so I receive a message whenever something is published to it.
Kiro generates the code for you. Review what it wrote and adjust anything that doesn't look right.
Here's an example of what Kiro might generate:
TypeScript
import * as cdk from 'aws-cdk-lib';
import * as sns from 'aws-cdk-lib/aws-sns';
import * as subscriptions from 'aws-cdk-lib/aws-sns-subscriptions';
import { Construct } from 'constructs';

export class MyNotificationsStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

const topic = new sns.Topic(this, 'NotificationTopic', {
displayName: 'My Notifications',
});

topic.addSubscription(
new subscriptions.EmailSubscription('your-email@example.com'),
);

new cdk.CfnOutput(this, 'TopicArn', { value: topic.topicArn });
}
}
A topic and an email subscription. The cool thing is that we didn't write a single line of permissions. CDK handles all of that for you.
First, a one-time setup to prepare your account for CDK deployments (you only run this once):
Bash
npx aws-cdk bootstrap
Now deploy:
Bash
npx aws-cdk deploy
CDK shows you what it's about to create. Review it and type  y  to confirm. It takes about a minute. When it's done, you'll see a  TopicArn  in the output. That's your notification topic's address on AWS.
Check your email. AWS sends a confirmation message to the address you used in the code. Click the link to confirm your subscription.

Step 6: Test it with the CLI

Now let's bring it full circle. You set up the CLI at the beginning of this post, so let's use it. Copy the  TopicArn  from the deploy output and run:
Bash
aws sns publish \
--topic-arn "arn:aws:sns:us-east-1:111122223333:MyNotificationsStack-NotificationTopic-EXAMPLE" \
--subject "Hello from AWS" \
--message "I deployed this from my terminal using Kiro and CDK."
Check your inbox. That email is proof that your entire setup works: you described what you wanted, Kiro wrote the infrastructure code, CDK deployed it to AWS, and you triggered it from the command line.
What you just built is a small piece of what could be a much larger event-driven application. In a real system, SNS sits in the middle: services publish events to a topic, and other services subscribe and react. A user signs up, that publishes to a topic. One subscriber sends a welcome email, another triggers a function to set up their account, another pushes a message to a queue for analytics. Right now you have one topic and one subscriber (your email), but the pattern is the same one used in production.

Clean up

Just like you deployed with one command, you can tear it all down with one command:
Bash
npx aws-cdk destroy
Type  y  to confirm. The topic, the subscription, gone. If you ever want it back, just run  cdk deploy  again.

What you just set up

  • AWS CLI: talk to AWS from your terminal
  • Kiro CLI: an AI coding assistant that helps you build, connected to up-to-date AWS docs
  • CDK: describe your infrastructure in code and deploy it with a single command
This is your dev environment. From here, you can build anything on AWS directly from your command line.

What's next

Now that your dev environment is set up, you can start building. In the next post, we'll use these same tools to  ship a portfolio website .


This project is part of the AWS Free Tier onboarding series. Everything you built here runs within the  Free Tier  — no surprise bills, just learning.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article