<?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: Aleksandra  Ljuboje</title>
    <description>The latest articles on DEV Community by Aleksandra  Ljuboje (@aleksandralj).</description>
    <link>https://dev.to/aleksandralj</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%2F1199912%2Fece45668-9f56-497f-ac41-032250f4b470.jpg</url>
      <title>DEV Community: Aleksandra  Ljuboje</title>
      <link>https://dev.to/aleksandralj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aleksandralj"/>
    <language>en</language>
    <item>
      <title>Practical ECS Configurations in Terraform that make your Life easier</title>
      <dc:creator>Aleksandra  Ljuboje</dc:creator>
      <pubDate>Wed, 28 Jan 2026 08:59:53 +0000</pubDate>
      <link>https://dev.to/aws-builders/practical-ecs-configurations-in-terraform-that-make-your-life-easier-3dog</link>
      <guid>https://dev.to/aws-builders/practical-ecs-configurations-in-terraform-that-make-your-life-easier-3dog</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Getting started with ECS as a DevOps engineer is a learning journey in itself - a bit like assembling a complex puzzle—every tiny piece needs to click into place for it to run smoothly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Implementing it in Terraform as Infrastructure as Code adds another layer to the story.&lt;/p&gt;

&lt;p&gt;Here are a few key considerations that can save your production deployments and help make your solution more robust and reliable&lt;/p&gt;




&lt;h3&gt;
  
  
  Propagating Tags Automatically (and Correctly)
&lt;/h3&gt;

&lt;p&gt;Tagging is essential for cost allocation, ownership, and governance, but some ECS resources don’t automatically inherit tags unless you explicitly configure them.&lt;/p&gt;

&lt;p&gt;Why is that? When writing Infrastructure as Code, you typically define the &lt;strong&gt;Task Definition&lt;/strong&gt; and the &lt;strong&gt;Service&lt;/strong&gt;. The actual &lt;strong&gt;Tasks&lt;/strong&gt; that run are deployed based on those definitions and inherit most of their configuration from them, but not tags. They appear in your account only when the infrastructure is deployed, which means you need a way to ensure consistent tagging across these ephemeral resources..&lt;/p&gt;

&lt;p&gt;To propagate tags correctly in your ECS Service Terraform code, add these two lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;enable_ecs_managed_tags = true
propagate_tags          = "SERVICE"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Why this matters
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Ensures tasks inherit tags from the ECS service – no more untagged tasks floating around.&lt;/li&gt;
&lt;li&gt;Makes cost allocation and resource ownership clear – essential for reporting and chargebacks.&lt;/li&gt;
&lt;li&gt;Reduces the risk of “untagged” resources appearing in billing or compliance reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is especially important in larger organizations where tagging policies are enforced.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Reference: &lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Preventing ECS from Lowering Desired Count in Production
&lt;/h3&gt;

&lt;p&gt;In production environments, Terraform shouldn’t override operational realities like autoscaling adjustments or manual scaling during incidents. Without proper handling, a &lt;code&gt;terraform apply&lt;/code&gt; could unintentionally scale down your ECS service, causing downtime or degraded performance.&lt;/p&gt;

&lt;p&gt;You can prevent this by telling Terraform to ignore changes to the &lt;code&gt;desired_count&lt;/code&gt; in your ECS Service resource:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lifecycle {
  ignore_changes = [desired_count]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Why this matters
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Prevents Terraform from scaling your service down unintentionally&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Avoids surprises during terraform apply&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Works nicely with Application Auto Scaling or manual scaling during incidents&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Always Create a Custom CloudWatch Log Group
&lt;/h3&gt;

&lt;p&gt;ECS can automatically create CloudWatch log groups for your tasks, but doing so limits your control over important settings like log retention, naming conventions, and cost management. Defining log groups explicitly in Terraform is a best practice that ensures consistency and predictability.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "aws_cloudwatch_log_group" "&amp;lt;project_name&amp;gt;_ecs_log_group" {
  name = "/ecs/&amp;lt;log group name&amp;gt;"
  retention_in_days = 1 # current minimum 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Why this matters
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Controls log retention and avoids infinite log storage&lt;/li&gt;
&lt;li&gt;Helps with cost optimization&lt;/li&gt;
&lt;li&gt;Makes log group naming consistent and predictable&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Enable ECS Exec for easier Debugging
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;ECS Exec&lt;/strong&gt; is a powerful feature that lets you connect directly into a running container from the AWS Console or CLI — no SSH or bastion host required. This is incredibly useful for troubleshooting production issues safely and quickly.&lt;/p&gt;

&lt;p&gt;To enable ECS Exec in your service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;enable_execute_command = true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You also need the proper IAM permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;resource "aws_iam_policy" "&amp;lt;policy name&amp;gt;" {
  name        = &amp;lt;policy name&amp;gt;
  description = "Give SSM permissions to use ECS exec"

  policy = jsonencode({
    "Version" : "2012-10-17",
    "Statement" : [
      {
        "Effect" : "Allow",
        "Action" : [
          "ssmmessages:CreateControlChannel",
          "ssmmessages:CreateDataChannel",
          "ssmmessages:OpenControlChannel",
          "ssmmessages:OpenDataChannel"
        ],
        "Resource" : "*"
      }
    ]
  })
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  How it works
&lt;/h4&gt;

&lt;p&gt;To troubleshoot inside the container click on the running task and scroll until &lt;strong&gt;Containers&lt;/strong&gt; section.&lt;/p&gt;

&lt;p&gt;Choose the application container and on the upper left choose the &lt;strong&gt;Connect&lt;/strong&gt; as show in the image below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ip6g5udbm4m3odhkaai.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ip6g5udbm4m3odhkaai.png" alt=" " width="800" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this, the terminal in Console will open up, and suggest to paste the command like shown in the example below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ aws ecs execute-command --cluster &amp;lt;cluster_name&amp;gt;
--task &amp;lt;placeholder&amp;gt;
--container &amp;lt;container_name&amp;gt; 
--interactive --command '/bin/sh'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check the &lt;code&gt;healthCheck&lt;/code&gt; configuration navigate to:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Task Definitions&lt;/code&gt; → choose your &lt;code&gt;Task Definition&lt;/code&gt; → Choose a revision → Scroll down to &lt;code&gt;Containers&lt;/code&gt; section → &lt;code&gt;Monitoring and logging&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Reference: &lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Why this matters
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Secure access without opening SSH&lt;/li&gt;
&lt;li&gt;Extremely helpful for production debugging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you use ECS Exec, it’s hard to go back.&lt;/p&gt;




&lt;h3&gt;
  
  
  Allow ECS to Temporarily Exceed the Task Limit During Deployments
&lt;/h3&gt;

&lt;p&gt;By default, ECS can be very conservative during deployments. You can speed up rollouts by allowing temporary overprovisioning.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;deployment_maximum_percent         = x
deployment_minimum_healthy_percent = y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  How ECS Deployment Percentages Work
&lt;/h4&gt;

&lt;p&gt;When ECS deploys a new version of your service, it doesn’t replace all tasks at once. Instead, it gradually shifts traffic from the old tasks to the new ones to avoid downtime. Two key settings control this behaviour &lt;code&gt;deployment_maximum_percent&lt;/code&gt; and &lt;br&gt;
&lt;code&gt;deployment_minimum_healthy_percent&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;em&gt;&lt;strong&gt;deployment_maximum_percent&lt;/strong&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This defines the maximum number of tasks ECS can run during a deployment, expressed as a percentage of the desired task count.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;: if your service normally runs 4 tasks and deployment_maximum_percent = 200, ECS can temporarily run up to 8 tasks during the rollout.&lt;/p&gt;

&lt;p&gt;This means, ECS can start new tasks before stopping old ones, ensuring that your service remains available and deployment is faster.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;strong&gt;deployment_minimum_healthy_percent&lt;/strong&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This defines the minimum number of tasks that must remain healthy during the deployment, also as a percentage of the desired task count.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;: with 4 desired tasks and deployment_minimum_healthy_percent = 50, ECS ensures at least 2 tasks stay healthy at any time.&lt;/p&gt;

&lt;p&gt;This means, even if new tasks fail to start or are unhealthy, ECS keeps enough old tasks running so your application continues serving traffic.&lt;/p&gt;
&lt;h4&gt;
  
  
  Why this matters
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Enables zero-downtime deployments&lt;/li&gt;
&lt;li&gt;Allows ECS to start new tasks before stopping old ones&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is especially important for production workloads.&lt;/p&gt;


&lt;h3&gt;
  
  
  Add Container-Level Health Checks
&lt;/h3&gt;

&lt;p&gt;ECS &lt;strong&gt;health checks&lt;/strong&gt; go beyond simply verifying that a container is running — they allow the scheduler to understand whether your application is actually healthy and ready to serve traffic.&lt;/p&gt;

&lt;p&gt;By configuring a &lt;code&gt;health check&lt;/code&gt; in your task definition, ECS can automatically replace unhealthy containers, improving reliability and reducing downtime.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;healthCheck = {
  command     = ["CMD-SHELL", "curl -f http://localhost/status || exit 1"]
  interval    = 10
  timeout     = 5
  retries     = 3
  startPeriod = 10
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  How it works
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;command&lt;/code&gt; – what ECS runs to check the container’s health. Here, it calls a local endpoint /status. If the command fails, the container is marked unhealthy.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;interval&lt;/code&gt; – how often the health check runs (seconds).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;timeout&lt;/code&gt; – how long to wait for a response before considering the check failed (seconds).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;retries&lt;/code&gt; – number of consecutive failures before marking the container unhealthy.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;startPeriod&lt;/code&gt; – initial grace period for a container to start before health checks begin (seconds).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why this matters
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;ECS can automatically replace unhealthy containers&lt;/li&gt;
&lt;li&gt;Improves reliability and resilience&lt;/li&gt;
&lt;li&gt;Makes deployments safer by detecting bad releases early&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Always implement application-level health checks rather than just process-level checks. A container might be running but the app inside could still be failing—health checks catch this early.&lt;/p&gt;




&lt;h2&gt;
  
  
  And final
&lt;/h2&gt;

&lt;p&gt;Individually, these configurations may seem minor—but together they make a big difference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improve operational stability&lt;/li&gt;
&lt;li&gt;Reduce deployment risk&lt;/li&gt;
&lt;li&gt;Increase observability and debugging ability&lt;/li&gt;
&lt;li&gt;Align ECS services with production best practices&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re using ECS with Terraform and don’t have these yet, I highly recommend adding them to your baseline.&lt;/p&gt;

&lt;p&gt;Let's build great things together! 🚀&lt;/p&gt;

</description>
      <category>ecs</category>
      <category>containers</category>
      <category>docker</category>
      <category>aws</category>
    </item>
    <item>
      <title>AWS Data Transfer Hub</title>
      <dc:creator>Aleksandra  Ljuboje</dc:creator>
      <pubDate>Mon, 03 Feb 2025 10:40:52 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-data-transfer-hub-dh0</link>
      <guid>https://dev.to/aws-builders/aws-data-transfer-hub-dh0</guid>
      <description>&lt;p&gt;When you're tasked with migrating a huge number of buckets with metadata included, your heart might skip a beat. That happened to me.&lt;br&gt;
Fortunately, AWS offers a less-known but incredibly useful service—&lt;strong&gt;Data Transfer Hub (DTH)&lt;/strong&gt; — which turned out to be a lifesaver.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge
&lt;/h2&gt;

&lt;p&gt;The task was to migrate files along with their metadata from a different cloud provider to AWS. Luckily, DTH supported this provider, making the migration process significantly easier in the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying Data Transfer Hub
&lt;/h2&gt;

&lt;p&gt;Deploying DTH is straightforward. You simply need to deploy the stack in your preferred AWS region and configure basic settings such as email and credentials. Once that’s done, the rest of the process is smooth sailing.&lt;/p&gt;

&lt;p&gt;DTH deploys several AWS services to support its operations, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lambda Functions (to manage automation and processing)&lt;/li&gt;
&lt;li&gt;Amazon CloudFront (for content delivery)&lt;/li&gt;
&lt;li&gt;Amazon S3 Buckets &lt;/li&gt;
&lt;li&gt;Amazon Cognito (for authentication)&lt;/li&gt;
&lt;li&gt;AWS AppSync (for managing APIs)&lt;/li&gt;
&lt;li&gt;Amazon DynamoDB (for metadata storage)&lt;/li&gt;
&lt;li&gt;Amazon ECS &lt;/li&gt;
&lt;li&gt;IAM Roles &lt;/li&gt;
&lt;li&gt;VPC and ACLs (for network security)&lt;/li&gt;
&lt;li&gt;AWS Step Functions (for orchestrating workflows)&lt;/li&gt;
&lt;li&gt;Amazon SNS (for notifications and alerts)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This extensive list highlights the complexity of the underlying infrastructure that makes DTH such a powerful tool.&lt;/p&gt;

&lt;p&gt;When Stack is succesfully deployed, go to &lt;code&gt;Resources&lt;/code&gt; and click on the link provided, it will open up the UI for Sign In, as shown in the image below. Sign in with the temporary credentials set in one of previous steps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fezlec91xw2m84o2q86.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fezlec91xw2m84o2q86.png" alt="Sing in" width="800" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you are in, choose a &lt;code&gt;Start new transfer task&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7fub0csdmrjmoe0akiri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7fub0csdmrjmoe0akiri.png" alt="UI" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the &lt;code&gt;S3&lt;/code&gt; since, we are migrating the folders and files in this case :)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F43dovywr0decf1avpiwb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F43dovywr0decf1avpiwb.png" alt="S3 ECS" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can track the status of task in the new portal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1juiqgzc5ycwhqs3adh5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1juiqgzc5ycwhqs3adh5.png" alt="Task status" width="800" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The logs and graphs are also available, if needed.&lt;/p&gt;

&lt;p&gt;When task has been finished, or face some issues, SNS notification will be received. An example is below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdigj1m185ekvg0g1677r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdigj1m185ekvg0g1677r.png" alt="SNS example" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;More informations and deployment steps can be found here:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/aws-solutions/data-transfer-hub" rel="noopener noreferrer"&gt;https://github.com/aws-solutions/data-transfer-hub&lt;/a&gt;&lt;br&gt;
&lt;a href="https://aws.amazon.com/solutions/implementations/data-transfer-hub/" rel="noopener noreferrer"&gt;https://aws.amazon.com/solutions/implementations/data-transfer-hub/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring Data Transfers
&lt;/h2&gt;

&lt;p&gt;When transferring files, beside selecting the source and destination buckets, DTH allows you to configure additional parameters for a tailored migration experience.&lt;/p&gt;

&lt;p&gt;When transferring files from other cloud storage providers to Amazon S3, you have multiple options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Batch File Migration&lt;/strong&gt;: You can create a list of folders and upload it as a .txt file to a dedicated S3 bucket. DTH will use this list to migrate only the specified folders to S3.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prefix-Based Transfer&lt;/strong&gt;: This option enables migrating individual folders while preserving their structure by specifying a prefix. This can be used in cases when huge folder is being migrated or when only one is needed to be migrated.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Challenges Faced During Migration
&lt;/h2&gt;

&lt;p&gt;While the migration process was generally smooth, I encountered some difficulties. One major issue was handling a 4TB bucket—it wasn’t possible to transfer everything at once. Instead, I had to transfer the data in blocks of folders.&lt;/p&gt;

&lt;p&gt;The reason for this limitation appears to be related to DTH's internal processing. Although there was available memory, certain folders were not transferred successfully. My suspicion is that this is due to Finder Memory limitations, but further investigation is needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Informations that may be useful when choosing Finder Memory
&lt;/h3&gt;

&lt;p&gt;The table below presents data collected from my tests, which may help you select the appropriate Finder Memory. However, I recommend gaining a deeper understanding of performance-related factors to optimize task performance effectively.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Finder Memory&lt;/th&gt;
&lt;th&gt;Task Duration&lt;/th&gt;
&lt;th&gt;Transfer Size&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;32GB&lt;/td&gt;
&lt;td&gt;40 min&lt;/td&gt;
&lt;td&gt;510GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;32GB&lt;/td&gt;
&lt;td&gt;15 min&lt;/td&gt;
&lt;td&gt;130GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64GB&lt;/td&gt;
&lt;td&gt;40 min&lt;/td&gt;
&lt;td&gt;600+GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16GB&lt;/td&gt;
&lt;td&gt;5 min&lt;/td&gt;
&lt;td&gt;1.4GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64GB&lt;/td&gt;
&lt;td&gt;20 min&lt;/td&gt;
&lt;td&gt;330+GB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What if I need to move additional data later? How to avoid duplicating files?
&lt;/h2&gt;

&lt;p&gt;For that purpose, please choose option to compare data before transfer to avoid duplicates:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fteiumb60d7ivulpm9aon.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fteiumb60d7ivulpm9aon.png" alt="Compare files before transfer" width="800" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will require more time, but is helpful in those situations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;AWS Data Transfer Hub is an excellent tool for large-scale migrations, offering flexibility and automation to ease the process. While it comes with some limitations, careful planning and testing can help overcome potential challenges. If you find yourself facing a daunting migration task, DTH might just be the hidden gem you need.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>datatransferhub</category>
      <category>movedata</category>
    </item>
    <item>
      <title>Handling API Gateway's "Missing Authentication Token" Error (404) Correctly</title>
      <dc:creator>Aleksandra  Ljuboje</dc:creator>
      <pubDate>Mon, 03 Feb 2025 09:15:08 +0000</pubDate>
      <link>https://dev.to/aws-builders/handling-api-gateways-missing-authentication-token-error-404-correctly-4dn8</link>
      <guid>https://dev.to/aws-builders/handling-api-gateways-missing-authentication-token-error-404-correctly-4dn8</guid>
      <description>&lt;p&gt;If you've ever worked with &lt;code&gt;AWS API Gateway&lt;/code&gt;, you might have encountered the dreaded "Missing Authentication Token" message. &lt;br&gt;
This typically happens when a user tries to access an endpoint without a valid authentication token. However, what confuses many of us is that this error can also appear even when the correct token is provided but the requested resource or path does not exist.&lt;/p&gt;

&lt;p&gt;In this blog post, I'll explain why this happens and how you can modify the response to make it more user-friendly by returning a &lt;code&gt;custom 404&lt;/code&gt; error instead of the &lt;code&gt;default 404 "Missing Authentication Token"&lt;/code&gt;. &lt;strong&gt;While there are other potential causes for this error, we were have confirmed that the token was sent correctly and wanted to focus on improving the response message for missing resources.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Does "Missing Authentication Token" Appear Even with a Token?
&lt;/h2&gt;

&lt;p&gt;AWS API Gateway throws the "Missing Authentication Token" error when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The request is sent to an incorrect or non-existent resource path.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The method (GET, POST, etc.) does not exist for the requested resource.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The API Gateway has authentication enabled but the request does not meet the authentication criteria&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By default, when a user accesses a non-existent path, API Gateway responds with a 404 "Missing Authentication Token" error instead of a more intuitive 404 "Not Found". This can mislead users into thinking it's an authentication issue when in reality, they are hitting an invalid path, as it was in my case.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to Change the "Missing Authentication Token" Response
&lt;/h2&gt;

&lt;p&gt;You can customize this response in API Gateway Gateway Responses by following these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open your API Gateway in the AWS Console.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to &lt;code&gt;Gateway Responses&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Find and select &lt;code&gt;"Missing Authentication Token"&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Change the status code to 404 if it was not already set.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;code&gt;Response Template&lt;/code&gt; modify the &lt;code&gt;Template Body&lt;/code&gt; to return a more meaningful message, such as:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "error": "Not Found",
  "message": "Wrong or non-existent path entered."
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Keep the &lt;code&gt;Content type&lt;/code&gt; as &lt;code&gt;application/json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The example is shown in the image below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx997vnvrmm6j2h13o5tg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx997vnvrmm6j2h13o5tg.png" alt="ConsoleAPI Changes" width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, lets test it with Postman!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faam1gu3shlnpvijnv5x4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faam1gu3shlnpvijnv5x4.png" alt="PostmanTest" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have refined the message a bit :)&lt;/p&gt;
&lt;h2&gt;
  
  
  Automating the Change Using a YAML Template
&lt;/h2&gt;

&lt;p&gt;If you want to apply this change programmatically, you can use a CloudFormation or OpenAPI definition file. Below is an example &lt;code&gt;test.yml&lt;/code&gt; file you can use to modify the Missing Authentication Token response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;openapi: "3.0.1"
info:
  title: "Test API"
  version: "1.0"
paths: {}
x-amazon-apigateway-gateway-responses:
  MISSING_AUTHENTICATION_TOKEN:
    statusCode: 404
    responseTemplates:
      application/json: |
        {
          "error": "Not Found",
          "message": "Wrong or non-existent path entered."
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Steps to Deploy the Template
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Import the &lt;code&gt;test.yml&lt;/code&gt; file inside the API Gateway console.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deploy the API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If testing manually, set the method implementation to &lt;code&gt;Mock&lt;/code&gt; and then deploy.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're using a CloudFormation &lt;code&gt;template.yml&lt;/code&gt;, you can apply a similar approach by modifying the &lt;code&gt;GatewayResponse&lt;/code&gt; resource for &lt;code&gt;MISSING_AUTHENTICATION_TOKEN&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Changing the &lt;code&gt;Missing Authentication Token message&lt;/code&gt; to return a custom 404 error instead of default one makes debugging easier for developers and improves the API's usability.&lt;/p&gt;

&lt;p&gt;Have you encountered this issue before? Let me know how you handled it in the comments!&lt;/p&gt;

</description>
      <category>apigateway</category>
      <category>aws</category>
    </item>
    <item>
      <title>Elevate your emails with Amazon SES Templates -Tips &amp; Tricks</title>
      <dc:creator>Aleksandra  Ljuboje</dc:creator>
      <pubDate>Fri, 29 Dec 2023 12:15:18 +0000</pubDate>
      <link>https://dev.to/aws-builders/elevate-your-emails-with-amazon-ses-templates-tips-tricks-2k0g</link>
      <guid>https://dev.to/aws-builders/elevate-your-emails-with-amazon-ses-templates-tips-tricks-2k0g</guid>
      <description>&lt;p&gt;Have you heard of Amazon Simple Email Service (&lt;em&gt;SES&lt;/em&gt;)? In case the answer is "&lt;strong&gt;&lt;em&gt;No&lt;/em&gt;&lt;/strong&gt;", in the next lines I will introduce the AWS SES and all the charm it brings to process of sending emails.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6l4oago2ezajf4o6x84q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6l4oago2ezajf4o6x84q.png" alt="A pie chart showing 40% responded " width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Credits for the design - &lt;a href="https://dribbble.com/shots/6100401-Girl-with-letter" rel="noopener noreferrer"&gt;Anna Magura&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is AWS SES?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Amazon Simple Email Service (SES) is an email platform that provides an easy, cost-effective way for you to send and receive email using your own email addresses and domains.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It allows you to send marketing emails such as special offers, transactional emails such as order confirmations, and other types of correspondence such as newsletters. When you use AWS SES to receive mail, you can develop software solutions such as email autoresponders, email unsubscribe systems, and applications that generate customer support tickets from incoming emails.&lt;/p&gt;

&lt;p&gt;For more information refer to the &lt;a href="https://docs.aws.amazon.com/ses/latest/dg/Welcome.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  But …
&lt;/h3&gt;

&lt;p&gt;The feature of AWS SES that will elevate your emails is actually the - &lt;strong&gt;TEMPLATES&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Templates allows you to create designs that will be re-usable and save a lot of time! &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here are tips and tricks that will not only enhance your email experience but also add a touch of fun to it! &lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Note: In this article, we will delve into AWS Lambda and the Python language, which I predominantly use. However, feel free to adapt and re-implement the concepts using your preferred programming language if necessary.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Tip &amp;amp; Trick #1: Enhance the visual appeal of your emails by incorporating HTML, CSS, and static JavaScript for a more polished and engaging presentation
&lt;/h2&gt;

&lt;p&gt;If your emails looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fya4xvxxrl82pbjsu1r7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fya4xvxxrl82pbjsu1r7g.png" alt="A pie chart showing 40% responded " width="800" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;it is time to change it! Let's elevate your communication to a whole new level.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffkx6e5hw16rs3q5c9ime.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffkx6e5hw16rs3q5c9ime.jpg" alt="A pie chart showing 40% responded " width="800" height="532"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Credits for the design- Anna Magura&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To do so, play with &lt;code&gt;HTML&lt;/code&gt;, &lt;code&gt;CSS&lt;/code&gt; and &lt;code&gt;static Java Script&lt;/code&gt; to create the look you prefer. &lt;br&gt;
After you let your imagination works, here is the coding part:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create AWS Lambda function&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use Python language to write the code that will send the email on your behalf. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The trick is to create separate Python file where you will put your &lt;code&gt;html&lt;/code&gt; code.&lt;/p&gt;

&lt;p&gt;Let's call it &lt;code&gt;email_template.py&lt;/code&gt; and inside the file create variable called &lt;code&gt;content&lt;/code&gt; using the following form:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;content = """
&amp;lt;!DOCTYPE HTML PUBLIC ....
&amp;lt; here goes your html, css, js code&amp;gt;
"""
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in the &lt;code&gt;main.py&lt;/code&gt; which is your main file that contains &lt;code&gt;lambda handler function&lt;/code&gt; import the file like shown bellow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from email_template import content
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To send the email I prefer using &lt;code&gt;MIMEApplication&lt;/code&gt;, &lt;code&gt;MIMEMultipart&lt;/code&gt; and &lt;code&gt;MIMEText&lt;/code&gt; and &lt;code&gt;send_raw_email&lt;/code&gt; options, because it allows me to manipulate the data and even send the attachment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create function that will send the email using MIME and SES client
&lt;/h3&gt;

&lt;p&gt;To create SES Client, we will need commonly used Python &lt;code&gt;boto3&lt;/code&gt; library&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ses_client = boto3.client('ses')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One of the methods from &lt;a href="https://docs.python.org/3/library/email.mime.html" rel="noopener noreferrer"&gt;MIME&lt;/a&gt; is &lt;code&gt;message.attach()&lt;/code&gt; that I use to add email body, attachments, etc. where &lt;code&gt;message&lt;/code&gt; is variable created using &lt;code&gt;MIMEMultipart('mixed')&lt;/code&gt;.&lt;br&gt;
To send the email use &lt;code&gt;ses_client.send_raw_email()&lt;/code&gt;, like in the example from the documentation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;response = client.send_raw_email(
    Destinations=[
    ],
    FromArn='',
    RawMessage={
        'Data': 'From: sender@example.com\nTo: recipient@example.com\nSubject: Test email (contains an attachment)\nMIME-Version: 1.0\nContent-type: Multipart/Mixed; boundary="NextPart"\n\n--NextPart\nContent-Type: text/plain\n\nThis is the message body.\n\n--NextPart\nContent-Type: text/plain;\nContent-Disposition: attachment; filename="attachment.txt"\n\nThis is the text in the attachment.\n\n--NextPart--',
    },
    ReturnPathArn='',
    Source='',
    SourceArn='',
)

print(response)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a final touch, as  &lt;code&gt;RawMessage&lt;/code&gt; we can use previously created &lt;code&gt;message&lt;/code&gt; variable and pass it as a &lt;code&gt;string&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tip &amp;amp; Trick #2: SEMPLATES
&lt;/h2&gt;

&lt;p&gt;The trick is to simply use &lt;a href="https://semplates.io/" rel="noopener noreferrer"&gt;Semplates&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzxgssjq3gqtxokuns8i0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzxgssjq3gqtxokuns8i0.png" alt="A pie chart showing 40% responded " width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;About Semplates - unlock the full potential of Amazon SES with Semplates' email template service. Design and publish personalized, responsive and branded emails with a few clicks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In other words, Semplates is a game changer when it comes to AWS SES Templates!&lt;/p&gt;

&lt;p&gt;Even if you are not that familiar with Front-End, by using user friendly Interface, you will be able to drag and drop HTML elements to create Template of your choice or even choose one from the provided examples. &lt;/p&gt;

&lt;p&gt;After you are done, simply connect your AWS Account with the Semplates account following the well explained steps and Publish the Template.&lt;br&gt;
It will show up in your &lt;code&gt;AWS Account -&amp;gt; SES Templates&lt;/code&gt; and you can use it in your Lambda function using the following line of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;template = ses_client.get_template(TemplateName=&amp;lt;your template name&amp;gt;)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and if needed, extract the HTML code from the template.&lt;/p&gt;

&lt;p&gt;For more information, follow the &lt;a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ses/client/get_template.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Now, let's highlight a few key considerations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Avoid incorporating Dynamic JavaScript content as it lacks support from major email providers like GMAIL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When utilizing Semplates, ensure to select the correct Region corresponding to your Lambda function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's crucial to note when using Semplates as team, that only one user is permitted per Region in AWS Account. This restriction is attributed to security measures, preventing unauthorized individuals from republishing or deleting your created Templates, as clarified by Semplate Support.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;In a nutshell, AWS SES adds a touch of fun to email communication! Elevate your messages with engaging designs using HTML, CSS, and static JavaScript. Dive into the world of AWS Lambda and Python for seamless email customization. And for an extra dose of joy, discover the game-changing Semplates - creating personalized, responsive templates has never been this enjoyable! Just remember to pick the right AWS region and embrace the fun side of AWS SES.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refference:
&lt;/h2&gt;

&lt;p&gt;If you prefer Medium, here is &lt;a href="https://medium.com/@aleksandraljuboje/elevate-your-emails-with-aws-ses-templates-tips-and-tricks-708f0b818432" rel="noopener noreferrer"&gt;link&lt;/a&gt; to the blog post.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/swlh/managing-aws-simple-email-service-templates-a-new-way-using-semplates-266b73a49033" rel="noopener noreferrer"&gt;Managing AWS Simple Email Service Templates a More Convenient Way - Using Semplates&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html?source=post_page-----708f0b818432--------------------------------" rel="noopener noreferrer"&gt;Using templates to send personalized email with the Amazon SES API&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>python</category>
      <category>tutorial</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Cross account access to Redshift Serverless via Lambda function</title>
      <dc:creator>Aleksandra  Ljuboje</dc:creator>
      <pubDate>Tue, 26 Dec 2023 13:13:30 +0000</pubDate>
      <link>https://dev.to/aws-builders/cross-account-access-to-redshift-serverless-via-lambda-function-5b95</link>
      <guid>https://dev.to/aws-builders/cross-account-access-to-redshift-serverless-via-lambda-function-5b95</guid>
      <description>&lt;p&gt;If you ever tried to connect your AWS Lambda function to Redshift Serverless you know how much effort it took. Well, then you can relate, knowing, how painfull it is to connect it Cross account. &lt;/p&gt;

&lt;p&gt;Here are the neccessary steps that will allow your Lambda function to connect and also run queries on Redshift Serverless databases and catalogs.&lt;/p&gt;

&lt;p&gt;The Use case that we want to manage is presented on the image bellow:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd14g37hs0rz74utlgi6m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd14g37hs0rz74utlgi6m.png" alt="Cross account infrastructure" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Account A wants to connect to Redshift Serverless&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Account B is the account with Redshift Serverless and also cross account that includes the IAM role that the Lambda function assumes&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Unlike Redshift Clustered, AWS does not provide a built-in way to create VPC endpoint access for Redshift Serverless in a different AWS account.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To make it possible, the simple workaround is presented as step 1. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a &lt;code&gt;VPC Peering&lt;/code&gt; connection between &lt;code&gt;Account A&lt;/code&gt; and &lt;code&gt;Account B&lt;/code&gt; [manage routes in both ways]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Manage Security Groups &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;• For Lambda function Security Group in &lt;code&gt;Account A&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add inbound rule on port TCP 5439 and choose Redshift Serverless SG as source
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;• For Redshift Serverless in &lt;code&gt;Account B&lt;/code&gt; manage Redshift Serverless Security group:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add inbound rule on port TCP 5439 and choose Lambda function SG as source
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;It will automatically add the &lt;code&gt;Account ID&lt;/code&gt; in front of SG. &lt;/p&gt;

&lt;p&gt;In &lt;code&gt;Account A&lt;/code&gt;, in Lambda execution role add Policy to assume IAM Role from account B, that has access to Redshift Serverless.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "Version": "2012-10-17",
    "Statement": {
        "Effect": "Allow",
        "Action": "sts:AssumeRole",
        "Resource": "arn:aws:iam::&amp;lt;Account B ID&amp;gt;:role/role-on-source-account"
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In &lt;code&gt;Account B&lt;/code&gt;, for the IAM Role edit Trust Policy to add &lt;code&gt;arn&lt;/code&gt; from Lambda Execution Policy from Account A.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::&amp;lt;Account A ID&amp;gt;:role/my-lambda-execution-role"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;em&gt;For more detailed explanation, please refer to &lt;br&gt;
&lt;a href="https://repost.aws/knowledge-center/lambda-function-assume-iam-role#" rel="noopener noreferrer"&gt;AWS re:Post blog: How do I configure a Lambda function to assume an IAM role in another AWS account?&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To make connecting to Redshift Serverless easier, you can use &lt;a href="https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html" rel="noopener noreferrer"&gt;Redshift Data Api&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the Lambda code, I decided to go with Python language where  &lt;code&gt;boto3&lt;/code&gt; is used, particulary in this case &lt;code&gt;boto3.client('redshift-data')&lt;/code&gt;.&lt;br&gt;
By creating the &lt;code&gt;client&lt;/code&gt; this way, we are allowed to perform multiple functionalities such as &lt;code&gt;execute_statement&lt;/code&gt; used for running the SQL queries.&lt;br&gt;
For the whole list of functionalities, refer to &lt;a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/redshift-data.html" rel="noopener noreferrer"&gt;this link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, the only thing left is to implement the logic of your code and test the connection.&lt;/p&gt;
&lt;h2&gt;
  
  
  Reference:
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/redshift-data.html" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;boto3.amazonaws.com&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/aws-heroes" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2491%2Ff0c1a659-c959-42cd-bb12-cd25909dd9db.png" alt="AWS Heroes" width="504" height="504"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F720355%2Ff65e8943-05e7-4d3c-9923-b8d0257e082d.jpg" alt="" width="400" height="400"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/aws-heroes/getting-started-amazon-redshift-serverless-automatic-mounting-of-aws-glue-data-catalog-36ce" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Getting started - Amazon Redshift Serverless automatic mounting of AWS Glue Data Catalog&lt;/h2&gt;
      &lt;h3&gt;Wendy Wong for AWS Heroes ・ Jul 30 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#aws&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#database&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#analytics&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/aws-builders" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2794%2F88da75b6-aadd-4ea1-8083-ae2dfca8be94.png" alt="AWS Community Builders " width="350" height="350"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F720355%2Ff65e8943-05e7-4d3c-9923-b8d0257e082d.jpg" alt="" width="400" height="400"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/aws-builders/analyzing-sydney-property-prices-with-amazon-redshift-serverless-preview-3ph0" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Analyze Sydney property prices with Amazon Redshift Serverless in GA&lt;/h2&gt;
      &lt;h3&gt;Wendy Wong for AWS Community Builders  ・ Jan 29 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#aws&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#database&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#analytics&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#serverless&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://speakerdeck.com/twingob/amazon-redshift-serverless-with-cdk?slide=22" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles.speakerdeck.com%2Fpresentations%2Fdc7e8b1f6b154b0b9488fb78dc5d257f%2Fslide_21.jpg%3F22513651" height="844" class="m-0" width="1500"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://speakerdeck.com/twingob/amazon-redshift-serverless-with-cdk?slide=22" rel="noopener noreferrer" class="c-link"&gt;
            Amazon Redshift Serverless with CDK - Speaker Deck
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Amazon Redshift Serverless を AWS CDK で構築してみる
- 2022.08.31 nakanoshima.dev #29 LED-2!! (Let’s enjoy データ分析!!) -

          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd1eu30co0ohy4w.cloudfront.net%2Fassets%2Ffavicon-bdd5839d46040a50edf189174e6f7aacc8abb3aaecd56a4711cf00d820883f47.png" width="512" height="512"&gt;
          speakerdeck.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>aws</category>
      <category>tutorial</category>
      <category>redshiftserverless</category>
      <category>database</category>
    </item>
  </channel>
</rss>
