<?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: wim-web</title>
    <description>The latest articles on DEV Community by wim-web (@wimweb).</description>
    <link>https://dev.to/wimweb</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%2F1068509%2F30172262-bfdd-43a1-90cc-fc08d60fdae4.jpeg</url>
      <title>DEV Community: wim-web</title>
      <link>https://dev.to/wimweb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wimweb"/>
    <language>en</language>
    <item>
      <title>Easily connect to RDS using ECS on Fargate</title>
      <dc:creator>wim-web</dc:creator>
      <pubDate>Thu, 20 Apr 2023 13:22:50 +0000</pubDate>
      <link>https://dev.to/wimweb/easily-connect-to-rds-using-ecs-on-fargate-ikd</link>
      <guid>https://dev.to/wimweb/easily-connect-to-rds-using-ecs-on-fargate-ikd</guid>
      <description>&lt;p&gt;Fargate's SSM Agent version has been updated to version 3.1.1732.0 or later, enabling port forwarding to remote hosts.&lt;br&gt;
&lt;a href="https://aws.amazon.com/jp/about-aws/whats-new/2022/05/aws-systems-manager-support-port-forwarding-remote-hosts-using-session-manager/"&gt;https://aws.amazon.com/jp/about-aws/whats-new/2022/05/aws-systems-manager-support-port-forwarding-remote-hosts-using-session-manager/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, it is quite cumbersome to set up the necessary ECS components to connect to RDS using Fargate. You need to create an ECS cluster, service, task definition, the required roles, and enable ECS Exec, among other things.&lt;/p&gt;

&lt;p&gt;To simplify this process, I've created a CLI tool that automatically sets up a Fargate bastion host when specifying the RDS endpoint.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/wim-web/xpx"&gt;https://github.com/wim-web/xpx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can set up the environment for forwarding to the specified host by simply running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xpx tunnel --host hoge.ap-northeast-1.rds.amazonaws.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ovfkzA6l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://github.com/wim-web/xpx/raw/main/img/demo_.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ovfkzA6l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://github.com/wim-web/xpx/raw/main/img/demo_.gif" alt="" width="690" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you terminate the process, the CLI will also clean up the resources created. It's very convenient.&lt;/p&gt;

&lt;p&gt;If you already have a bastion Fargate instance running and are executing &lt;code&gt;aws ssm start-session --target ${target} --document-name AWS-StartPortForwardingSessionToRemoteHost --parameters ${parameters} --region ${REGION}&lt;/code&gt;, you can use this CLI:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/wim-web/tonneeeeel"&gt;https://github.com/wim-web/tonneeeeel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It allows you to interactively select ECS clusters, containers, and more, enabling forwarding and ECS Exec.&lt;/p&gt;

&lt;p&gt;There is a similar CLI called "ecsta," but I created "tonneeeeel" because I wanted to filter interactively like a fuzzy finder. However, with "ecsta," you can achieve the same functionality by specifying options like "filter_command" for tools like peco.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/fujiwara/ecsta"&gt;https://github.com/fujiwara/ecsta&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
