<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: joahna</title>
    <description>The latest articles on DEV Community by joahna (@heyjoahna).</description>
    <link>https://dev.to/heyjoahna</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F793571%2F4b21891b-5f2e-4318-b510-481fd78d9c1d.png</url>
      <title>DEV Community: joahna</title>
      <link>https://dev.to/heyjoahna</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/heyjoahna"/>
    <language>en</language>
    <item>
      <title>Securely Connect to EC2 Instances Using Systems Manager (SSM)</title>
      <dc:creator>joahna</dc:creator>
      <pubDate>Mon, 24 Jan 2022 10:18:33 +0000</pubDate>
      <link>https://dev.to/heyjoahna/securely-connect-to-ec2-instances-using-systems-manager-ssm-266e</link>
      <guid>https://dev.to/heyjoahna/securely-connect-to-ec2-instances-using-systems-manager-ssm-266e</guid>
      <description>&lt;p&gt;AWS Systems Manager (formerly known as SSM) is an AWS service that you can use to view and control your infrastructure on AWS. With AWS Systems Manager, you can perform routine operations, proactively act on events and address security issues on multiple instances at the same time.&lt;/p&gt;

&lt;p&gt;Usually, when we connect to EC2 instances using our local machines, we need to grant SSH (port 22) or RDP (port 3389) permissions from our IP address and we also need to provide the key pair.&lt;/p&gt;

&lt;p&gt;In this post, I will share the steps on how you can securely connect to your EC2 instances using AWS Systems Manager, even without SSH permission in your EC2’s security group and not using a key pair.&lt;/p&gt;

&lt;p&gt;For this, you will need to perform the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an IAM Instance Profile&lt;/li&gt;
&lt;li&gt;Create and Launch an Amazon EC2 Instance&lt;/li&gt;
&lt;li&gt;Connect to EC2 using AWS Systems Manager&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Step 1: Create an IAM Instance Profile&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://console.aws.amazon.com/iam"&gt;AWS IAM console&lt;/a&gt;, and then choose &lt;strong&gt;Roles&lt;/strong&gt; from the navigation pane&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Create Role&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;For the type of trusted entity, select &lt;strong&gt;AWS service&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;For the use case, choose &lt;strong&gt;EC2&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Next: Permissions&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;For the policies to attach, search and select &lt;strong&gt;AmazonSSMManagedInstanceCore&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Next: Tags&lt;/strong&gt; and add tags as needed &lt;/li&gt;
&lt;li&gt;Enter a &lt;strong&gt;Role name&lt;/strong&gt; and choose &lt;strong&gt;Create Role&lt;/strong&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9EXrN5y_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vej35kvqtyxxnfhetq5y.png" alt="EC2SSMRole" width="741" height="411"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create and Launch an Amazon EC2 instance&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://console.aws.amazon.com/ec2"&gt;Amazon EC2 console&lt;/a&gt;, and then choose &lt;strong&gt;Launch instances&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select an &lt;strong&gt;Amazon Machine Image (AMI)&lt;/strong&gt;. In this example, I will choose an &lt;strong&gt;Amazon Linux 2 AMI&lt;/strong&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mjicIdC1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h67f6r7wic572qrwnya7.png" alt="EC2AMI" width="880" height="257"&gt;
Note: In order to use AWS Systems Manager, an &lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/prereqs-ssm-agent.html"&gt;SSM Agent&lt;/a&gt; must be installed on the instance. By default, SSM Agent is preinstalled on instances created from some AMIs, including Amazon Linux 2.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose an &lt;strong&gt;instance type&lt;/strong&gt;. For this I will choose &lt;strong&gt;t2.micro&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--daD7Uz0R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n4cohkxzyzply2q8x8qx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--daD7Uz0R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n4cohkxzyzply2q8x8qx.png" alt="EC2InstanceType" width="880" height="350"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Next: Configure Instance Details&lt;/strong&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure the instance details. Make sure to choose the &lt;strong&gt;IAM role&lt;/strong&gt; that you created earlier&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MZlhJvkS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jakylgev0wqg8undpdlj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MZlhJvkS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jakylgev0wqg8undpdlj.png" alt="EC2IamRole" width="880" height="136"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Next: Add Storage&lt;/strong&gt; and modify storage as needed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Next: Add Tags&lt;/strong&gt; and add tags as needed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Next: Configure Security Group&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Create a new security group&lt;/strong&gt; and &lt;strong&gt;remove&lt;/strong&gt; the default SSH inbound rule&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nPWbdD4L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0thws6a8si325rgla6hu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nPWbdD4L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0thws6a8si325rgla6hu.png" alt="EC2SG" width="880" height="355"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Review and Launch&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Launch&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the key pair window, select &lt;strong&gt;Proceed without a key pair&lt;/strong&gt; and check the acknowledgement&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--376vn9ez--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ci73veplz6pr7jjbev5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--376vn9ez--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ci73veplz6pr7jjbev5e.png" alt="EC2KP" width="647" height="363"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Launch Instances&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to the launched instance and wait until the Instance state is &lt;strong&gt;Running&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--msff1wa1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uk9dyrps86dngx32pi54.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--msff1wa1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uk9dyrps86dngx32pi54.png" alt="EC2State" width="880" height="76"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Connect to EC2 using AWS Systems Manager&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option A – EC2 Console&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;In the &lt;a href="https://console.aws.amazon.com/ec2"&gt;Amazon EC2 console&lt;/a&gt;, select the instance and then click on &lt;strong&gt;Actions&lt;/strong&gt; and choose &lt;strong&gt;Connect&lt;/strong&gt; from the dropdown&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zLFl3MZU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7l4jkbs3157pv5n1cd7j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zLFl3MZU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7l4jkbs3157pv5n1cd7j.png" alt="EC2Actions" width="880" height="144"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;strong&gt;Session Manager&lt;/strong&gt; tab and choose &lt;strong&gt;Connect&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6cyZyE6z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4xha87idtvvgxkasvqi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6cyZyE6z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4xha87idtvvgxkasvqi.png" alt="EC2Connect" width="753" height="426"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You are now connected to your EC2 instance using Systems Manager&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fn9tLDLg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjhvcr2tw5m47v4mjaio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fn9tLDLg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjhvcr2tw5m47v4mjaio.png" alt="EC2SSMConnected" width="880" height="116"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Option B – Systems Manager Console&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://console.aws.amazon.com/systems-manager"&gt;AWS Systems Manager console&lt;/a&gt;, and then choose &lt;strong&gt;Session Manager&lt;/strong&gt; under &lt;strong&gt;Node Management&lt;/strong&gt; from the navigation pane&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Start Session&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select your instance from the &lt;strong&gt;Target instances&lt;/strong&gt; list and then choose &lt;strong&gt;Start Session&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WQRWB6l_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7odl81i9pyqazer9bkjp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WQRWB6l_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7odl81i9pyqazer9bkjp.png" alt="SSMStartSession" width="880" height="412"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You are now connected to your EC2 instance using Systems Manager&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wcq1nU5W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bw84n7exmzff5tht0hm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wcq1nU5W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bw84n7exmzff5tht0hm1.png" alt="SSMConnected" width="880" height="115"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>ssm</category>
      <category>security</category>
    </item>
    <item>
      <title>Monitor for Launched EC2 Instances Not Within Free Tier and Receive Customized Email Notifications</title>
      <dc:creator>joahna</dc:creator>
      <pubDate>Mon, 24 Jan 2022 07:50:22 +0000</pubDate>
      <link>https://dev.to/heyjoahna/monitor-for-launched-ec2-instances-not-within-free-tier-and-receive-customized-email-notifications-1i5k</link>
      <guid>https://dev.to/heyjoahna/monitor-for-launched-ec2-instances-not-within-free-tier-and-receive-customized-email-notifications-1i5k</guid>
      <description>&lt;p&gt;AWS offers a &lt;a href="https://aws.amazon.com/free/"&gt;Free Tier&lt;/a&gt; to provide new users the ability to explore and try out AWS services free of charge up to specified limits for each service.&lt;/p&gt;

&lt;p&gt;Amazon EC2 is one of the services available to use in the AWS Free Tier, which includes up to 750 hours of Linux and Windows t2.micro instances, (t3.micro for the regions in which t2.micro is unavailable) each month for one year for new AWS customers. This is extremely helpful to those who are just getting started with AWS.&lt;/p&gt;

&lt;p&gt;In this post, I will share how to monitor EC2 instances launched that is not within the free tier (t2.micro) and receive customized notifications in your email.&lt;/p&gt;

&lt;p&gt;Hopefully, this will help you avoid unnecessary costs in your account, especially when you are just starting to learn AWS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following diagram illustrates the solution architecture:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WI6f9XaW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ek9umwej0qakue3sezbr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WI6f9XaW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ek9umwej0qakue3sezbr.png" alt="SolutionArchitecture" width="770" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this, you will perform the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setup Amazon SNS&lt;/li&gt;
&lt;li&gt;Create an Amazon EventBridge Rule&lt;/li&gt;
&lt;li&gt;Test the Solution&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You should have the following prerequisites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CloudTrail logging &lt;strong&gt;turned on&lt;/strong&gt; for your AWS account. This is needed to be able to receive AWS API action events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Setup Amazon SNS&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the &lt;a href="https://console.aws.amazon.com/sns"&gt;Amazon SNS console&lt;/a&gt;, and then choose &lt;strong&gt;Topics&lt;/strong&gt; from the navigation pane &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;strong&gt;Create topic&lt;/strong&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;strong&gt;Details&lt;/strong&gt; section, use the following details:&lt;br&gt;
&lt;strong&gt;Type&lt;/strong&gt;: Standard&lt;br&gt;
&lt;strong&gt;Name&lt;/strong&gt;: Enter a name for your topic &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gv4cZ7Lj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d9m75gzqk2qktnt0iccx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gv4cZ7Lj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d9m75gzqk2qktnt0iccx.png" alt="SNS-Details" width="629" height="319"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;strong&gt;Create topic&lt;/strong&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the &lt;strong&gt;Subscriptions&lt;/strong&gt; tab of the newly created topic, choose &lt;strong&gt;Create subscription&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;strong&gt;Details&lt;/strong&gt; section of &lt;strong&gt;Create subscription&lt;/strong&gt; page, use the following details:&lt;br&gt;
&lt;strong&gt;Protocol&lt;/strong&gt;: Email&lt;br&gt;
&lt;strong&gt;Endpoint&lt;/strong&gt;: Enter the email address where you want to receive the notifications &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;strong&gt;Create subscription&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After your subscription is created, a subscription confirmation email is sent to the address you entered. Click on the &lt;strong&gt;Confirm subscription&lt;/strong&gt; link in the email&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create an Amazon EventBridge Rule&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://console.aws.amazon.com/events"&gt;Amazon EventBridge console&lt;/a&gt;, and then choose &lt;strong&gt;Rules&lt;/strong&gt; from the navigation pane&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Create rule&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Enter a &lt;strong&gt;Name&lt;/strong&gt; for your rule&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Define pattern&lt;/strong&gt; section, select &lt;strong&gt;Event pattern&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Event matching pattern&lt;/strong&gt;, choose &lt;strong&gt;Custom pattern&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In &lt;strong&gt;Event pattern&lt;/strong&gt; text box, enter the following:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
"source": ["aws.ec2"],
"detail-type": ["AWS API Call via CloudTrail"],
"detail": {
"eventSource": ["ec2.amazonaws.com"],
"eventName": ["RunInstances"],
"requestParameters": {
  "instanceType": [{
    "anything-but": "t2.micro"
  }]
}
}
}
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on &lt;strong&gt;Save&lt;/strong&gt; &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4d5apU8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3c8ou69s7bodznovei55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4d5apU8o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3c8ou69s7bodznovei55.png" alt="EventBridgePattern" width="559" height="409"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;strong&gt;Select targets&lt;/strong&gt; section, choose &lt;strong&gt;SNS topic&lt;/strong&gt; from the &lt;strong&gt;Target&lt;/strong&gt; dropdown list&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For &lt;strong&gt;Topic&lt;/strong&gt;, choose the &lt;strong&gt;topic name&lt;/strong&gt; that you created earlier&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Expand &lt;strong&gt;Configure input&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Input Transformer&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;For &lt;strong&gt;Input Path&lt;/strong&gt; text box, enter the following:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{"account":"$.account","eventid":"$.detail.eventID","eventsource":"$.source","instance-type":"$.detail.requestParameters.instanceType","region":"$.region","time":"$.time","user":"$.detail.userIdentity.userName"}
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;For &lt;strong&gt;Input Template&lt;/strong&gt; text box, enter the following:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"An EC2 instance with a non-t2.micro instance type was launched with the following details:"
"Instance Type: &amp;lt;instance-type&amp;gt;"
"Event Time: &amp;lt;time&amp;gt; (UTC)"
"AWS Account: &amp;lt;account&amp;gt;"
"AWS Region: &amp;lt;region&amp;gt;"
"User: &amp;lt;user&amp;gt;"
"Event Source: &amp;lt;eventsource&amp;gt;"
"Event ID: &amp;lt;eventid&amp;gt;"
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on &lt;strong&gt;Create&lt;/strong&gt; &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Test the Solution&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://console.aws.amazon.com/ec2"&gt;Amazon EC2 console&lt;/a&gt;, and then choose &lt;strong&gt;Launch instances&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select an &lt;strong&gt;Amazon Machine Image (AMI)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Instance Type&lt;/strong&gt;, choose &lt;strong&gt;t2.small&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Review and Launch&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Launch&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select a &lt;strong&gt;key pair&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Launch Instances&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;After a few seconds, you should receive an email about the created EC2:
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sf8_waZk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w2pd1ulhtfnuce5wmcf2.png" alt="EmailNotification" width="478" height="239"&gt;
&lt;em&gt;Please don’t forget to &lt;strong&gt;terminate&lt;/strong&gt; the EC2 instance after testing is completed.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Congratulations!&lt;/strong&gt; You are now able to monitor your EC2 instances with non-free tier instance types and receive a customized email notification about it as well. &lt;/p&gt;

</description>
      <category>aws</category>
      <category>sns</category>
      <category>cloudwatch</category>
      <category>eventbridge</category>
    </item>
    <item>
      <title>Create a Unique S3 Bucket Name Using CloudFormation</title>
      <dc:creator>joahna</dc:creator>
      <pubDate>Sat, 22 Jan 2022 20:29:34 +0000</pubDate>
      <link>https://dev.to/heyjoahna/create-a-unique-s3-bucket-name-using-cloudformation-401d</link>
      <guid>https://dev.to/heyjoahna/create-a-unique-s3-bucket-name-using-cloudformation-401d</guid>
      <description>&lt;p&gt;An Amazon S3 bucket name is globally unique, and the namespace is shared by all AWS accounts. This means that once you create an S3 bucket named “&lt;strong&gt;my-test-bucket&lt;/strong&gt;”, you or anyone else cannot create a bucket with the same name even in any other AWS regions or accounts until you delete that bucket.&lt;/p&gt;

&lt;p&gt;This is particularly challenging when you are creating S3 buckets using CloudFormation and you want to reuse the template multiple times (e.g. when you are deploying your application in different AWS accounts).&lt;/p&gt;

&lt;p&gt;To help with bucket naming, here is a template to create an S3 bucket with a unique name using CloudFormation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Parameters:
  BucketPrefix:
    Description: Value that will be prefixed to the bucket name

Resources:
  S3Bucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Join 
        - '-'
        - - !Ref BucketPrefix
          - !Ref AWS::AccountId
          - !Ref AWS::Region
          - 'bucket'
          - !Select 
            - 0
            - !Split 
              - '-'
              - !Select 
                - 2
                - !Split 
                  - /
                  - !Ref AWS::StackId

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this template, we used &lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html"&gt;CloudFormation pseudo parameters&lt;/a&gt; &lt;strong&gt;AWS::AccountId&lt;/strong&gt;, &lt;strong&gt;AWS::Region&lt;/strong&gt; and &lt;strong&gt;AWS::StackId&lt;/strong&gt; to create a unique bucket name. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;AWS::StackId&lt;/strong&gt; helps give your bucket a random name. The &lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html"&gt;CloudFormation intrinsic functions&lt;/a&gt; &lt;strong&gt;Select&lt;/strong&gt; and &lt;strong&gt;Split&lt;/strong&gt; were used to select the last range of the CloudFormation Stack ID.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>s3</category>
      <category>cloudformation</category>
    </item>
    <item>
      <title>Connect to Amazon Aurora Serverless MySQL DB cluster from MySQL Workbench</title>
      <dc:creator>joahna</dc:creator>
      <pubDate>Sat, 22 Jan 2022 09:28:11 +0000</pubDate>
      <link>https://dev.to/heyjoahna/connect-to-amazon-aurora-serverless-mysql-db-cluster-from-mysql-workbench-1ppd</link>
      <guid>https://dev.to/heyjoahna/connect-to-amazon-aurora-serverless-mysql-db-cluster-from-mysql-workbench-1ppd</guid>
      <description>&lt;p&gt;Amazon Aurora Serverless is an on-demand, auto-scaling configuration for Amazon Aurora. It automatically scales compute capacity up or down based on your application's needs.&lt;/p&gt;

&lt;p&gt;An Aurora Serverless DB cluster resides in the private subnet of Amazon VPC. You can’t give an Aurora Serverless DB cluster a public IP address. You can only access it from within a VPC.&lt;/p&gt;

&lt;p&gt;If you want to access your Amazon Aurora Serverless DB cluster from MySQL Workbench, one way to do this is via an SSH tunnel through a bastion host (jump box).&lt;/p&gt;

&lt;p&gt;In this post, I will share the steps for setting up a bastion host using an Amazon EC2 instance. Then use MySQL Workbench to connect to the bastion host via an SSH tunnel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The following diagram illustrates the solution architecture:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BRse9HgO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rgo2gpak4omtryrl8dhn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BRse9HgO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rgo2gpak4omtryrl8dhn.png" alt="Solution architecture" width="646" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this, you will perform the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setup networking configurations in Amazon VPC&lt;/li&gt;
&lt;li&gt;Create and launch an Amazon EC2 instance&lt;/li&gt;
&lt;li&gt;Configure MySQL Workbench&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You should have the following prerequisites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon Aurora Serverless DB cluster with MySQL-compatible edition&lt;/li&gt;
&lt;li&gt;MySQL Workbench installed in your local machine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Setup networking configurations in Amazon VPC&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://console.aws.amazon.com/vpc"&gt;Amazon VPC console&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;A. Security Group&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a security group for Amazon EC2 within the same VPC where your Amazon Aurora Serverless DB cluster resides and add the following inbound rule:&lt;br&gt;
&lt;strong&gt;Type:&lt;/strong&gt; SSH&lt;br&gt;
&lt;strong&gt;Protocol:&lt;/strong&gt; TCP&lt;br&gt;
&lt;strong&gt;Port Range:&lt;/strong&gt; 22&lt;br&gt;
&lt;strong&gt;Source:&lt;/strong&gt; Enter the IP address of your local machine or choose &lt;strong&gt;My IP&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l4tfMPgh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0avcahz2gtqp1gbtxl0h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l4tfMPgh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0avcahz2gtqp1gbtxl0h.png" alt="SG-EC2-InboundRule" width="880" height="110"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update your DB cluster’s security group and add the following inbound rule:&lt;br&gt;
&lt;strong&gt;Type:&lt;/strong&gt; MySQL/Aurora&lt;br&gt;
&lt;strong&gt;Protocol:&lt;/strong&gt; TCP&lt;br&gt;
&lt;strong&gt;Port Range:&lt;/strong&gt; 3306&lt;br&gt;
&lt;strong&gt;Source:&lt;/strong&gt; Enter the Amazon EC2 security group ID&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--282sxXAs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zte2g847vqldrzlxh5sn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--282sxXAs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zte2g847vqldrzlxh5sn.png" alt="SG-Aurora-InboundRule" width="880" height="112"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;B. Internet Gateway&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an Internet Gateway and attach it to your VPC&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;C. Subnet&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create subnets in the same Available Zone (AZ) as the subnet group of your DB cluster&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;D. Route Table&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a routing table&lt;/li&gt;
&lt;li&gt;Associate the created subnets in the routing table&lt;/li&gt;
&lt;li&gt;Add a route in the routing table that directs internet-bound traffic to the internet gateway&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m5nAfj2c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3oyd5rvdw99yiriqfub.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m5nAfj2c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p3oyd5rvdw99yiriqfub.png" alt="RT-IGW" width="880" height="63"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: If a subnet is associated with a route table that has a route to an internet gateway, it is now a &lt;em&gt;public subnet&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create and launch an Amazon EC2 instance&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://console.aws.amazon.com/ec2"&gt;Amazon EC2 console&lt;/a&gt; and choose &lt;strong&gt;Launch instances&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select an &lt;strong&gt;Amazon Machine Image (AMI)&lt;/strong&gt;. In this example, I will choose an &lt;strong&gt;Amazon Linux 2 AMI&lt;/strong&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4EuGeKiL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ev2ll02cradyz7eb1h4.png" alt="EC2-AMI" width="880" height="257"&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose an &lt;strong&gt;Instance Type&lt;/strong&gt;. For this, I will choose &lt;strong&gt;t2.micro&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p1UVjHmB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odrjuvdgjhqwmeoy46bj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p1UVjHmB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odrjuvdgjhqwmeoy46bj.png" alt="Image description" width="880" height="350"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Next: Configure Instance Details&lt;/strong&gt; and make sure to use the following settings:&lt;br&gt;
&lt;strong&gt;Network:&lt;/strong&gt; Choose the VPC that the Amazon Aurora Serverless DB cluster uses&lt;br&gt;
&lt;strong&gt;Subnet:&lt;/strong&gt; Choose a public subnet (the subnet that has an internet gateway in its routing table)&lt;br&gt;
&lt;strong&gt;Auto-assign Public IP:&lt;/strong&gt; Enable&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8MQy5Fdg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4sr5qloecenz636enhb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8MQy5Fdg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4sr5qloecenz636enhb.png" alt="EC2-InstanceDetails" width="880" height="347"&gt;&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Next: Add Storage&lt;/strong&gt; and modify storage as needed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Next: Add Tags&lt;/strong&gt; and add tags as needed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Next: Configure Security Group&lt;/strong&gt; and select the security group created earlier for EC2&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZPyvpqQp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytb4a8jay57periolcqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZPyvpqQp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ytb4a8jay57periolcqw.png" alt="EC2-SG" width="880" height="297"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Review and Launch&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose &lt;strong&gt;Launch&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new &lt;strong&gt;key pair&lt;/strong&gt; and &lt;strong&gt;download&lt;/strong&gt; it&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A5rlYUEB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n31eyo1ha1e5hiwnhlg1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A5rlYUEB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n31eyo1ha1e5hiwnhlg1.png" alt="EC2-KeyPair" width="436" height="339"&gt;&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After downloading the key pair, click on &lt;strong&gt;Launch Instances&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to the launched instance and wait until it's in &lt;strong&gt;Running&lt;/strong&gt; state. Take note of the &lt;strong&gt;public IP address&lt;/strong&gt; of the instance&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6f0XCOx2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uotvyh39r27bdsayhu1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6f0XCOx2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uotvyh39r27bdsayhu1w.png" alt="EC2-InstanceState" width="880" height="292"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Configure MySQL Workbench&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open MySQL Workbench, and choose the &lt;strong&gt;⊕&lt;/strong&gt; sign beside &lt;strong&gt;MySQL Connections&lt;/strong&gt; to set up a new connection&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H-aQKG5B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwcltjtbp17inae855sn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H-aQKG5B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwcltjtbp17inae855sn.png" alt="MySQL Workbench" width="880" height="541"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;strong&gt;Setup New Connection&lt;/strong&gt;, enter a &lt;strong&gt;name&lt;/strong&gt; for your connection and select &lt;strong&gt;Standard TCP/IP over SSH&lt;/strong&gt; for the &lt;strong&gt;Connection Method&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;strong&gt;Parameters&lt;/strong&gt; section, enter the following settings:&lt;br&gt;
&lt;strong&gt;SSH Hostname:&lt;/strong&gt; Enter the public IP address of your EC2 instance&lt;br&gt;
&lt;strong&gt;SSH Username:&lt;/strong&gt; Enter the username for your EC2 instance. In our example, we will use "&lt;strong&gt;ec2-user&lt;/strong&gt;" (this is the default username for EC2 Linux machines)&lt;br&gt;
&lt;strong&gt;SSH Key File:&lt;/strong&gt; Select the private key (&lt;strong&gt;.pem&lt;/strong&gt; file) that was downloaded when the EC2 instance was created&lt;br&gt;
&lt;strong&gt;MySQL Hostname:&lt;/strong&gt; Enter the Aurora Serverless DB cluster endpoint&lt;br&gt;
&lt;strong&gt;MySQL Server port:&lt;/strong&gt; Enter 3306&lt;br&gt;
&lt;strong&gt;Username:&lt;/strong&gt; Enter the username that you use to connect to your of the Aurora Serverless DB cluster&lt;br&gt;
&lt;strong&gt;Password:&lt;/strong&gt; Enter the user’s password of your Aurora Serverless DB cluster&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lj5GVAug--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ea5d37nztzm1fgipw0s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lj5GVAug--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ea5d37nztzm1fgipw0s.png" alt="MySQL Workbench-Connection" width="880" height="551"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on &lt;strong&gt;Test Connection&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If this is the first time you are connecting to the EC2 host, you will get the following error message:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--stZEeEGb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eqoxia5iynteokefbpt3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--stZEeEGb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eqoxia5iynteokefbpt3.png" alt="Image description" width="426" height="249"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;OK&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the test is &lt;strong&gt;successful&lt;/strong&gt;, choose &lt;strong&gt;OK&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3m5xKs9N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gs1wq3uq2qfm4p3mg07i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3m5xKs9N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gs1wq3uq2qfm4p3mg07i.png" alt="Image description" width="414" height="316"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; If you receive an error when you test the connection, check if you configured the network correctly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;strong&gt;Setup New Connection&lt;/strong&gt;, choose &lt;strong&gt;OK&lt;/strong&gt; again to save the connection&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Congratulations!&lt;/strong&gt; You are now able to connect to your Amazon Aurora Serverless MySQL DB cluster from MySQL Workbench.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>rds</category>
      <category>aurora</category>
      <category>mysql</category>
    </item>
  </channel>
</rss>
