<?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: Alejandro Lazaro</title>
    <description>The latest articles on DEV Community by Alejandro Lazaro (@alazaroc).</description>
    <link>https://dev.to/alazaroc</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%2F534765%2F14d0f3f9-36c6-499b-bd9e-4045804bba83.jpeg</url>
      <title>DEV Community: Alejandro Lazaro</title>
      <link>https://dev.to/alazaroc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alazaroc"/>
    <language>en</language>
    <item>
      <title>Weekend Build: Real-Time Raffle System with AWS AppSync for Community Events</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Mon, 02 Mar 2026 07:58:42 +0000</pubDate>
      <link>https://dev.to/aws-builders/weekend-build-real-time-raffle-system-with-aws-appsync-for-community-events-2n8m</link>
      <guid>https://dev.to/aws-builders/weekend-build-real-time-raffle-system-with-aws-appsync-for-community-events-2n8m</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/weekend-2026-02-28"&gt;DEV Weekend Challenge: Community&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Community
&lt;/h2&gt;

&lt;p&gt;I'm an &lt;strong&gt;AWS User Group Leader&lt;/strong&gt; and an &lt;strong&gt;AWS Community Builder&lt;/strong&gt; in Zaragoza, Spain. I also co-organize the &lt;strong&gt;AWS Community Day España&lt;/strong&gt;, our annual flagship event with 100-200 attendees. Between the Community Day and our regular user group meetups (6–10 events per year, 30–50 attendees each), every single event means juggling the same mess: one tool for RSVPs (Meetup, Eventbrite), spreadsheets and docs to track speakers/sponsors/venues, WhatsApp threads for last-minute changes, and absolutely nothing to keep people engaged &lt;em&gt;during&lt;/em&gt; the event itself.&lt;/p&gt;

&lt;p&gt;That's the problem I wanted to solve: &lt;strong&gt;tool sprawl&lt;/strong&gt;. One platform that covers &lt;strong&gt;before, during, and after&lt;/strong&gt; an event, for both organizers and attendees. Maybe not everything, but a few things done in a cool way.&lt;/p&gt;

&lt;p&gt;In the short term, this app is for my own user group. In the medium term, I'd love other user groups to use it too.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Community Organizer Hub&lt;/strong&gt; is a multi-tenant community event platform with a backoffice for organizers and public event pages for attendees.&lt;/p&gt;

&lt;h3&gt;
  
  
  Organizer backoffice (login required)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Full CRUD for Events, Speakers, Sponsors, and Venues (these are the 4 most important domains for an event)&lt;/li&gt;
&lt;li&gt;Event-scoped permissions: organizers only see and manage the events they're assigned to&lt;/li&gt;
&lt;li&gt;Real-time &lt;strong&gt;raffle admin&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Live participant list with total count&lt;/li&gt;
&lt;li&gt;Animated "roulette" wheel when drawing a winner&lt;/li&gt;
&lt;li&gt;Optional prize name per draw&lt;/li&gt;
&lt;li&gt;Draw history with timestamps&lt;/li&gt;
&lt;li&gt;Exclude previous winners from future draws&lt;/li&gt;
&lt;li&gt;Full raffle reset when needed&lt;/li&gt;
&lt;li&gt;"Draw winner" pushes results instantly to all attendee devices&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;A first simple version of &lt;strong&gt;Q&amp;amp;A&lt;/strong&gt; and &lt;strong&gt;Polls&lt;/strong&gt; (MVP-grade and intentionally simple for now)&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Attendee public pages (no login required)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Public event landing page&lt;/li&gt;
&lt;li&gt;Real-time &lt;strong&gt;raffle join&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Join and receive a sequential number&lt;/li&gt;
&lt;li&gt;Your number persists on page refresh (device-based)&lt;/li&gt;
&lt;li&gt;Winner notification is pushed instantly to all open attendee devices&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Q&amp;amp;A&lt;/strong&gt;: view and upvote questions in real time&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Polls&lt;/strong&gt;: participate in live single-question polls during the event&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;The UI supports &lt;strong&gt;English and Spanish&lt;/strong&gt; from day one (i18n), and is ready to expand to more languages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;🚀 &lt;strong&gt;Live app&lt;/strong&gt;: &lt;a href="https://d342vpi9y53cq7.cloudfront.net/admin/live" rel="noopener noreferrer"&gt;https://d342vpi9y53cq7.cloudfront.net/admin/live&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📹 &lt;strong&gt;Demo video&lt;/strong&gt;: &lt;a href="https://youtu.be/BZpzf879plU" rel="noopener noreferrer"&gt;Live Demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the video I follow a simple on-screen script:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Public event landing page&lt;/li&gt;
&lt;li&gt;Organizer flow: open backoffice and view assigned events, speakers, sponsors, venues, settings&lt;/li&gt;
&lt;li&gt;Access to Live Event, the main area, and prepare the Raffle&lt;/li&gt;
&lt;li&gt;Attendee flow: the attendees (6) join the user group page and access the raffle to receive a number (using different windows)&lt;/li&gt;
&lt;li&gt;Real-time raffle in action: organizer draws winner, 6 attendees receive instant notifications&lt;/li&gt;
&lt;li&gt;Stop raffle and disconnect all the participants&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;The repository is &lt;strong&gt;intentionally private&lt;/strong&gt; during this phase. This is a real product I'm building for a real community, and keeping it private while I stabilize the architecture and the solution is the responsible approach. I'm not hiding the work. I'm protecting the people who will use it.&lt;/p&gt;

&lt;p&gt;To keep this submission transparent, I'm sharing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A short &lt;strong&gt;code walkthrough video&lt;/strong&gt; showing the monorepo structure and key modules: &lt;a href="https://youtu.be/QbnlwUC_zXw" rel="noopener noreferrer"&gt;Code Walkthrough&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;AWS architecture diagram&lt;/strong&gt; below&lt;/li&gt;
&lt;/ul&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%2F07kn62usl5vjlc9wlqpb.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%2F07kn62usl5vjlc9wlqpb.png" alt="architecture diagram" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;This was a weekend build. Around an hour scoping a realistic MVP, then two intense days implementing it end to end. Yes, very intense...&lt;/p&gt;

&lt;h3&gt;
  
  
  Built with Kiro AI
&lt;/h3&gt;

&lt;p&gt;I built this entire project using &lt;strong&gt;Kiro&lt;/strong&gt;, an AI-powered IDE that helped me move from idea to deployed infrastructure in a weekend. Kiro assisted with code generation, AWS CDK infrastructure setup, and rapid iteration across the full stack.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tech stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Frontend: React 18 + Vite + TypeScript + Tailwind CSS&lt;/li&gt;
&lt;li&gt;Routing: React Router&lt;/li&gt;
&lt;li&gt;i18n: react-i18next (English default + Spanish, from the beginning... bad experiences in the past)&lt;/li&gt;
&lt;li&gt;Hosting: S3 + CloudFront (I always do it this way for my side projects)&lt;/li&gt;
&lt;li&gt;Auth: Amazon Cognito (embedded auth UI, no hosted UI)&lt;/li&gt;
&lt;li&gt;Backend: AWS Lambda + API Gateway (REST) - traditional serverless approach&lt;/li&gt;
&lt;li&gt;Real-time: AWS AppSync (GraphQL subscriptions) for raffle, Q&amp;amp;A, and polls&lt;/li&gt;
&lt;li&gt;Database: DynamoDB&lt;/li&gt;
&lt;li&gt;IaC: AWS CDK (TypeScript)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technical highlights
&lt;/h3&gt;

&lt;p&gt;💰 &lt;strong&gt;100% serverless, cost-optimized architecture&lt;/strong&gt;: DynamoDB on-demand pricing, Lambda pay-per-invocation, AppSync pay-per-request, and S3+CloudFront for static hosting means the platform costs nearly nothing at rest and scales automatically under load. Designed specifically for community budgets.&lt;/p&gt;

&lt;p&gt;🎯 &lt;strong&gt;Real-time event engagement&lt;/strong&gt;: AppSync GraphQL subscriptions push updates instantly to all connected attendee devices: raffle results, Q&amp;amp;A updates, poll updates. Bidirectional communication with zero polling overhead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-tenant isolation by design&lt;/strong&gt;: every item includes &lt;code&gt;groupId&lt;/code&gt; in its partition key, ensuring logical data isolation within shared DynamoDB tables. Authorization checks at the application layer prevent cross-tenant access. Other user groups can use this platform without any code changes. They just get their own isolated space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Event-scoped authorization&lt;/strong&gt;: organizers cannot access other events in the same group unless they're explicitly assigned to them.&lt;/p&gt;

&lt;p&gt;🎲 &lt;strong&gt;The raffle is more thoughtful than it looks&lt;/strong&gt;: attendees get a sequential number (not random) that persists across page refreshes via a device fingerprint. The organizer can name each prize, exclude previous winners from future draws, and keep a full draw history (persisted in DynamoDB for audit trail). All within the same live session. The winner is pushed to every open attendee device the moment it's drawn.&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%2Fe4f5uv97cor6hsea3ibi.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%2Fe4f5uv97cor6hsea3ibi.png" alt="Multi-device real-time raffle demonstration" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic anti-abuse controls&lt;/strong&gt;: one raffle entry per device, plus an optional join code per event.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I'd improve next
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Overall UI/UX polish, especially on attendee pages&lt;/li&gt;
&lt;li&gt;Raffle animation polish and smoother state transitions&lt;/li&gt;
&lt;li&gt;Q&amp;amp;A and polls: moderation, richer poll types, better admin controls&lt;/li&gt;
&lt;li&gt;Asset upload per event (logos, images, PDFs) via S3 + presigned URLs&lt;/li&gt;
&lt;li&gt;Test and improve the multi-tenant isolation&lt;/li&gt;
&lt;li&gt;Operational hardening: stronger rate limiting, monitoring dashboards, and more tests&lt;/li&gt;
&lt;li&gt;Higher personalization of the group public page&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>showdev</category>
      <category>community</category>
    </item>
    <item>
      <title>AI-assisted coding: what worked for me and what didn’t (after 6 months)</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Wed, 21 Jan 2026 07:00:00 +0000</pubDate>
      <link>https://dev.to/aws-builders/ai-assisted-coding-what-worked-for-me-and-what-didnt-after-6-months-ilk</link>
      <guid>https://dev.to/aws-builders/ai-assisted-coding-what-worked-for-me-and-what-didnt-after-6-months-ilk</guid>
      <description>&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%2Fmll9posgr41a9vp6qdog.webp" 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%2Fmll9posgr41a9vp6qdog.webp" alt="header image" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Over the last six months, AI-assisted coding has become a core part of how I build software.&lt;/p&gt;

&lt;p&gt;I’ve been using it almost daily across my AWS projects. One of them is my personal project &lt;a href="https://playingpadel.es" rel="noopener noreferrer"&gt;https://playingpadel.es&lt;/a&gt;{:target="_blank"}, a web app for padel players that keeps evolving.&lt;/p&gt;

&lt;p&gt;During this time I’ve tried different tools (Amazon Kiro, Copilot, Antigravity, Cursor, Windsurf). They all helped me iterate faster. And with all of them, I eventually made mistakes for the same underlying reasons.&lt;/p&gt;

&lt;p&gt;That’s when I realized something important: &lt;strong&gt;the tool mattered much less than how I was using it&lt;/strong&gt;. The same mistakes appeared across all of them whenever I skipped validation or gave them too much freedom.&lt;/p&gt;

&lt;p&gt;For something simple, or even for a proof of concept (PoC), you can use these assistants in many ways and almost everything seems to work. But once you apply them to production code, the story changes.&lt;/p&gt;

&lt;p&gt;You need more discipline and more control: tighter scope, clear constraints, tests, and verification. Otherwise, speed becomes misleading: you move fast today, but you pay for it later with technical debt, regressions, and production surprises.&lt;/p&gt;

&lt;p&gt;This article is not about hype or tools. It’s a practical summary of what didn’t work for me, what did, and the workflow that has kept me safe while building and evolving real systems.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. My default working loop
&lt;/h2&gt;

&lt;p&gt;Before getting into what didn’t work, this is the loop I try to follow every day when I’m coding with AI assistance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plan a small change&lt;/li&gt;
&lt;li&gt;Implement&lt;/li&gt;
&lt;li&gt;Test&lt;/li&gt;
&lt;li&gt;Review the changes&lt;/li&gt;
&lt;li&gt;Commit&lt;/li&gt;
&lt;li&gt;Repeat&lt;/li&gt;
&lt;/ul&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%2Faht1r7jyq2cvyjxgpjl9.webp" 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%2Faht1r7jyq2cvyjxgpjl9.webp" alt="My default loop" width="300" height="312"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Mapping: from my mistakes to my fixes
&lt;/h2&gt;

&lt;p&gt;This is a quick map to help you navigate. The value is in the details: examples, nuances, and how the pieces connect.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What didn’t work (section 4)&lt;/th&gt;
&lt;th&gt;What actually helped (section 5)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Asking for too many things at once&lt;/td&gt;
&lt;td&gt;Keep changes small and scoped (5.1)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Blindly trusting the output&lt;/td&gt;
&lt;td&gt;Review the plan and the diff first (5.2)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Not asking for validation&lt;/td&gt;
&lt;td&gt;Ask for verification, not just code (5.5)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Losing control of the code&lt;/td&gt;
&lt;td&gt;Refactor after correctness (5.7)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Not setting clear constraints&lt;/td&gt;
&lt;td&gt;Define intent and limits clearly (5.3)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Taking shortcuts without thinking long-term&lt;/td&gt;
&lt;td&gt;Checklist and continuous validation (5.8)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Not committing frequently&lt;/td&gt;
&lt;td&gt;Commit small and often (5.6)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Too many tests without strategy&lt;/td&gt;
&lt;td&gt;Treat tests as the contract (5.4)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Using weak models for complex tasks&lt;/td&gt;
&lt;td&gt;Use the right model for the job (5.9)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Constantly switching tools&lt;/td&gt;
&lt;td&gt;Master one tool and configure it well (5.9)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  4. What didn’t work for me
&lt;/h2&gt;

&lt;p&gt;This section is intentionally long.&lt;/p&gt;

&lt;p&gt;Not because things went particularly wrong, but because most of the problems I ran into kept repeating themselves in different forms.&lt;/p&gt;

&lt;p&gt;The important part is that many of them share the same root cause: &lt;strong&gt;once you lose control of the loop (validation, review, and feedback), everything becomes fragile very quickly&lt;/strong&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%2F91fbm9ybzxvz4sua3h3k.webp" 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%2F91fbm9ybzxvz4sua3h3k.webp" alt="it didnt work for me" width="500" height="333"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  4.1. Asking for too many things at once
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;The most common mistake I made was asking the AI to implement too many changes in a single request.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Even when the result looks “correct”, the changes become hard to review and validation slows down. That’s where bugs start to sneak in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast generation only helps if the validation loop is also fast.&lt;/li&gt;
&lt;li&gt;If I can’t validate something easily, I shouldn’t generate it in bulk.&lt;/li&gt;
&lt;li&gt;Small changes reduce stress and errors.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4.2. Blindly trusting generated code
&lt;/h3&gt;

&lt;p&gt;Sometimes the code looks clean and “well done”. That doesn’t mean it’s correct, safe, or consistent with your system.&lt;/p&gt;

&lt;p&gt;The problem is that many issues aren’t obvious. They don’t break the build, they don’t fail locally, and yet they introduce behavior changes: missing validations, runaway retries, wrong timeouts, or unhandled edge cases.&lt;/p&gt;

&lt;p&gt;In cloud environments this becomes even more visible, because those changes can translate into latency, unexpected costs, or degraded behavior under real load.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Never assume that “it compiles” means “it’s fine”.&lt;/li&gt;
&lt;li&gt;Review generated code like you would review a teammate’s PR.&lt;/li&gt;
&lt;li&gt;If I can’t explain a piece of code, I don’t want it in production.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4.3. Not asking the AI to validate its own work
&lt;/h3&gt;

&lt;p&gt;Many assistants make changes and stop. They won’t validate anything unless you explicitly ask.&lt;/p&gt;

&lt;p&gt;If you assume the output works, you’ll often end up testing it yourself, watching it fail, and wasting time rebuilding context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Always ask for implementation plus validation.&lt;/li&gt;
&lt;li&gt;“Implement + validate with tests + explain why it works” is a solid default.&lt;/li&gt;
&lt;li&gt;Verification is not an extra phase, it’s part of the work.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4.4. Losing control of the code
&lt;/h3&gt;

&lt;p&gt;This happens faster than it seems. You keep asking for changes and suddenly you’re no longer sure what you have or how it works.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The AI can generate working code, but you are still the owner and responsible for maintaining it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If something isn’t clear, ask for explanations before moving on.&lt;/li&gt;
&lt;li&gt;Prefer simpler code, even if it’s slightly longer.&lt;/li&gt;
&lt;li&gt;Don’t move forward without understanding the current state.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4.5. Not setting clear constraints
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Without constraints, the assistant will make decisions for you: changing structure, adding dependencies, or “improving” things you didn’t ask for.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The problem is not that it does this, but that it does it without context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Constraints are not optional.&lt;/li&gt;
&lt;li&gt;Being explicit about what I do NOT want prevents surprises.&lt;/li&gt;
&lt;li&gt;Rules like “minimal diff”, “no new services”, or “don’t touch IAM” save a lot of trouble.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4.6. Choosing the fast path without thinking long-term
&lt;/h3&gt;

&lt;p&gt;I accepted shortcuts because I wanted the solution quickly. Later, undoing them was slow and expensive.&lt;/p&gt;

&lt;p&gt;What felt like a pragmatic decision turned into hard-to-pay technical debt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Think about trade-offs before accepting shortcuts.&lt;/li&gt;
&lt;li&gt;Document temporary decisions with an exit plan.&lt;/li&gt;
&lt;li&gt;Be especially careful when shortcuts affect security, data, or cost.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4.7. Not committing frequently
&lt;/h3&gt;

&lt;p&gt;Accumulating working changes without committing is accumulating risk.&lt;/p&gt;

&lt;p&gt;Without commits you lose traceability, rollback points, and confidence to keep iterating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Small commits reduce fear.&lt;/li&gt;
&lt;li&gt;Checkpoints make experimentation cheaper.&lt;/li&gt;
&lt;li&gt;Rolling back should always be easy.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4.8. Having too many tests without a clear strategy
&lt;/h3&gt;

&lt;p&gt;It’s very easy to generate tests today. It’s also very easy to end up with a slow and redundant test suite.&lt;/p&gt;

&lt;p&gt;In my padel project, I ended up with hundreds of E2E tests, many of them duplicated, and I didn't want to run them because they took too long.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tests need a strategy, not just volume.&lt;/li&gt;
&lt;li&gt;Slow tests are deferred cost.&lt;/li&gt;
&lt;li&gt;Not every change needs the same level of testing.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4.9. Using weaker models for complex tasks
&lt;/h3&gt;

&lt;p&gt;I tried to “save tokens” by using smaller models for tasks that weren’t simple. The result was more time spent fixing and reworking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If this option is available in your assistant, let it choose which model to use. This is usually the best option, unless you know what you are doing.&lt;/li&gt;
&lt;li&gt;If you choose, use the right model for the complexity of the task.

&lt;ul&gt;
&lt;li&gt;Small models for boilerplate.&lt;/li&gt;
&lt;li&gt;Strong models for design, debugging, and risky refactors.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  4.10. Switching tools too often
&lt;/h3&gt;

&lt;p&gt;Jumping between IDEs, chats, and assistants made me lose context and consistency.&lt;/p&gt;

&lt;p&gt;Each tool came with different assumptions and rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do not change tools in the middle of a task.&lt;/li&gt;
&lt;li&gt;If I switch tools, explicitly copy the plan and constraints.&lt;/li&gt;
&lt;li&gt;Close my working loop before moving on.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. What worked for me
&lt;/h2&gt;

&lt;p&gt;If the previous section lists the mistakes, this is the practical part: the practices that, together, helped me use coding assistants without losing control.&lt;/p&gt;

&lt;p&gt;They’re not tricks or shortcuts. They’re repeatable habits that let me keep momentum without sacrificing quality.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Most of these practices are boring.&lt;br&gt;&lt;br&gt;
That’s exactly why they work.&lt;/p&gt;
&lt;/blockquote&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%2F3fnnnsjj7gcy6ef46cbe.webp" 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%2F3fnnnsjj7gcy6ef46cbe.webp" alt="what worked for me" width="450" height="300"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  5.1. Keep control: request a change, validate, continue
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;If I had to pick one change that made everything else easier, this would be it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I used to ask for too much in a single request. Now I go one change at a time: request a small change, validate it, move on.&lt;/p&gt;

&lt;p&gt;Instead of asking for “refactor the whole module”, I ask for one concrete improvement.&lt;/p&gt;

&lt;p&gt;Small changes are easier to review, validation stays fast, and rollbacks stop being scary.&lt;/p&gt;




&lt;h3&gt;
  
  
  5.2. Review the plan before implementing
&lt;/h3&gt;

&lt;p&gt;When a change is complex or high-impact, I review &lt;strong&gt;what&lt;/strong&gt; will be done before any code is written.&lt;/p&gt;

&lt;p&gt;My pattern is simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First, ask for the plan (options, risks, steps).&lt;/li&gt;
&lt;li&gt;Once I’m happy, ask to implement only what was agreed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That avoids surprises and keeps scope under control.&lt;/p&gt;

&lt;p&gt;I treat the assistant like a teammate.&lt;br&gt;&lt;br&gt;
If I can’t review the changes quickly, the problem isn’t the assistant. It’s the size of the change.&lt;/p&gt;

&lt;p&gt;Quick rule: if changes are big, split them. I prefer three small changes over one huge one.&lt;/p&gt;


&lt;h3&gt;
  
  
  5.3. Define what I want, in as much detail as needed
&lt;/h3&gt;

&lt;p&gt;When the prompt is vague, the output is vague.&lt;br&gt;&lt;br&gt;
If you’re not clear, the assistant will fill the gaps for you.&lt;/p&gt;

&lt;p&gt;I don’t follow a rigid template, but I usually include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;what I want&lt;/li&gt;
&lt;li&gt;what I don’t want (clear limits)&lt;/li&gt;
&lt;li&gt;how I’ll know it’s done (acceptance criteria)&lt;/li&gt;
&lt;li&gt;relevant context for this change&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It may feel excessive, but it reduces misunderstandings and improves output quality.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Amazon Kiro has a spec-driven development mode that forces you to define intent first, validate how it will be built, and only then generate code. It’s uncomfortable at first, but it reduces errors.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h3&gt;
  
  
  5.4. Have a clear testing strategy
&lt;/h3&gt;

&lt;p&gt;Tests are not just there to “make the pipeline green”. They’re a control mechanism: confidence to change things and fast feedback when regressions appear.&lt;/p&gt;

&lt;p&gt;What works for me is making three decisions explicitly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which test levels I have (and what each level is for).&lt;/li&gt;
&lt;li&gt;When I add new tests (new feature, new bug, new edge case).&lt;/li&gt;
&lt;li&gt;When I run them (what runs on every PR vs what I run at specific times).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My levels, ordered by criticality, are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Level 1: Smoke tests&lt;/li&gt;
&lt;li&gt;Level 2: Unit tests&lt;/li&gt;
&lt;li&gt;Level 3: Integration tests&lt;/li&gt;
&lt;li&gt;Level 4: Contract / API tests&lt;/li&gt;
&lt;li&gt;Level 5: E2E tests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Be careful with E2E tests that trigger real side effects (emails, data writes, AWS events, etc.). If you add E2E tests, also add cleanup and isolation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When a generated test fails, the assistant may “fix” it by weakening the test itself. That can keep the pipeline green while the bug is still there.&lt;br&gt;
{: .prompt-warning }&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A prompt line that helps me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Do not change tests just to make them pass. Fix production code first.
If you change a test, explain why the original expectation was wrong.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  5.5. Ask for verification, not just code
&lt;/h3&gt;

&lt;p&gt;Many times I asked for changes and got code that simply didn’t work.&lt;/p&gt;

&lt;p&gt;The good news is that this usually has a simple fix: explicitly ask for verification.&lt;/p&gt;

&lt;p&gt;By default, I ask for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;confirmation that the code works&lt;/li&gt;
&lt;li&gt;a short verification plan&lt;/li&gt;
&lt;li&gt;tests to add or update&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;If something fails, my rule is simple: stop, review, and iterate again with smaller scope and more context.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For delicate changes, I add a quick risk pass (security, reliability, cost, maintainability). In a minute, obvious issues usually surface.&lt;/p&gt;




&lt;h3&gt;
  
  
  5.6. Commit frequently
&lt;/h3&gt;

&lt;p&gt;Small commits give me confidence.&lt;/p&gt;

&lt;p&gt;I commit after every working step, before risky changes, and whenever I finish a refactor or test improvement.&lt;/p&gt;

&lt;p&gt;If the assistant goes in a weird direction, rolling back is trivial.&lt;/p&gt;

&lt;p&gt;Without frequent commits, the speed you gain coding turns into fear of breaking things.&lt;/p&gt;




&lt;h3&gt;
  
  
  5.7. Refactor with clean code, after it works
&lt;/h3&gt;

&lt;p&gt;The AI is great at rewriting code, but I want correctness first.&lt;/p&gt;

&lt;p&gt;The workflow that works for me:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get correct behavior&lt;/li&gt;
&lt;li&gt;Automate checks&lt;/li&gt;
&lt;li&gt;Refactor with clean code principles&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When the output looks messy, I explicitly ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"apply clean code principles and justify any refactor you propose."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Clean Code principles aim for readable, maintainable, and efficient code: clear and descriptive names, small functions that do one thing (aligned with SOLID), DRY (Don’t Repeat Yourself), consistent formatting rules, proper error handling, and solid unit tests. The Boy Scout Rule (“leave the code cleaner than you found it”) matters a lot, together with SOLID principles for class design and good dependency management.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  5.8. A lightweight end-of-loop checklist
&lt;/h3&gt;

&lt;p&gt;Before merging (or even before stopping for the day), I go through this checklist:&lt;/p&gt;

&lt;p&gt;Before merging (or even before stopping for the day), I go through this checklist:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did I review the changes?&lt;/li&gt;
&lt;li&gt;Does my code compile?&lt;/li&gt;
&lt;li&gt;Do tests cover critical paths?&lt;/li&gt;
&lt;li&gt;Do my tests work?&lt;/li&gt;
&lt;li&gt;Does my code follow the lint rules I have defined?&lt;/li&gt;
&lt;li&gt;Did I keep changes scoped?&lt;/li&gt;
&lt;li&gt;Did I commit?&lt;/li&gt;
&lt;li&gt;Did I verify assumptions?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It sounds basic, but it prevents most of tomorrow’s problems.&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%2F7tpa8e7dbq28dcy95dir.webp" 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%2F7tpa8e7dbq28dcy95dir.webp" alt="ai assisted coding workflow" width="350" height="345"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  5.9. Master one tool and configure it well
&lt;/h3&gt;

&lt;p&gt;Choosing one main tool and configuring it properly completely changed my experience.&lt;/p&gt;

&lt;p&gt;Constantly switching tools made me lose context and, more importantly, my rules: style, limits, and how I ask for changes.&lt;/p&gt;

&lt;p&gt;Once I left one tool well configured (persistent rules, templates, shortcuts), quality jumped and friction dropped: less re-explaining context, fewer surprises.&lt;/p&gt;

&lt;p&gt;I’ll write a dedicated post about Amazon Kiro and its SPEC mode later, because that’s where this really shines.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If your IDE supports &lt;strong&gt;persistent rules&lt;/strong&gt; (project rules, custom instructions, workspace guidelines), put your defaults there so every request starts from the same baseline.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  5.10. Keep the right mental state when working with AI
&lt;/h3&gt;

&lt;p&gt;When things don’t go as expected, it’s easy to get frustrated and respond impulsively. That almost always makes things worse.&lt;/p&gt;

&lt;p&gt;I’ve learned that output quality depends heavily on my mental state.&lt;br&gt;&lt;br&gt;
When I’m tired, frustrated, or in a rush, it shows immediately in my prompts and results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I do now&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stop when I notice frustration.&lt;/li&gt;
&lt;li&gt;Rewrite the prompt calmly with more context.&lt;/li&gt;
&lt;li&gt;Treat the assistant as a predictable tool, not something that “understands” me.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It sounds minor, but it breaks many bad loops before they escalate.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Final thoughts
&lt;/h2&gt;

&lt;p&gt;AI-assisted coding changes speed dramatically.&lt;/p&gt;

&lt;p&gt;But speed without control only amplifies existing problems.&lt;/p&gt;

&lt;p&gt;When you work with real systems, especially in the cloud, small mistakes can quickly turn into reliability, security, or cost issues.&lt;/p&gt;

&lt;p&gt;Much of what I share here was refined as I iterated on my personal project &lt;a href="https://playingpadel.es" rel="noopener noreferrer"&gt;https://playingpadel.es&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The most important lesson I’ve learned over these months is simple: the tool matters less than the method.&lt;/p&gt;

&lt;p&gt;If I had to summarize the whole article in one idea, it would be this: keep the loop healthy. Small changes, constant validation, conscious decisions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Developers still build systems. AI changes the speed.&lt;br&gt;
Used well, it doesn’t replace good engineering. It amplifies it.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>aws</category>
      <category>ai</category>
      <category>coding</category>
      <category>programming</category>
    </item>
    <item>
      <title>Quick Wins That Matter: Improve Your AWS Architecture Now</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Sun, 16 Feb 2025 18:13:51 +0000</pubDate>
      <link>https://dev.to/aws-builders/quick-wins-that-matter-improve-your-aws-architecture-now-h2c</link>
      <guid>https://dev.to/aws-builders/quick-wins-that-matter-improve-your-aws-architecture-now-h2c</guid>
      <description>&lt;p&gt;I know, I know, this isn’t exactly a new topic. And yes, everyone is talking about Generative AI these days. But let’s be honest: the AWS Well-Architected Framework is still one of the &lt;strong&gt;most valuable resources&lt;/strong&gt; for building in the cloud.&lt;/p&gt;

&lt;p&gt;I’ll admit it. I hadn’t given it much thought before. But now? Its value is crystal clear. If you're building on AWS, doesn't it make sense to follow &lt;strong&gt;AWS's own best practices and recommendations&lt;/strong&gt; to create scalable, secure, and cost-efficient systems?&lt;/p&gt;

&lt;p&gt;Seems too obvious, right?&lt;/p&gt;

&lt;p&gt;Also, the AWS Well-Architected Framework is extended and complex because it contains much information, but if you can apply a few things in your real projects, aren't you interested?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I first wrote a similar version of this article in my blog, &lt;a href="https://www.playingaws.com/" rel="noopener noreferrer"&gt;playingaws.com&lt;/a&gt;, where I share hands-on AWS insights. But since quick wins are always useful, I thought it made sense to bring it here too!&lt;/p&gt;
&lt;/blockquote&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%2Fknngihg5r3ntri5eu8ej.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%2Fknngihg5r3ntri5eu8ej.png" alt="architect implementing quick wins" width="400" height="400"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, we’re focusing on &lt;strong&gt;quick wins: practical, actionable steps you can take right now to improve your AWS architecture&lt;/strong&gt; by following the AWS Well-Architected Framework.&lt;/p&gt;

&lt;p&gt;Each of the Six Pillars is packed with best practices, and &lt;code&gt;while implementing the entire framework takes time, there are some small changes you can make today that will have an immediate impact&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This guide breaks down &lt;strong&gt;pillar-by-pillar quick wins&lt;/strong&gt; that are easy to implement and can immediately improve your AWS workloads in terms of operational excellence, security, reliability, performance efficiency, cost optimization, and sustainability.&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%2F0sw423ah75074pbimiud.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%2F0sw423ah75074pbimiud.jpg" alt="quick-wins" width="300" height="300"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Take action: Quick Wins You Can Apply Today
&lt;/h2&gt;

&lt;p&gt;Once you understand the six pillars (&lt;a href="https://www.playingaws.com/posts/the-six-pillars-of-aws-well-architected-framework-best-practices-for-cloud-success/" rel="noopener noreferrer"&gt;more info here&lt;/a&gt;, you can jump straight into these actionable insights.&lt;/p&gt;

&lt;p&gt;Quick wins are a great way to start with the AWS Well-Architected Framework because they:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;offer immediate improvements&lt;/code&gt; without requiring a complete revision of your cloud environment.&lt;/li&gt;
&lt;li&gt;enhance performance, security, and cost-efficiency quickly.&lt;/li&gt;
&lt;li&gt;help teams &lt;code&gt;build momentum&lt;/code&gt; before tackling more complex optimizations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By implementing these &lt;strong&gt;small but impactful changes first&lt;/strong&gt;, you can see real benefits fast and implement more complex strategies after that.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1. Operational Excellence
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Main Recommendation&lt;/strong&gt;: Automate everything you can to minimize human error and improve operational efficiency.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quick-Wins&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enable AWS Config&lt;/strong&gt;: Start tracking configuration changes for auditing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set up CloudWatch alerts&lt;/strong&gt;: Get notified about issues before they escalate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use AWS Trusted Advisor&lt;/strong&gt;: Identify operational improvements instantly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document key processes&lt;/strong&gt;: A simple shared document can prevent chaos.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Other important recommendations&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Continuously improve operations through feedback and automation.&lt;/li&gt;
&lt;li&gt;Build a culture of accountability and iteration.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.2. Security
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Main Recommendation&lt;/strong&gt;: Apply security from the beginning and at every layer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quick-Wins&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enable AWS Security Hub&lt;/strong&gt;: Get a centralized view of security alerts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable AWS Security Hub best practice standards&lt;/strong&gt;: Configure built-in best practice standards to assess compliance and detect potential security gaps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable GuardDuty&lt;/strong&gt;: Detect threats and unauthorized activities in real-time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable MFA&lt;/strong&gt;: Multi-Factor Authentication is a must-have.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Turn on EBS default encryption&lt;/strong&gt;: Protect your storage automatically.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Other important recommendations&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build &lt;strong&gt;layered security&lt;/strong&gt; across identity, encryption, and networking.&lt;/li&gt;
&lt;li&gt;Regularly assess and audit your security posture with automated compliance checks.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.3. Reliability
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Main Recommendation&lt;/strong&gt;: Build for failure. Assume services will fail and design for recovery.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quick-Wins&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Set up CloudWatch alarms&lt;/strong&gt;: Detect failures before they cause downtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate backups&lt;/strong&gt;: Use AWS Backup to centralize backup management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document recovery procedures&lt;/strong&gt;: Ensure your team knows what to do when things go wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test resilience&lt;/strong&gt;: Simulate failures with AWS Fault Injection Simulator.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Other important recommendations&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure redundancy and fault tolerance at all levels of your architecture.&lt;/li&gt;
&lt;li&gt;Implement proactive monitoring and automated recovery for key services.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.4. Performance Efficiency
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Main Recommendation&lt;/strong&gt;: Continuously review your resource usage to ensure you are not over-provisioned.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quick-Wins&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use AWS Compute Optimizer&lt;/strong&gt;: Get recommendations for right-sizing resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize EC2 instances&lt;/strong&gt;: Adjust sizes for better performance and cost savings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clean up unused resources&lt;/strong&gt;: Identify and terminate unused EC2 instances, EBS volumes, and other resources.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Other important recommendations&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Regularly &lt;strong&gt;optimize and scale&lt;/strong&gt; resources based on demand.&lt;/li&gt;
&lt;li&gt;Leverage serverless or managed services to minimize infrastructure management and focus on performance.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.5. Cost Optimization
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Main Recommendation&lt;/strong&gt;: Always optimize by rightsizing and using savings plans.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quick-Wins&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Review AWS Trusted Advisor&lt;/strong&gt;: Identify cost-saving opportunities instantly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set budget alerts&lt;/strong&gt;: Use AWS Budgets to create cost thresholds and receive alerts if you are exceeding your budget.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use AWS Cost Explorer&lt;/strong&gt;: Analyze your AWS costs and usage patterns for better financial efficiency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delete unused resources&lt;/strong&gt;: Stop paying for things you don’t use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Minimize data transfer costs&lt;/strong&gt; by keeping workloads and resources within the same region.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Other important recommendations&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adopt a pay-for-what-you-use mindset.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.6. Sustainability
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Main Recommendation&lt;/strong&gt;: Optimize infrastructure usage by embracing serverless and managed services.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Quick-Wins&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use AWS Managed Services&lt;/strong&gt;: Benefit from AWS’s energy-efficient infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Turn Off Idle Resources&lt;/strong&gt;: Automate shutdown of non-critical resources outside business hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize storage&lt;/strong&gt;: Enable S3 Intelligent-Tiering to optimize storage costs based on access patterns.&lt;/li&gt;
&lt;li&gt;Track your AWS carbon footprint with the AWS Customer Carbon Footprint Tool.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Other important recommendations&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduce environmental impact by optimizing resource usage.&lt;/li&gt;
&lt;li&gt;Automate infrastructure management to minimize waste.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.7. Visualizing the Quick-Wins
&lt;/h3&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%2Fxad3y2qrn60mkvo23b25.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%2Fxad3y2qrn60mkvo23b25.png" alt="mermaid diagram" width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Conclusion
&lt;/h2&gt;

&lt;p&gt;These quick wins give you a &lt;strong&gt;fast, high-impact way to start&lt;/strong&gt;** applying AWS Well-Architected best practices. Even small tweaks can *&lt;strong&gt;&lt;em&gt;significantly improve&lt;/em&gt;&lt;/strong&gt;* your cloud efficiency, security, and cost-effectiveness.&lt;/p&gt;

&lt;p&gt;But remember, &lt;code&gt;quick wins are just the beginning&lt;/code&gt;. To fully optimize your workloads and ensure you're following best practices across all pillars, a deeper review is necessary. This is where the &lt;code&gt;AWS Well-Architected Tool&lt;/code&gt; comes into play.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remember, the Well-Architected Framework isn’t a one-time exercise. It’s a continuous improvement journey. &lt;code&gt;Start small, iterate often, and keep refining your AWS architecture&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  4. Next steps
&lt;/h2&gt;

&lt;p&gt;If you want to go beyond quick wins, I wrote a &lt;strong&gt;4-article series&lt;/strong&gt; diving deeper into the Well-Architected Framework on my blog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Overview of the AWS Well-Architected Framework: &lt;a href="https://www.playingaws.com/posts/understanding-the-aws-well-architected-framework-why-it-s-essential-for-every-cloud-professional/" rel="noopener noreferrer"&gt;Why It’s Essential for Every Cloud Professional&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.playingaws.com/posts/the-six-pillars-of-aws-well-architected-framework-best-practices-for-cloud-success/" rel="noopener noreferrer"&gt;Deep Dive: Six Pillars&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;AWS Well-Architected Tool: &lt;a href="https://www.playingaws.com/posts/how-the-aws-well-architected-tool-can-transform-your-cloud-architecture/" rel="noopener noreferrer"&gt;How the AWS Well-Architected Tool Can Transform Your Cloud Architecture&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, you can explore AWS’s comprehensive resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/wellarchitected/latest/framework/welcome.html" rel="noopener noreferrer"&gt;AWS Well-Architected Framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.wellarchitectedlabs.com/" rel="noopener noreferrer"&gt;Well-Architected Labs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wa.aws.amazon.com/wat.map.en.html" rel="noopener noreferrer"&gt;Online map tool&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>architecture</category>
      <category>aws</category>
      <category>wellarchitected</category>
      <category>quickwins</category>
    </item>
    <item>
      <title>Amazon Q Developer: The AI-Powered Code Companion You’ve Been Waiting For</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Tue, 17 Dec 2024 09:30:45 +0000</pubDate>
      <link>https://dev.to/aws-builders/amazon-q-developer-the-ai-powered-code-companion-youve-been-waiting-for-385j</link>
      <guid>https://dev.to/aws-builders/amazon-q-developer-the-ai-powered-code-companion-youve-been-waiting-for-385j</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I have published this article first on my blog &lt;a href="https://www.playingaws.com/posts/amazon-q-developer-the-ai-powered-code-companion-i-ve-been-waiting-for/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For months, I tried different generative AI tools in my IDE, but none felt AWS-oriented or fully integrated. I tested five other generative AI tools in my IDE, but none felt truly AWS-oriented or integrated, until now.&lt;/p&gt;

&lt;p&gt;In this post, I’ll show you how Amazon Q can enhance your productivity, from chatting about code and inline suggestions to advanced code transformations and automated test generation. I’ll also tackle the big question: what happens to your code when using a generative AI service like this? And yes, I’ll show you actual examples using one of my own public GitHub repositories, &lt;a href="https://github.com/alazaroc/appsync-website-mutation" rel="noopener noreferrer"&gt;appsync-website-mutation&lt;/a&gt;, so you can see how effortless it is to get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This post focuses on &lt;code&gt;Amazon Q Developer&lt;/code&gt;, but first, let me provide some context.&lt;/p&gt;

&lt;h3&gt;
  
  
  Amazon Q one year ago
&lt;/h3&gt;

&lt;p&gt;Amazon Q was announced one year ago, at re:Invent 2023 (last week of November 2023), as an AI-powered assistant designed to help developers and IT professionals build, deploy, and manage applications and workloads on AWS.&lt;/p&gt;

&lt;p&gt;While its potential was evident, my initial experience left me feeling that it was released prematurely. It felt incomplete and not yet suitable for daily workflows. It seemed like AWS had rushed to join the generative AI race, and the tool wasn’t quite ready to deliver on its promise.&lt;/p&gt;

&lt;p&gt;Now, one year later, at re:Invent 2024 (first week of December 2024), AWS presented &lt;strong&gt;Amazon Q&lt;/strong&gt; renewed and ready to be used. I’ve tested it, and now I can confidently say it’s now a valuable addition to any developer’s toolkit. This is the main reason for this post.&lt;/p&gt;

&lt;h3&gt;
  
  
  Amazon Q: Amazon Q Developer + Amazon Q Business
&lt;/h3&gt;

&lt;p&gt;Built on Amazon Bedrock and leveraging 17 years of AWS expertise, Amazon Q encompasses both Amazon Q Developer for software development tasks and Amazon Q Business for enhancing enterprise productivity. It draws from AWS documentation, best practices, and real-world examples, making it a reliable and comprehensive AI assistant.&lt;/p&gt;

&lt;h4&gt;
  
  
  Amazon Q Developer
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Specifically designed for software developers&lt;/li&gt;
&lt;li&gt;Focuses on coding and development tasks&lt;/li&gt;
&lt;li&gt;Key features include:

&lt;ul&gt;
&lt;li&gt;Code chat and assistance&lt;/li&gt;
&lt;li&gt;Inline code completions&lt;/li&gt;
&lt;li&gt;New code generation&lt;/li&gt;
&lt;li&gt;Security vulnerability scanning&lt;/li&gt;
&lt;li&gt;Code upgrades and improvements&lt;/li&gt;
&lt;li&gt;Debugging and optimization suggestions&lt;/li&gt;
&lt;li&gt;AWS architecture and resource guidance&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Available through IDEs and development environments&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Amazon Q Business
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Designed for enterprise use across organizations&lt;/li&gt;
&lt;li&gt;Focuses on business operations and productivity&lt;/li&gt;
&lt;li&gt;Key features include:

&lt;ul&gt;
&lt;li&gt;Provides answers based on enterprise data&lt;/li&gt;
&lt;li&gt;Content summarization&lt;/li&gt;
&lt;li&gt;Document analysis&lt;/li&gt;
&lt;li&gt;Task automation&lt;/li&gt;
&lt;li&gt;Custom application creation (Q Apps)&lt;/li&gt;
&lt;li&gt;Integration with business tools (40+ integrations)&lt;/li&gt;
&lt;li&gt;Connectivity to data sources like SharePoint, S3, and Salesforce&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Includes security features like:

&lt;ul&gt;
&lt;li&gt;Role-based access control&lt;/li&gt;
&lt;li&gt;Data privacy controls&lt;/li&gt;
&lt;li&gt;Content filtering&lt;/li&gt;
&lt;li&gt;Integration with existing security permissions&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  The main differences
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Purpose&lt;/strong&gt;: Amazon Q Developer focuses on development tasks, while Amazon Q Business is designed for enterprise productivity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target Users&lt;/strong&gt;: Developers and technical teams for Q Developer vs. business employees across various departments for Q Business.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Sources&lt;/strong&gt;: Q Developer uses code and AWS documentation, while Q Business leverages enterprise data and documents.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Amazon Q Developer: Generative AI in Your IDE
&lt;/h2&gt;

&lt;p&gt;On April 30, 2024, &lt;code&gt;Amazon CodeWhisperer&lt;/code&gt; became part of Amazon Q Developer, bringing its generative AI-powered inline code suggestions, security vulnerability scanning, and remediation into the new platform. At re:Invent 2024, Amazon Q Developer introduced an expanded feature set, transforming it into much more than just a suggestion tool. It now helps you generate unit tests, review code for best practices, and even produce documentation on demand. This evolution makes Amazon Q Developer feel like a real AI partner, rather than just an autocomplete tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where You Can Use Amazon Q Developer
&lt;/h3&gt;

&lt;p&gt;Amazon Q Developer is available across several environments, making it easy to integrate into your workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;on AWS: &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-on-aws.html" rel="noopener noreferrer"&gt;more info&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;in your IDE: &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-in-IDE.html" rel="noopener noreferrer"&gt;more info&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;on your command line: &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line.html" rel="noopener noreferrer"&gt;more info&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;in GitLab (in preview): &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/gitlab-with-amazon-q.html" rel="noopener noreferrer"&gt;more info&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Generative AI at Your Fingertips
&lt;/h3&gt;

&lt;p&gt;When integrated with your IDE, Amazon Q Developer acts as a powerful assistant, offering real-time development guidance. With its chat-based interface and slash commands, you can interact directly with the model to request suggestions or commands in plain English. Whether you need guidance on a new feature or help refactoring and improving your code, it's just a command away.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DISCLAIMER! Amazon Q Developer is not only about code. You can ask questions about AWS architecture, your AWS resources, best practices, documentation, support, and more. &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/features.html" rel="noopener noreferrer"&gt;Here&lt;/a&gt; you have the full list of features of Amazon Q Developer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Is it really free?
&lt;/h3&gt;

&lt;p&gt;Amazon Q Developer offers two plans:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon Q Developer Free Tier&lt;/strong&gt;: Free (with limits)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon Q Developer Pro Tier&lt;/strong&gt;: $19/month per user&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Important: In the Free Tier, when you reach 50 interactions in the IDE, you will receive the following notification:&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%2Fyu5igbqiqt0rchvq4rpw.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%2Fyu5igbqiqt0rchvq4rpw.png" alt="limit" width="400" height="184"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;More information: &lt;a href="https://aws.amazon.com/q/developer/pricing/" rel="noopener noreferrer"&gt;Pricing and plan comparative&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What Happens With Your Code?
&lt;/h3&gt;

&lt;p&gt;A common concern is whether Amazon Q Developer uses your private code for model training or sharing. Here’s what you need to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free Tier: Unless you opt out, your content may be used for model enhancement. You can opt out by following the instructions in the documentation.&lt;/li&gt;
&lt;li&gt;Pro Tier: Your content is not used for service improvement or to train foundation models.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AWS also clarifies in the documentation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Amazon Q stores your questions, its responses, and additional context, such as console metadata and code in your IDE, to generate responses to your questions. Your code is also stored for features like code transformation and software development in the IDE. This data is stored for up to 90 days to provide the service, and then is permanently deleted.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  How to Opt Out
&lt;/h4&gt;

&lt;p&gt;If you're using the Free Tier and prefer not to share your content, you can opt out easily. Here’s how:&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%2Fhxhw344wzd39xgyqbpzt.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%2Fhxhw344wzd39xgyqbpzt.jpg" alt="opt-out-1" width="600" height="118"&gt;&lt;/a&gt;&lt;br&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%2F1mus82f8zvddl214yo2f.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%2F1mus82f8zvddl214yo2f.jpg" alt="opt-out-2" width="800" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The important one is this "Amazon Q: Share Content". &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/opt-out-IDE.html" rel="noopener noreferrer"&gt;More information&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Hands-on with Amazon Q Developer
&lt;/h2&gt;

&lt;p&gt;Before getting started, if you haven't installed the plugin in your IDE yet, &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-in-IDE-setup.html" rel="noopener noreferrer"&gt;follow this guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then, you have to access to the plugin of AWS / Amazon Q, and you can start writing or just type &lt;code&gt;/&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%2Fe0jbu2fn0ipwzl2wrvep.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%2Fe0jbu2fn0ipwzl2wrvep.jpg" alt="option slash" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Chatting About Code or Something Else (AWS-related)
&lt;/h3&gt;

&lt;p&gt;You can use the chat with Amazon Q in the IDE to ask any AWS-related question. I will had some concerns about Amazon Q sharing my data, so I will ask to Amazon Q directly instead of retrieve it from the documentation (as I did for the previous section):&lt;/p&gt;

&lt;p&gt;![q-question(&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lklfh7lg86k0goedrum5.jpg" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lklfh7lg86k0goedrum5.jpg&lt;/a&gt;)&lt;br&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%2F0tf1bn74pcfm2zeywdcg.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%2F0tf1bn74pcfm2zeywdcg.png" alt="q-response" width="450" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, you can simply open the AWS Amazon Q chat extension and type your question directly.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Generating Inline Suggestions
&lt;/h3&gt;

&lt;p&gt;As you type, Q Developer suggests completions right in your editor. For instance, if you're writing Terraform code and need to add a new DynamoDB table, Amazon Q can suggest completions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_dynamodb_table"&lt;/span&gt; &lt;span class="s2"&gt;"feedback"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;name&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dynamodb_table_name&lt;/span&gt;
  &lt;span class="nx"&gt;billing_mode&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"PAY_PER_REQUEST"&lt;/span&gt;
  &lt;span class="nx"&gt;hash_key&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"userId"&lt;/span&gt;
  &lt;span class="nx"&gt;range_key&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"notificationId"&lt;/span&gt;

  &lt;span class="nx"&gt;a&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before you finish typing, Q Developer suggests the next part of the code, helping you code faster without breaking your flow.&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%2F7focbsoec668tcst1o8w.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%2F7focbsoec668tcst1o8w.png" alt="inline-suggestions" width="600" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Generate documentation (/doc)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;/doc to task Amazon Q with writing API, technical design, and onboarding documentation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In my project, I wanted to generate a README file based on my code. To do this, I typed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/doc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To open &lt;code&gt;Q-Doc&lt;/code&gt; window. And there you don't have to type anything else, just select the options:&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%2Fdllxeetn1p67wiirx5th.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%2Fdllxeetn1p67wiirx5th.png" alt="docs-1" width="320" height="368"&gt;&lt;/a&gt;&lt;br&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%2F3tgmr0zsolnlaghpxka3.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%2F3tgmr0zsolnlaghpxka3.png" alt="docs-2" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, you can customize the message and ask for customized instructions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;However, I have found a few limitations in this &lt;code&gt;/doc&lt;/code&gt; feature:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If your workspace contains multiple projects,

&lt;ul&gt;
&lt;li&gt;selecting the correct one can be unintuitive&lt;/li&gt;
&lt;li&gt;if you select a different project than the first one, the README might still be generated in the first project folder&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;If you have a workspace with more than one project:

&lt;ul&gt;
&lt;li&gt;the selection of the project can be improved (is not very user-friendly)&lt;/li&gt;
&lt;li&gt;if you select one project different to the first one, the content is created in the first project in one folder. This is wrong but I am sure they will fix it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;This feature only will create README files and only in the root of the project. What about if I want to create the README of only a part of a project? You can do it with custom instructions, but the file will be created in the root folder.&lt;/li&gt;
&lt;li&gt;The markdown generated doesn’t completely follow the linting styles (markdownlint).&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  4. Developing Features (/dev)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;/dev to task Amazon Q with generating new code across your entire project and implement features.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can use the /dev to refactor current code:&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%2Fy1me63u5775lwe4fw9vb.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%2Fy1me63u5775lwe4fw9vb.png" alt="refactor 1" width="400" height="384"&gt;&lt;/a&gt;&lt;br&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%2Fzd6l8otldrjo4s3pwlrk.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%2Fzd6l8otldrjo4s3pwlrk.png" alt="refactor 2" width="400" height="504"&gt;&lt;/a&gt;&lt;br&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%2F8bf8fb59l50xb5gymzxe.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%2F8bf8fb59l50xb5gymzxe.png" alt="refactor 3" width="400" height="470"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  5. Generating Unit Tests (/test)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;/test to ask Amazon Q to generate unit tests and add them to your project, helping you improve code quality, fast.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Tired of writing boilerplate unit tests? Just highlight a function or class and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/test create the unit &lt;span class="nb"&gt;test &lt;/span&gt;&lt;span class="k"&gt;for &lt;/span&gt;main.ts file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fvrih98cy2illjopx9s2a.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%2Fvrih98cy2illjopx9s2a.png" alt="test" width="400" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now, only Java and Python are supported, as you can view in the image. If you try to generate unit tests for other languages, &lt;code&gt;Amazon Q will likely provide suggestions in the chat instead of generating actual test files&lt;/code&gt;. It will fall back to providing guidance rather than generating the actual test code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  6. Reviewing Code (/review)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;/review to ask Amazon Q to perform code reviews, flagging suspicious code patterns and assessing deployment risk.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Need a second pair of eyes? Q Developer can review your code and highlight potential issues, security concerns, or performance bottlenecks. After highlighting a section and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/review
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get back actionable suggestions: maybe you’re missing error handling, or you’re not using pagination for large DynamoDB queries. It’s like having a senior engineer at your side 24/7.&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%2Fsiwbxa45crcwt5jx8m8s.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%2Fsiwbxa45crcwt5jx8m8s.png" alt="review" width="400" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Transforming Code (/transform)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;/transform to upgrade your Java applications in minutes, not weeks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My code is not a Java code so I can't show you this feature but you can try yourself.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Select code and right-click
&lt;/h3&gt;

&lt;p&gt;You have another option. You can just select the code you want, right-click and then you can select one of the options:&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%2F4587ekf0r3jpnruj5da1.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%2F4587ekf0r3jpnruj5da1.png" alt="right-click" width="450" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;Amazon Q Developer feels like the next generation of coding assistance, purpose-built for AWS developers. With chat-based guidance, inline suggestions, powerful transformations, automated test generation, code review capabilities, and easy documentation, it streamlines many of the mundane coding tasks that eat away at our productivity.&lt;/p&gt;

&lt;p&gt;That being said, if you plan to rely on Amazon Q Developer extensively, the Free Tier may not be sufficient due to its interaction limits. If you find yourself needing more, the Pro Tier offers additional features and a higher usage limit.&lt;/p&gt;

&lt;p&gt;If you’ve been thinking about using a generative AI coding assistant for your AWS projects, Amazon Q Developer might be the tool that makes everything click. After trying it out in some personal repositories and seeing the immediate gains in speed and quality, I can say this is one AWS tool you don’t want to overlook.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ai</category>
      <category>ide</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to add CI/CD to my SAM project</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Fri, 26 Jan 2024 06:28:00 +0000</pubDate>
      <link>https://dev.to/aws-builders/how-to-add-cicd-to-my-sam-project-5hm4</link>
      <guid>https://dev.to/aws-builders/how-to-add-cicd-to-my-sam-project-5hm4</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;In this article we will use &lt;code&gt;sam pipeline&lt;/code&gt; to deploy one SAM application. However, we are not going to use the standard templates.&lt;/p&gt;

&lt;p&gt;I had to create &lt;code&gt;one custom template&lt;/code&gt; to be able to deploy the solution &lt;code&gt;using only 1 stage&lt;/code&gt;. Using the default templates you have to use 2 (test/prod?), and I don't want to do it for my personal projects, I don't need it, so I just decide create what I need and then customize it and do it public. &lt;a href="https://github.com/alazaroc/aws-sam-cli-pipeline-init-templates" rel="noopener noreferrer"&gt;This is the GitHub code of my custom template&lt;/a&gt; that you can use if you want!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I don't know why AWS don't provide it. If you know it, please leave a comment with this information. I will appreciate it!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;We will add CI/CD to our SAM application through the pipeline integration of the AWS SAM CLI. And as we want &lt;strong&gt;to add automation&lt;/strong&gt; to our deployment process and integrate it with the AWS ecosystem, &lt;strong&gt;we will use the AWS Developer tools&lt;/strong&gt; (CodePipeline and CodeBuild). For the Git repository, we will use GitHub.&lt;/p&gt;

&lt;p&gt;This is the SAM project code on &lt;a href="https://github.com/alazaroc/aws-sam-app" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; that we will use in the article. In the &lt;a href="https://github.com/alazaroc/aws-sam-app/commits/main" rel="noopener noreferrer"&gt;commit history&lt;/a&gt; you can find the evolution of the application through the steps explained.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add CI/CD to a SAM project
&lt;/h2&gt;

&lt;p&gt;We will create the CI/CD pipeline to implement continuous deployment, so when we push new code, the pipeline deploys our resources automatically.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;From AWS documentation: AWS SAM provides a set of &lt;code&gt;default pipeline templates&lt;/code&gt; for multiple CI/CD systems that encapsulate AWS's deployment best practices. These default pipeline templates use standard JSON/YAML pipeline configuration formats, and the built-in best practices help perform multi-account and multi-region deployments and verify that pipelines cannot make unintended changes to infrastructure.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We want to create a &lt;strong&gt;new pipeline in the AWS CodePipeline resource&lt;/strong&gt; using the SAM templates.&lt;/p&gt;

&lt;p&gt;To generate the pipeline for AWS CodePipeline, we have to perform the following tasks in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create infrastructure resources&lt;/li&gt;
&lt;li&gt;Generate the pipeline configuration&lt;/li&gt;
&lt;li&gt;Commit the pipeline configuration to the Git repository&lt;/li&gt;
&lt;li&gt;Deploy the pipeline&lt;/li&gt;
&lt;li&gt;Connect the Git repository with the CI/CD system&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;After you've generated the pipeline and committed it to your Git repository, whenever someone commits a code change to that repository your pipeline will be triggered to deploy the new changes automatically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Step 1: Create infrastructure resources (bootstrap)
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;The Pipelines that use AWS SAM require certain AWS resources&lt;/code&gt;, like an IAM user and roles with necessary permissions, an Amazon S3 bucket, and optionally an Amazon ECR repository. You must have a set of infrastructure resources for each deployment stage of the pipeline.&lt;/p&gt;

&lt;p&gt;Then, &lt;strong&gt;for each stage&lt;/strong&gt; we need (dev, test, prod...), we have to run &lt;code&gt;sam pipeline bootstrap&lt;/code&gt;. This command will create a CloudFormation stack with the name &lt;code&gt;aws-sam-cli-managed-${stage}-pipeline-resources&lt;/code&gt; which the necessary resources that SAM needs.&lt;/p&gt;

&lt;p&gt;We will create a single stage with the name &lt;code&gt;test&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sam pipeline bootstrap

sam pipeline bootstrap generates the required AWS infrastructure resources to connect
to your CI/CD system. This step must be run &lt;span class="k"&gt;for &lt;/span&gt;each deployment stage &lt;span class="k"&gt;in &lt;/span&gt;your pipeline,
prior to running the sam pipeline init command.

We will ask &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;1] stage definition, &lt;span class="o"&gt;[&lt;/span&gt;2] account details, and
&lt;span class="o"&gt;[&lt;/span&gt;3] references to existing resources &lt;span class="k"&gt;in &lt;/span&gt;order to bootstrap these pipeline resources.

&lt;span class="o"&gt;[&lt;/span&gt;1] Stage definition
Enter a configuration name &lt;span class="k"&gt;for &lt;/span&gt;this stage. This will be referenced later when you use the sam pipeline init &lt;span class="nb"&gt;command&lt;/span&gt;:
Stage configuration name: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;test&lt;/span&gt;

&lt;span class="o"&gt;[&lt;/span&gt;2] Account details
The following AWS credential sources are available to use.
To know more about configuration AWS credentials, visit the &lt;span class="nb"&gt;link &lt;/span&gt;below:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
    1 - Environment variables
    2 - default &lt;span class="o"&gt;(&lt;/span&gt;named profile&lt;span class="o"&gt;)&lt;/span&gt;
    3 - localstack &lt;span class="o"&gt;(&lt;/span&gt;named profile&lt;span class="o"&gt;)&lt;/span&gt;
    q - Quit and configure AWS credentials
Select a credential &lt;span class="nb"&gt;source &lt;/span&gt;to associate with this stage: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 1
Associated account 00000000000 with configuration test.

Enter the region &lt;span class="k"&gt;in &lt;/span&gt;which you want these resources to be created &lt;span class="o"&gt;[&lt;/span&gt;eu-west-1]:
Select a user permissions provider:
    1 - IAM &lt;span class="o"&gt;(&lt;/span&gt;default&lt;span class="o"&gt;)&lt;/span&gt;
    2 - OpenID Connect &lt;span class="o"&gt;(&lt;/span&gt;OIDC&lt;span class="o"&gt;)&lt;/span&gt;
Choice &lt;span class="o"&gt;(&lt;/span&gt;1, 2&lt;span class="o"&gt;)&lt;/span&gt;: 1
Enter the pipeline IAM user ARN &lt;span class="k"&gt;if &lt;/span&gt;you have previously created one, or we will create one &lt;span class="k"&gt;for &lt;/span&gt;you &lt;span class="o"&gt;[]&lt;/span&gt;:

&lt;span class="o"&gt;[&lt;/span&gt;3] Reference application build resources
Enter the pipeline execution role ARN &lt;span class="k"&gt;if &lt;/span&gt;you have previously created one, or we will create one &lt;span class="k"&gt;for &lt;/span&gt;you &lt;span class="o"&gt;[]&lt;/span&gt;:
Enter the CloudFormation execution role ARN &lt;span class="k"&gt;if &lt;/span&gt;you have previously created one, or we will create one &lt;span class="k"&gt;for &lt;/span&gt;you &lt;span class="o"&gt;[]&lt;/span&gt;:
Please enter the artifact bucket ARN &lt;span class="k"&gt;for &lt;/span&gt;your Lambda &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt; If you &lt;span class="k"&gt;do &lt;/span&gt;not have a bucket, we will create one &lt;span class="k"&gt;for &lt;/span&gt;you &lt;span class="o"&gt;[]&lt;/span&gt;:
Does your application contain any IMAGE &lt;span class="nb"&gt;type &lt;/span&gt;Lambda functions? &lt;span class="o"&gt;[&lt;/span&gt;y/N]:

&lt;span class="o"&gt;[&lt;/span&gt;4] Summary
Below is the summary of the answers:
    1 - Account: 00000000000
    2 - Stage configuration name: &lt;span class="nb"&gt;test
    &lt;/span&gt;3 - Region: eu-west-1
    4 - Pipeline user: &lt;span class="o"&gt;[&lt;/span&gt;to be created]
    5 - Pipeline execution role: &lt;span class="o"&gt;[&lt;/span&gt;to be created]
    6 - CloudFormation execution role: &lt;span class="o"&gt;[&lt;/span&gt;to be created]
    7 - Artifacts bucket: &lt;span class="o"&gt;[&lt;/span&gt;to be created]
    8 - ECR image repository: &lt;span class="o"&gt;[&lt;/span&gt;skipped]
Press enter to confirm the values above, or &lt;span class="k"&gt;select &lt;/span&gt;an item to edit the value:

This will create the following required resources &lt;span class="k"&gt;for &lt;/span&gt;the &lt;span class="s1"&gt;'test'&lt;/span&gt; configuration:
    - Pipeline IAM user
    - Pipeline execution role
    - CloudFormation execution role
    - Artifact bucket
Should we proceed with the creation? &lt;span class="o"&gt;[&lt;/span&gt;y/N]: y
    Creating the required resources...
    Successfully created!
The following resources were created &lt;span class="k"&gt;in &lt;/span&gt;your account:
    - Pipeline execution role
    - CloudFormation execution role
    - Artifact bucket
    - Pipeline IAM user
Pipeline IAM user credential:
  AWS_ACCESS_KEY_ID: xxxxxxxxxx
  AWS_SECRET_ACCESS_KEY: xxxxxxxxxx
View the definition &lt;span class="k"&gt;in&lt;/span&gt; .aws-sam/pipeline/pipelineconfig.toml,
run sam pipeline bootstrap to generate another &lt;span class="nb"&gt;set &lt;/span&gt;of resources, or proceed to
sam pipeline init to create your pipeline configuration file.

Before running sam pipeline init, we recommend first setting up AWS credentials
&lt;span class="k"&gt;in &lt;/span&gt;your CI/CD account. Read more about how to &lt;span class="k"&gt;do &lt;/span&gt;so with your provider &lt;span class="k"&gt;in
&lt;/span&gt;https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-generating-example-ci-cd-others.html.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A new stack is created for our new stage &lt;code&gt;test&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%2F711di5cyl16e1exwoxbw.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%2F711di5cyl16e1exwoxbw.png" alt="sam pipeline bootstrap test" width="330" height="128"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want more than 1 stage you should repeat the &lt;code&gt;sam pipeline bootstrap&lt;/code&gt; for the new stage (prod?). In this example I only want 1 stage to simplify.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In our SAM project now we have 1 new file containing our stage information:&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%2Fnsc1y8eeb0m4vrh93hho.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%2Fnsc1y8eeb0m4vrh93hho.png" alt="sam pipeline bootstrap new file" width="220" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Generate the pipeline configuration
&lt;/h3&gt;

&lt;p&gt;To generate the pipeline configuration, run the command &lt;code&gt;sam pipeline init&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sam pipeline init

sam pipeline init generates a pipeline configuration file that your CI/CD system
can use to deploy serverless applications using AWS SAM.
We will guide you through the process to bootstrap resources &lt;span class="k"&gt;for &lt;/span&gt;each stage,
&lt;span class="k"&gt;then &lt;/span&gt;walk through the details necessary &lt;span class="k"&gt;for &lt;/span&gt;creating the pipeline config file.

Please ensure you are &lt;span class="k"&gt;in &lt;/span&gt;the root folder of your SAM application before you begin.

Select a pipeline template to get started:
    1 - AWS Quick Start Pipeline Templates
    2 - Custom Pipeline Template Location
Choice: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 1

Cloning from https://github.com/aws/aws-sam-cli-pipeline-init-templates.git &lt;span class="o"&gt;(&lt;/span&gt;process may take a moment&lt;span class="o"&gt;)&lt;/span&gt;
Select CI/CD system
    1 - Jenkins
    2 - GitLab CI/CD
    3 - GitHub Actions
    4 - Bitbucket Pipelines
    5 - AWS CodePipeline
Choice: 5
Which pipeline template would you like to use?
    1 - Two-stage pipeline
    2 - Two-stage pipeline with monorepo
Choice &lt;span class="o"&gt;[]&lt;/span&gt;: 1
You are using the 2-stage pipeline template.
 _________    _________
|         |  |         |
| Stage 1 |-&amp;gt;| Stage 2 |
|_________|  |_________|

Checking &lt;span class="k"&gt;for &lt;/span&gt;existing stages...

Only 1 stage&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt; were detected, fewer than what the template requires: 2. If these are incorrect, delete .aws-sam/pipeline/pipelineconfig.toml and rerun

To &lt;span class="nb"&gt;set &lt;/span&gt;up stage&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt;, please quit the process using Ctrl+C and use one of the following commands:
sam pipeline init &lt;span class="nt"&gt;--bootstrap&lt;/span&gt;       To be guided through the stage and config file creation process.
sam pipeline bootstrap              To specify details &lt;span class="k"&gt;for &lt;/span&gt;an individual stage.

To reference stage resources bootstrapped &lt;span class="k"&gt;in &lt;/span&gt;a different account, press enter to proceed &lt;span class="o"&gt;[]&lt;/span&gt;:
2 stage&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt; were detected, matching the template requirements. If these are incorrect, delete .aws-sam/pipeline/pipelineconfig.toml and rerun
What is the Git provider?
    1 - Bitbucket
    2 - CodeCommit
    3 - GitHub
    4 - GitHubEnterpriseServer
Choice &lt;span class="o"&gt;[]&lt;/span&gt;: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 3
What is the full repository &lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;Example: some-user/my-repo&lt;span class="o"&gt;)&lt;/span&gt;?: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; alazaroc/aws-sam-app
What is the Git branch used &lt;span class="k"&gt;for &lt;/span&gt;production deployments? &lt;span class="o"&gt;[&lt;/span&gt;main]:
What is the template file path? &lt;span class="o"&gt;[&lt;/span&gt;template.yaml]:
We use the stage configuration name to automatically retrieve the bootstrapped resources created when you ran &lt;span class="sb"&gt;`&lt;/span&gt;sam pipeline bootstrap&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;

Here are the stage configuration names detected &lt;span class="k"&gt;in&lt;/span&gt; .aws-sam/pipeline/pipelineconfig.toml:
    1 - &lt;span class="nb"&gt;test
&lt;/span&gt;Select an index or enter the stage 1&lt;span class="s1"&gt;'s configuration name (as provided during the bootstrapping): 1
What is the sam application stack name for stage 1? [sam-app]:
Stage 1 configured successfully, configuring stage 2.

Here are the stage configuration names detected in .aws-sam/pipeline/pipelineconfig.toml:
    1 - test
Select an index or enter the stage 2'&lt;/span&gt;s configuration name &lt;span class="o"&gt;(&lt;/span&gt;as provided during the bootstrapping&lt;span class="o"&gt;)&lt;/span&gt;:
Select an index or enter the stage 2&lt;span class="s1"&gt;'s configuration name (as provided during the bootstrapping):
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;I have to stop the execution here.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the console log below, the following is displayed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;You are using the 2-stage pipeline template&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Only 1 stage(s) were detected, fewer than what the template requires: 2.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;In any real project &lt;strong&gt;you should have at least two stages&lt;/strong&gt;, so you could use the default AWS template.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, &lt;code&gt;I don't want to create two stages&lt;/code&gt; in my CI/CD pipeline, I am testing a simple SAM project, and &lt;code&gt;I only want ONE&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Unfortunately, you can't do that with the &lt;code&gt;AWS Quick Start Pipeline Templates&lt;/code&gt; so I forked the main AWS project and I created a custom template with only ONE stage.&lt;/p&gt;

&lt;p&gt;This is my forked project: &lt;a href="https://github.com/alazaroc/aws-sam-cli-pipeline-init-templates.git" rel="noopener noreferrer"&gt;https://github.com/alazaroc/aws-sam-cli-pipeline-init-templates.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I had to put my custom template in the root folder because otherwise, the AWS SAM CLI doesn't work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the next execution, I will select the option &lt;code&gt;Custom Pipeline Template Location&lt;/code&gt; and use my updated forked repository to create only one stage in the AWS CodePipeline service.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You will be asked if you already have an S3 bucket and you want to reuse it. If you say yes, and you set it:&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What is the S3 bucket name used for artifacts of SAM deployments? Not the ARN, the name. &amp;gt;[aws-sam-cli-managed-test-pipeline--artifactsbucket-gro48levpwla]: aws-sam-cli-managed-test-pipeline--artifactsbucket-gro48levpwla
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;You have to do one manual change in your code (to be able to deploy it in a later phase).&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%2F41wtgurio24phoha0vfn.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%2F41wtgurio24phoha0vfn.png" alt="resolve-s3" width="300" height="420"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sam pipeline init

sam pipeline init generates a pipeline configuration file that your CI/CD system
can use to deploy serverless applications using AWS SAM.
We will guide you through the process to bootstrap resources &lt;span class="k"&gt;for &lt;/span&gt;each stage,
&lt;span class="k"&gt;then &lt;/span&gt;walk through the details necessary &lt;span class="k"&gt;for &lt;/span&gt;creating the pipeline config file.

Please ensure you are &lt;span class="k"&gt;in &lt;/span&gt;the root folder of your SAM application before you begin.

Select a pipeline template to get started:
    1 - AWS Quick Start Pipeline Templates
    2 - Custom Pipeline Template Location
Choice: 2
Template Git location: https://github.com/alazaroc/aws-sam-cli-pipeline-init-templates.git

Cloning from https://github.com/alazaroc/aws-sam-cli-pipeline-init-templates.git &lt;span class="o"&gt;(&lt;/span&gt;process may take a
moment&lt;span class="o"&gt;)&lt;/span&gt;
You are using the 1-stage pipeline template.
 _________
|         |
| Stage 1 |
|_________|

Checking &lt;span class="k"&gt;for &lt;/span&gt;existing stages...

1 stage&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt; were detected, matching the template requirements. If these are incorrect, delete .aws-sam/pipeline/pipelineconfig.toml and rerun
What is the Git provider?
    1 - Bitbucket
    2 - CodeCommit
    3 - GitHub
    4 - GitHubEnterpriseServer
Choice &lt;span class="o"&gt;[]&lt;/span&gt;: 3
What is the full repository &lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;Example: some-user/my-repo&lt;span class="o"&gt;)&lt;/span&gt;?: alazaroc/aws-sam-app
What is the Git branch used &lt;span class="k"&gt;for &lt;/span&gt;production deployments? &lt;span class="o"&gt;[&lt;/span&gt;main]:
What is the template file path? &lt;span class="o"&gt;[&lt;/span&gt;template.yaml]:
We use the stage name to automatically retrieve the bootstrapped resources created when you ran &lt;span class="sb"&gt;`&lt;/span&gt;sam pipeline bootstrap&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;

Here are the stage configuration names detected &lt;span class="k"&gt;in&lt;/span&gt; .aws-sam/pipeline/pipelineconfig.toml:
    1 - &lt;span class="nb"&gt;test
&lt;/span&gt;What is the name of stage &lt;span class="o"&gt;(&lt;/span&gt;as provided during the bootstrapping&lt;span class="o"&gt;)&lt;/span&gt;?
Select an index or enter the stage name: 1
What is your sam application stack name? &lt;span class="o"&gt;[&lt;/span&gt;sam-app]:
What is the S3 bucket name used &lt;span class="k"&gt;for &lt;/span&gt;artifacts of SAM deployments? Not the ARN, the name. &lt;span class="o"&gt;[&lt;/span&gt;aws-sam-cli-managed-test-pipeline--artifactsbucket-gro48levpwla]: aws-sam-cli-managed-test-pipeline--artifactsbucket-gro48levpwla
What is the prefix of the S3 bucket used &lt;span class="k"&gt;for &lt;/span&gt;artifacts of SAM deployments? &lt;span class="o"&gt;[]&lt;/span&gt;:
Stage configured successfully &lt;span class="o"&gt;(&lt;/span&gt;you only have one stage&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;

To deploy this template and connect to the main git branch, run this against the leading account:
&lt;span class="sb"&gt;`&lt;/span&gt;sam deploy &lt;span class="nt"&gt;-t&lt;/span&gt; codepipeline.yaml &lt;span class="nt"&gt;--stack-name&lt;/span&gt; &amp;lt;stack-name&amp;gt; &lt;span class="nt"&gt;--capabilities&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;CAPABILITY_IAM&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
SUMMARY
We will generate a pipeline config file based on the following information:
    What is the Git provider?: GitHub
    What is the full repository &lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;Example: some-user/my-repo&lt;span class="o"&gt;)&lt;/span&gt;?: alazaroc/aws-sam-app
    What is the Git branch used &lt;span class="k"&gt;for &lt;/span&gt;production deployments?: main
    What is the template file path?: template.yaml
    What is the name of stage &lt;span class="o"&gt;(&lt;/span&gt;as provided during the bootstrapping&lt;span class="o"&gt;)&lt;/span&gt;?
Select an index or enter the stage name: 1
    What is your sam application stack name?: sam-app
    What is the pipeline execution role ARN &lt;span class="k"&gt;for &lt;/span&gt;this stage?: arn:aws:iam::00000000000:role/aws-sam-cli-managed-test-pipe-PipelineExecutionRole-Fv4wReTqFrHy
    What is the CloudFormation execution role ARN &lt;span class="k"&gt;for &lt;/span&gt;this stage?: arn:aws:iam::00000000000ole/aws-sam-cli-managed-test--CloudFormationExecutionRo-4iXZtj3Xzch9
    What is the S3 bucket name used &lt;span class="k"&gt;for &lt;/span&gt;artifacts of SAM deployments? Not the ARN, the name.: aws-sam-cli-managed-test-pipeline--artifactsbucket-gro48levpwla
    What is the prefix of the S3 bucket used &lt;span class="k"&gt;for &lt;/span&gt;artifacts of SAM deployments?:
    What is the ECR repository URI &lt;span class="k"&gt;for &lt;/span&gt;this stage?:
    What is the AWS region?: eu-west-1
Successfully created the pipeline configuration file&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt;:
    - codepipeline.yaml
    - assume-role.sh
    - pipeline/buildspec_unit_test.yml
    - pipeline/buildspec_build_package.yml
    - pipeline/buildspec_integration_test.yml
    - pipeline/buildspec_feature.yml
    - pipeline/buildspec_deploy.yml 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have the new files in our project that CodePipeline will use to deploy our code:&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%2F72s08oolcstqwb9r6swg.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%2F72s08oolcstqwb9r6swg.png" alt="sam-pipeline-init-one-stage" width="250" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Commit the pipeline configuration to Git
&lt;/h3&gt;

&lt;p&gt;This step ensures that your CI/CD system recognizes your pipeline configuration and triggers deployments upon code commits.&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%2Frqq7bz15ofwchz7psovj.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%2Frqq7bz15ofwchz7psovj.png" alt="sam-pipeline-init-commit" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Deploy the pipeline
&lt;/h3&gt;

&lt;p&gt;We have selected before that we will use &lt;code&gt;AWS CodePipeline&lt;/code&gt; like our CI/CD system. &lt;/p&gt;

&lt;p&gt;Now, we have to deploy the pipeline resources we just created in the previous step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;sam deploy -t codepipeline.yaml --stack-name &amp;lt;pipeline-stack-name&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--capabilities&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;CAPABILITY_IAM &lt;span class="nt"&gt;--region&lt;/span&gt; &amp;lt;region-X&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Don't set the same stack name as your SAM application because doing so will overwrite your application's stack (and delete your application resources).&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sam deploy &lt;span class="nt"&gt;-t&lt;/span&gt; codepipeline.yaml &lt;span class="nt"&gt;--stack-name&lt;/span&gt; pipeline-sam-app &lt;span class="nt"&gt;--capabilities&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;CAPABILITY_IAM

        Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-k2z3x0eqvuxq
        A different default S3 bucket can be &lt;span class="nb"&gt;set &lt;/span&gt;&lt;span class="k"&gt;in &lt;/span&gt;samconfig.toml
        Or by specifying &lt;span class="nt"&gt;--s3-bucket&lt;/span&gt; explicitly.

    Deploying with following values
    &lt;span class="o"&gt;===============================&lt;/span&gt;
    Stack name                   : pipeline-sam-app
    Region                       : eu-west-1
    Confirm changeset            : True
    Disable rollback             : False
    Deployment s3 bucket         : aws-sam-cli-managed-default-samclisourcebucket-k2z3x0eqvuxq
    Capabilities                 : &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"CAPABILITY_IAM"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    Parameter overrides          : &lt;span class="o"&gt;{}&lt;/span&gt;
    Signing Profiles             : &lt;span class="o"&gt;{}&lt;/span&gt;

Initiating deployment
&lt;span class="o"&gt;=====================&lt;/span&gt;

    Uploading to sam-app/1ac2fdc178c63ba988480068fe211880.template  15696 / 15696  &lt;span class="o"&gt;(&lt;/span&gt;100.00%&lt;span class="o"&gt;)&lt;/span&gt;

Waiting &lt;span class="k"&gt;for &lt;/span&gt;changeset to be created..

CloudFormation stack changeset
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;
Operation                 LogicalResourceId         ResourceType              Replacement
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;
+ Add                     CodeBuildProjectBuildAn   AWS::CodeBuild::Project   N/A
                          dPackage
+ Add                     CodeBuildProjectDeploy    AWS::CodeBuild::Project   N/A
+ Add                     CodeBuildServiceRole      AWS::IAM::Role            N/A
+ Add                     CodePipelineExecutionRo   AWS::IAM::Role            N/A
                          le
+ Add                     CodeStarConnection        AWS::CodeStarConnection   N/A
                                                    s::Connection
+ Add                     PipelineStackCloudForma   AWS::IAM::Role            N/A
                          tionExecutionRole
+ Add                     Pipeline                  AWS::CodePipeline::Pipe   N/A
                                                    line
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;

Changeset created successfully. arn:aws:cloudformation:eu-west-1:00000000000:changeSet/samcli-deploy1706135069/11d2764f-90e7-4495-b70c-513533ce61d2

Previewing CloudFormation changeset before deployment
&lt;span class="o"&gt;======================================================&lt;/span&gt;
Deploy this changeset? &lt;span class="o"&gt;[&lt;/span&gt;y/N]: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; y

2024-01-24 23:26:04 - Waiting &lt;span class="k"&gt;for &lt;/span&gt;stack create/update to &lt;span class="nb"&gt;complete

&lt;/span&gt;CloudFormation events from stack operations &lt;span class="o"&gt;(&lt;/span&gt;refresh every 5.0 seconds&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;
ResourceStatus            ResourceType              LogicalResourceId         ResourceStatusReason
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;
CREATE_IN_PROGRESS        AWS::CloudFormation::St   pipeline-sam-app          User Initiated
                          ack
CREATE_IN_PROGRESS        AWS::IAM::Role            CodeBuildServiceRole      -
CREATE_IN_PROGRESS        AWS::CodeStarConnection   CodeStarConnection        -
                          s::Connection
CREATE_IN_PROGRESS        AWS::IAM::Role            PipelineStackCloudForma   -
                                                    tionExecutionRole
CREATE_IN_PROGRESS        AWS::CodeStarConnection   CodeStarConnection        Resource creation
                          s::Connection                                       Initiated
CREATE_IN_PROGRESS        AWS::IAM::Role            PipelineStackCloudForma   Resource creation
                                                    tionExecutionRole         Initiated
CREATE_COMPLETE           AWS::CodeStarConnection   CodeStarConnection        -
                          s::Connection
CREATE_IN_PROGRESS        AWS::IAM::Role            CodeBuildServiceRole      Resource creation
                                                                              Initiated
CREATE_COMPLETE           AWS::IAM::Role            PipelineStackCloudForma   -
                                                    tionExecutionRole
CREATE_COMPLETE           AWS::IAM::Role            CodeBuildServiceRole      -
CREATE_IN_PROGRESS        AWS::CodeBuild::Project   CodeBuildProjectDeploy    -
CREATE_IN_PROGRESS        AWS::CodeBuild::Project   CodeBuildProjectBuildAn   -
                                                    dPackage
CREATE_IN_PROGRESS        AWS::CodeBuild::Project   CodeBuildProjectDeploy    Resource creation
                                                                              Initiated
CREATE_IN_PROGRESS        AWS::CodeBuild::Project   CodeBuildProjectBuildAn   Resource creation
                                                    dPackage                  Initiated
CREATE_COMPLETE           AWS::CodeBuild::Project   CodeBuildProjectDeploy    -
CREATE_COMPLETE           AWS::CodeBuild::Project   CodeBuildProjectBuildAn   -
                                                    dPackage
CREATE_IN_PROGRESS        AWS::IAM::Role            CodePipelineExecutionRo   -
                                                    le
CREATE_IN_PROGRESS        AWS::IAM::Role            CodePipelineExecutionRo   Resource creation
                                                    le                        Initiated
CREATE_COMPLETE           AWS::IAM::Role            CodePipelineExecutionRo   -
                                                    le
CREATE_IN_PROGRESS        AWS::CodePipeline::Pipe   Pipeline                  -
                          line
CREATE_IN_PROGRESS        AWS::CodePipeline::Pipe   Pipeline                  Resource creation
                          line                                                Initiated
CREATE_COMPLETE           AWS::CodePipeline::Pipe   Pipeline                  -
                          line
CREATE_COMPLETE           AWS::CloudFormation::St   pipeline-sam-app          -
                          ack
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;

CloudFormation outputs from deployed stack
&lt;span class="nt"&gt;-------------------------------------------------------------------------------------------------------&lt;/span&gt;
Outputs
&lt;span class="nt"&gt;-------------------------------------------------------------------------------------------------------&lt;/span&gt;
Key                 CodeStarConnectionArn
Description         The Arn of AWS CodeStar Connection used to connect to external code repositories.
Value               arn:aws:codestar-connections:eu-
west-1:00000000000:connection/0b2a540b-8af9-490f-91e7-24e26e16a313
&lt;span class="nt"&gt;-------------------------------------------------------------------------------------------------------&lt;/span&gt;

Successfully created/updated stack - pipeline-sam-app &lt;span class="k"&gt;in &lt;/span&gt;eu-west-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A new stack has been created to deploy our AWS CodePipeline:&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%2Fba4ln65xtbfzvgi0shju.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%2Fba4ln65xtbfzvgi0shju.png" alt="sam-pipeline-stack-cicd" width="750" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to access AWS CodePipeline to check the execution.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;However, the first execution has failed as we can see in the following image:&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%2Frbq4p2aj223spazyr1e3.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%2Frbq4p2aj223spazyr1e3.png" alt="sam-pipeline-error" width="750" height="155"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We can see in the CodePipeline flow that all steps have been created:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source&lt;/strong&gt;: integrated with GitHub as we indicated before&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UpdatePipeline&lt;/strong&gt;: the pipeline can update itself&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BuildAndPackage&lt;/strong&gt;: the SAM application is built, packaged, and uploaded (with AWS CodeBuild service)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DeployTest&lt;/strong&gt;: the SAM application is deployed (with AWS CodeBuild service)&lt;/li&gt;
&lt;/ul&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%2Fdexncrtwxsp6m9jyo3i7.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%2Fdexncrtwxsp6m9jyo3i7.png" alt="sam-pipeline-error-execution" width="646" height="1130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The cause of the error was that the &lt;strong&gt;connection between GitHub and AWS must be confirmed after being created&lt;/strong&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%2Fawk25jvrh6gja1xf41fo.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%2Fawk25jvrh6gja1xf41fo.png" alt="sam-pipeline-error-detail" width="400" height="343"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Connect the Git repository with the CI/CD system
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;If you are using GitHub or Bitbucket, after executing the &lt;code&gt;sam deploy&lt;/code&gt; command for your pipeline, you need to complete the &lt;strong&gt;pending connection&lt;/strong&gt; in the Settings/Connection section of the Developer Tools.&lt;/p&gt;

&lt;p&gt;In addition, you could store a copy of the CodeStarConnectionArn from the output of the sam deploy command, because you will need it if you want to use AWS CodePipeline with another branch than main.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By accessing the Settings/Connections in the Developer Tools, you can validate that the connection is pending approval:&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%2F2iqcld9eq7m3ar0ke69n.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%2F2iqcld9eq7m3ar0ke69n.png" alt="sam-pipeline-connection" width="600" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After activating it, we run the pipeline again (by clicking on the Release change button) and now the pipeline ends correctly.&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%2Fqjrrv4472h0d1qntq9q8.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%2Fqjrrv4472h0d1qntq9q8.png" alt="sam-pipeline-ok-execution" width="626" height="1146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Update the CI/CD steps in the SAM project
&lt;/h2&gt;

&lt;p&gt;Note that now we have a pipeline that first checks for changes in the pipeline itself and then checks the code and deploys the resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Update the steps in the pipeline automatically
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;With this pipeline configuration (with &lt;code&gt;UpdatePipeline&lt;/code&gt; step) all the changes that we make in the pipeline will be updated automatically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We want to test the automatic update of the pipeline if we make some changes.&lt;/p&gt;

&lt;p&gt;So, let's change the pipeline steps to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;delete the &lt;code&gt;UpdatePipeline&lt;/code&gt; step&lt;/li&gt;
&lt;li&gt;add the &lt;code&gt;UnitTest&lt;/code&gt; step&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To do this, we have to update the codepipeline.yaml file with the necessary changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;comment all the &lt;code&gt;UpdatePipeline&lt;/code&gt; step code&lt;/li&gt;
&lt;li&gt;uncomment all the &lt;code&gt;UnitTest&lt;/code&gt; step code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And after that, commit the changes and push them to the repository:&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%2Feu2kiezoy2p9pro7053z.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%2Feu2kiezoy2p9pro7053z.png" alt="sam-codepipeline-update-steps" width="550" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we push the changes, the &lt;code&gt;UpdatePipeline&lt;/code&gt; step executes an update on the &lt;code&gt;pipeline-sam-app&lt;/code&gt; stack (in the CloudFormation service) and it will update the pipeline definition.&lt;/p&gt;

&lt;p&gt;As we expected, &lt;strong&gt;the pipeline has updated itself&lt;/strong&gt; and now we have &lt;code&gt;UnitTest&lt;/code&gt; step but not &lt;code&gt;UpdatePipeline&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%2F8m3hysaq7ksxblsjk2ex.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%2F8m3hysaq7ksxblsjk2ex.png" alt="pipeline-sam-app-updated-execution" width="700" height="1168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Update the steps in the pipeline manually
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;If you remove the &lt;code&gt;UpdatePipeline&lt;/code&gt; step, when you push a change to the repository the pipeline won't be updated, so you have to run manually the update of the pipeline.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To update the pipeline we have to run again the command &lt;code&gt;sam deploy -t codepipeline.yaml --stack-name pipeline-sam-app --capabilities=CAPABILITY_IAM&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now, we will remove the UnitTest stage.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sam deploy &lt;span class="nt"&gt;-t&lt;/span&gt; codepipeline.yaml &lt;span class="nt"&gt;--stack-name&lt;/span&gt; pipeline-sam-app &lt;span class="nt"&gt;--capabilities&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;CAPABILITY_IAM

    Deploying with following values
    &lt;span class="o"&gt;===============================&lt;/span&gt;
    Stack name                   : pipeline-sam-app
    Region                       : eu-west-1
    Confirm changeset            : True
    Disable rollback             : False
    Deployment s3 bucket         : None
    Capabilities                 : &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"CAPABILITY_IAM"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    Parameter overrides          : &lt;span class="o"&gt;{}&lt;/span&gt;
    Signing Profiles             : &lt;span class="o"&gt;{}&lt;/span&gt;

Initiating deployment
&lt;span class="o"&gt;=====================&lt;/span&gt;

Waiting &lt;span class="k"&gt;for &lt;/span&gt;changeset to be created..

CloudFormation stack changeset
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;
Operation                 LogicalResourceId         ResourceType              Replacement
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;
&lt;span class="k"&gt;*&lt;/span&gt; Modify                  CodeBuildProjectBuildAn   AWS::CodeBuild::Project   Conditional
                          dPackage
&lt;span class="k"&gt;*&lt;/span&gt; Modify                  CodeBuildProjectDeploy    AWS::CodeBuild::Project   Conditional
&lt;span class="k"&gt;*&lt;/span&gt; Modify                  CodeBuildServiceRole      AWS::IAM::Role            False
&lt;span class="k"&gt;*&lt;/span&gt; Modify                  CodePipelineExecutionRo   AWS::IAM::Role            False
                          le
&lt;span class="k"&gt;*&lt;/span&gt; Modify                  CodeStarConnection        AWS::CodeStarConnection   False
                                                    s::Connection
&lt;span class="k"&gt;*&lt;/span&gt; Modify                  PipelineStackCloudForma   AWS::IAM::Role            False
                          tionExecutionRole
&lt;span class="k"&gt;*&lt;/span&gt; Modify                  Pipeline                  AWS::CodePipeline::Pipe   False
                                                    line
- Delete                  CodeBuildProjectUnitTes   AWS::CodeBuild::Project   N/A
                          t
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;

Changeset created successfully. arn:aws:cloudformation:eu-west-1:00000000000:changeSet/samcli-deploy1706140589/27c840fe-922c-4232-861f-51c03d45471c

Previewing CloudFormation changeset before deployment
&lt;span class="o"&gt;======================================================&lt;/span&gt;
Deploy this changeset? &lt;span class="o"&gt;[&lt;/span&gt;y/N]: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; y

2024-01-25 00:57:26 - Waiting &lt;span class="k"&gt;for &lt;/span&gt;stack create/update to &lt;span class="nb"&gt;complete

&lt;/span&gt;CloudFormation events from stack operations &lt;span class="o"&gt;(&lt;/span&gt;refresh every 5.0 seconds&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;
ResourceStatus            ResourceType              LogicalResourceId         ResourceStatusReason
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;
UPDATE_IN_PROGRESS        AWS::CloudFormation::St   pipeline-sam-app          User Initiated
                          ack
UPDATE_COMPLETE           AWS::IAM::Role            PipelineStackCloudForma   -
                                                    tionExecutionRole
UPDATE_COMPLETE           AWS::IAM::Role            CodeBuildServiceRole      -
UPDATE_COMPLETE           AWS::CodeStarConnection   CodeStarConnection        -
                          s::Connection
UPDATE_COMPLETE           AWS::CodeBuild::Project   CodeBuildProjectBuildAn   -
                                                    dPackage
UPDATE_COMPLETE           AWS::CodeBuild::Project   CodeBuildProjectDeploy    -
UPDATE_IN_PROGRESS        AWS::IAM::Role            CodePipelineExecutionRo   -
                                                    le
UPDATE_COMPLETE           AWS::IAM::Role            CodePipelineExecutionRo   -
                                                    le
UPDATE_IN_PROGRESS        AWS::CodePipeline::Pipe   Pipeline                  -
                          line
UPDATE_COMPLETE           AWS::CodePipeline::Pipe   Pipeline                  -
                          line
UPDATE_COMPLETE_CLEANUP   AWS::CloudFormation::St   pipeline-sam-app          -
_IN_PROGRESS              ack
DELETE_IN_PROGRESS        AWS::CodeBuild::Project   CodeBuildProjectUnitTes   -
                                                    t
DELETE_COMPLETE           AWS::CodeBuild::Project   CodeBuildProjectUnitTes   -
                                                    t
UPDATE_COMPLETE           AWS::CloudFormation::St   pipeline-sam-app          -
                          ack
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------&lt;/span&gt;

CloudFormation outputs from deployed stack
&lt;span class="nt"&gt;-------------------------------------------------------------------------------------------------------&lt;/span&gt;
Outputs
&lt;span class="nt"&gt;-------------------------------------------------------------------------------------------------------&lt;/span&gt;
Key                 CodeStarConnectionArn
Description         The Arn of AWS CodeStar Connection used to connect to external code repositories.
Value               arn:aws:codestar-connections:eu-
west-1:00000000000:connection/0b2a540b-8af9-490f-91e7-24e26e16a313
&lt;span class="nt"&gt;-------------------------------------------------------------------------------------------------------&lt;/span&gt;

Successfully created/updated stack - pipeline-sam-app &lt;span class="k"&gt;in &lt;/span&gt;eu-west-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the pipeline will be updated:&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%2F96tl9dgo48z088fegcc9.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%2F96tl9dgo48z088fegcc9.png" alt="sam-pipeline-simplified" width="800" height="956"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After all the changes that we made:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, we have 3 steps in our CodePipeline:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source&lt;/strong&gt;: integrated with GitHub as we indicated before&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BuildAndPackage&lt;/strong&gt;: the SAM application is built, packaged, and uploaded (with AWS CodeBuild service)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DeployTest&lt;/strong&gt;: the SAM application is deployed (with AWS CodeBuild service)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;To summarize the current state:

&lt;ul&gt;
&lt;li&gt;If we change the SAM application and update the code in our GitHub repository, the pipeline will update the resources in our AWS account.&lt;/li&gt;
&lt;li&gt;If we want to update the pipeline itself, we have to update the specific pipeline files in our SAM application, and then run manually the command &lt;/li&gt;
&lt;li&gt;What happens if you want to update the pipeline itself? Then, with the recent changes we did, you have to:&lt;/li&gt;
&lt;li&gt;modify the &lt;code&gt;codepipeline.yaml&lt;/code&gt; file in our SAM application&lt;/li&gt;
&lt;li&gt;manually execute the command &lt;code&gt;sam deploy -t codepipeline.yaml --stack-name pipeline-sam-app --capabilities=CAPABILITY_IAM&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Clean up
&lt;/h2&gt;

&lt;p&gt;We have created 3 or 4 stacks in CloudFormation related to SAM, depending if you already had used AWS SAM before (then the &lt;code&gt;aws-sam-cli-managed-default&lt;/code&gt; already existed):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;aws-sam-cli-managed-default&lt;/strong&gt;: general SAM resources&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sam-app&lt;/strong&gt;: application code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pipeline-sam-app&lt;/strong&gt;: CI/CD of the sam-app&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;aws-sam-cli-managed-test-pipeline-resources&lt;/strong&gt;: test stage resources&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to use AWS SAM in the future you could keep the &lt;code&gt;aws-sam-cli-managed-default&lt;/code&gt; stack.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You have several ways to delete your resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS CloudFormation service&lt;/li&gt;
&lt;li&gt;AWS CLI&lt;/li&gt;
&lt;li&gt;AWS SAM CLI&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;If you execute the command &lt;code&gt;sam delete&lt;/code&gt;, it only will delete the main stack (sam-app) but not the CI/CD pipeline or the stage resources stack, so you have to specify the pipeline stack in the second execution.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;sam delete --stack-name pipeline-sam-app
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And don't forget to remove the environment stack resources:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;sam delete --stack-name aws-sam-cli-managed-test-pipeline-resources
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wrapping It Up
&lt;/h2&gt;

&lt;p&gt;That brings us to the end of our journey on integrating CI/CD into AWS SAM projects. Let's recap the highlights:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ease of Deployment with SAM CLI: We utilized the &lt;code&gt;sam pipeline&lt;/code&gt; command for a streamlined deployment process. It's efficient and simplifies the deployment of SAM applications.&lt;/li&gt;
&lt;li&gt;Customizing the Pipeline: Demonstrating AWS SAM's adaptability, we successfully used a custom template for a single-stage pipeline, allowing for tailored deployment strategies.&lt;/li&gt;
&lt;li&gt;Deployment Automation: Highlighting the power of AWS tools, we've automated our deployments, which simplifies application management and ensures our apps are always current.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;Further reading:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SAM + CDK: Interested in how AWS SAM and AWS CDK can work together? I've explored this in another article: &lt;a href="https://www.playingaws.com//posts/how-to-create-serverless-applications-with-cdk-and-sam/" rel="noopener noreferrer"&gt;How to create serverless applications with CDK and SAM&lt;/a&gt;. It's a great next step for those looking to expand their serverless architecture knowledge&lt;/li&gt;
&lt;li&gt;CDK: &lt;a href="https://www.playingaws.com/posts/how-to-create-infrastructure-with-cdk/" rel="noopener noreferrer"&gt;How to create Serverless applications with CDK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Terraform: &lt;a href="https://www.playingaws.com/posts/how-to-deploy-serverless-website-with-terraform/" rel="noopener noreferrer"&gt;How to create Serverless applications with Terraform&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you for reading, and I hope this article has been both informative and useful in setting up your CI/CD pipeline. I look forward to hearing your thoughts and experiences with AWS SAM. Feel free to share them in the comments below. &lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>serverless</category>
      <category>sam</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to create serverless applications with AWS SAM (Serverless Application Model)</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Wed, 24 Jan 2024 11:24:00 +0000</pubDate>
      <link>https://dev.to/aws-builders/how-to-create-serverless-applications-with-aws-sam-serverless-application-model-3nk3</link>
      <guid>https://dev.to/aws-builders/how-to-create-serverless-applications-with-aws-sam-serverless-application-model-3nk3</guid>
      <description>&lt;p&gt;This is the second article of a serie about AWS SAM. The next will be one related with the deployment.&lt;/p&gt;

&lt;p&gt;To keep it simple, we will create a SAM application from a &lt;code&gt;quick start template&lt;/code&gt; using the &lt;code&gt;standalone function&lt;/code&gt;. However you could try a different template, the steps to follow should be the same.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The code example is available in &lt;code&gt;GitHub&lt;/code&gt; repository &lt;a href="https://github.com/alazaroc/aws-sam-app" rel="noopener noreferrer"&gt;here&lt;/a&gt;. If you want to see the step by step you can check the &lt;a href="https://github.com/alazaroc/aws-sam-app/commits/main" rel="noopener noreferrer"&gt;commit history&lt;/a&gt;, where you can find the evolution of the application through the steps explained in the following lines.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are all the steps that I want to show you in this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 1: Create a SAM application&lt;/li&gt;
&lt;li&gt;Step 2 (Optional): Test your application locally&lt;/li&gt;
&lt;li&gt;Step 3 (Optional): Unit test&lt;/li&gt;
&lt;li&gt;Step 4: Build your application&lt;/li&gt;
&lt;li&gt;Step 5: Deploy manually your application with the CLI&lt;/li&gt;
&lt;li&gt;Step 6 (Optional): AWS SAM Accelerate (Preview) - Sync&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 1: Create a sample SAM application
&lt;/h3&gt;

&lt;p&gt;The first step is to create our application through a quick start template: &lt;code&gt;Standalone function&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To create a new application from a template we run the &lt;code&gt;sam init&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sam init
Which template &lt;span class="nb"&gt;source &lt;/span&gt;would you like to use?
1 - AWS Quick Start Templates
2 - Custom Template Location
Choice: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 1

Choose an AWS Quick Start application template
  1 - Hello World Example
  2 - Data processing
  3 - Hello World Example with Powertools &lt;span class="k"&gt;for &lt;/span&gt;AWS Lambda
  4 - Multi-step workflow
  5 - Scheduled task
  6 - Standalone &lt;span class="k"&gt;function
  &lt;/span&gt;7 - Serverless API
  8 - Infrastructure event management
  9 - Lambda Response Streaming
  10 - Serverless Connector Hello World Example
  11 - Multi-step workflow with Connectors
  12 - GraphQLApi Hello World Example
  13 - Full Stack
  14 - Lambda EFS example
  15 - Hello World Example With Powertools &lt;span class="k"&gt;for &lt;/span&gt;AWS Lambda
  16 - DynamoDB Example
  17 - Machine Learning
Template: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 6

Which runtime would you like to use?
  1 - dotnet6
  2 - nodejs20.x
  3 - nodejs18.x
  4 - nodejs16.x
Runtime: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 2

Based on your selections, the only Package &lt;span class="nb"&gt;type &lt;/span&gt;available is Zip.
We will proceed to selecting the Package &lt;span class="nb"&gt;type &lt;/span&gt;as Zip.

Based on your selections, the only dependency manager available is npm.
We will proceed copying the template using npm.

Would you like to &lt;span class="nb"&gt;enable &lt;/span&gt;X-Ray tracing on the &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;in &lt;/span&gt;your application?  &lt;span class="o"&gt;[&lt;/span&gt;y/N]: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; N

Would you like to &lt;span class="nb"&gt;enable &lt;/span&gt;monitoring using CloudWatch Application Insights?
For more info, please view https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-application-insights.html &lt;span class="o"&gt;[&lt;/span&gt;y/N]: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; N

Would you like to &lt;span class="nb"&gt;set &lt;/span&gt;Structured Logging &lt;span class="k"&gt;in &lt;/span&gt;JSON format on your Lambda functions?  &lt;span class="o"&gt;[&lt;/span&gt;y/N]:

Project name &lt;span class="o"&gt;[&lt;/span&gt;sam-app]: &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sam-app

    &lt;span class="nt"&gt;-----------------------&lt;/span&gt;
    Generating application:
    &lt;span class="nt"&gt;-----------------------&lt;/span&gt;
    Name: sam-app
    Runtime: nodejs20.x
    Architectures: x86_64
    Dependency Manager: npm
    Application Template: quick-start-from-scratch
    Output Directory: &lt;span class="nb"&gt;.&lt;/span&gt;
    Configuration file: sam-app/samconfig.toml

    Next steps can be found &lt;span class="k"&gt;in &lt;/span&gt;the README file at sam-app/README.md


Commands you can use next
&lt;span class="o"&gt;=========================&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; Create pipeline: &lt;span class="nb"&gt;cd &lt;/span&gt;sam-app &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sam pipeline init &lt;span class="nt"&gt;--bootstrap&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; Validate SAM template: &lt;span class="nb"&gt;cd &lt;/span&gt;sam-app &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sam validate
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; Test Function &lt;span class="k"&gt;in &lt;/span&gt;the Cl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;At the end of the command line messages appears &lt;code&gt;Commands you can use next&lt;/code&gt;, where other SAM CLI commands are suggested as the next steps to execute.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is the basic application that has been created (only with one lambda function for easy understanding):&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%2Fpwjxzfju0xnhbqxrv9r0.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%2Fpwjxzfju0xnhbqxrv9r0.png" alt="Code basic" width="200" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that we have 4 of the 5 files that we reviewed before:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;src/handlers/hello-from-lambda.js&lt;/li&gt;
&lt;li&gt;_&lt;em&gt;test_&lt;/em&gt;/unit/handlers/hello-from-lambda.test.js&lt;/li&gt;
&lt;li&gt;template.yaml&lt;/li&gt;
&lt;li&gt;package.json&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We don't have the folder &lt;code&gt;events&lt;/code&gt; because we only create one simple Lambda Function with no event integrations&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 (Optional): Test your application locally
&lt;/h3&gt;

&lt;p&gt;The AWS SAM CLI provides the &lt;code&gt;sam local&lt;/code&gt; command to run your application using Docker containers that simulate the execution environment of Lambda.&lt;/p&gt;

&lt;p&gt;Invoke your Lambda function running &lt;code&gt;sam local invoke&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sam &lt;span class="nb"&gt;local &lt;/span&gt;invoke
Invoking src/handlers/hello-from-lambda.helloFromLambdaHandler &lt;span class="o"&gt;(&lt;/span&gt;nodejs20.x&lt;span class="o"&gt;)&lt;/span&gt;
Local image was not found.
Removing rapid images &lt;span class="k"&gt;for &lt;/span&gt;repo public.ecr.aws/sam/emulation-nodejs20.x
Building image.............................................................................................................................................................................................................................................................................
Using &lt;span class="nb"&gt;local &lt;/span&gt;image: public.ecr.aws/lambda/nodejs:20-rapid-x86_64.

Mounting /Users/alazaroc/Documents/MyProjects/github/aws/sam/sam-app as /var/task:ro,delegated, inside
runtime container
START RequestId: ba22ff8c-02f8-42a7-980d-0f0248ee63bf Version: &lt;span class="nv"&gt;$LATEST&lt;/span&gt;
2024-01-22T22:11:35.245Z    ae4b9347-e347-4ec0-a7a1-f34a3533ec8b    INFO    Hello from Lambda!
END RequestId: ae4b9347-e347-4ec0-a7a1-f34a3533ec8b
REPORT RequestId: ae4b9347-e347-4ec0-a7a1-f34a3533ec8b  Init Duration: 0.06 ms  Duration: 181.07 ms Billed Duration: 182 ms Memory Size: 128 MB Max Memory Used: 128 MB
&lt;span class="s2"&gt;"Hello from Lambda!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We received the response "Hello from Lambda!" and more useful information (Duration, Billed Duration, Memory Size, or Max Memory Used).&lt;/p&gt;

&lt;p&gt;If you have more than one Lambda Function, you must add the name which appears in the &lt;code&gt;template.yaml&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sam &lt;span class="nb"&gt;local &lt;/span&gt;invoke &lt;span class="s2"&gt;"helloFromLambdaFunction"&lt;/span&gt;
Invoking src/handlers/hello-from-lambda.helloFromLambdaHandler &lt;span class="o"&gt;(&lt;/span&gt;nodejs20.x&lt;span class="o"&gt;)&lt;/span&gt;
Local image is up-to-date
Using &lt;span class="nb"&gt;local &lt;/span&gt;image: public.ecr.aws/lambda/nodejs:20-rapid-x86_64.

Mounting /Users/alazaroc/Documents/MyProjects/github/aws/sam/sam-app as /var/task:ro,delegated, inside
runtime container
START RequestId: 323bbea4-2d41-407d-97b6-8605cbe454c3 Version: &lt;span class="nv"&gt;$LATEST&lt;/span&gt;
2024-01-22T22:20:25.541Z    9fadbf3c-0c9f-4728-b1a7-4ab96e715172    INFO    Hello from Lambda!
END RequestId: 9fadbf3c-0c9f-4728-b1a7-4ab96e715172
REPORT RequestId: 9fadbf3c-0c9f-4728-b1a7-4ab96e715172  Init Duration: 0.05 ms  Duration: 142.91 ms Billed Duration: 143 ms Memory Size: 128 MB Max Memory Used: 128 MB
&lt;span class="s2"&gt;"Hello from Lambda!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;You also can test an API locally if your SAM project includes it.&lt;/p&gt;

&lt;p&gt;You should run &lt;code&gt;sam local start-api&lt;/code&gt; command, which starts up a local endpoint that replicates your REST API endpoint.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Step 3 (Optional): Unit test
&lt;/h3&gt;

&lt;p&gt;Tests are defined in the &lt;strong&gt;_&lt;em&gt;tests_&lt;/em&gt;&lt;/strong&gt; folder in this project. Use npm to install the &lt;strong&gt;Jest test framework&lt;/strong&gt; and run unit tests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
...
npm run &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; replaced-by-user-input@0.0.1 &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; node &lt;span class="nt"&gt;--experimental-vm-modules&lt;/span&gt; node_modules/jest/bin/jest.js

  console.info
    Hello from Lambda!

      at helloFromLambdaHandler &lt;span class="o"&gt;(&lt;/span&gt;src/handlers/hello-from-lambda.mjs:9:13&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="o"&gt;(&lt;/span&gt;node:31412&lt;span class="o"&gt;)&lt;/span&gt; ExperimentalWarning: VM Modules is an experimental feature and might change at any &lt;span class="nb"&gt;time&lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;Use &lt;span class="sb"&gt;`&lt;/span&gt;node &lt;span class="nt"&gt;--trace-warnings&lt;/span&gt; ...&lt;span class="sb"&gt;`&lt;/span&gt; to show where the warning was created&lt;span class="o"&gt;)&lt;/span&gt;
PASS  __tests__/unit/handlers/hello-from-lambda.test.mjs
  Test &lt;span class="k"&gt;for &lt;/span&gt;hello-from-lambda
    ✓ Verifies successful response &lt;span class="o"&gt;(&lt;/span&gt;30 ms&lt;span class="o"&gt;)&lt;/span&gt;

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.553 s
Ran all &lt;span class="nb"&gt;test &lt;/span&gt;suites.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Build your application
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;sam build&lt;/code&gt; command builds any dependencies that your application has, and copies your application source code to folders under &lt;code&gt;.aws-sam/build&lt;/code&gt; to be zipped and uploaded to Lambda.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sam build
Starting Build use cache
Manifest file is changed &lt;span class="o"&gt;(&lt;/span&gt;new &lt;span class="nb"&gt;hash&lt;/span&gt;: 57574ed173cdc6a98b283bd7b00b44ca&lt;span class="o"&gt;)&lt;/span&gt; or dependency folder
&lt;span class="o"&gt;(&lt;/span&gt;.aws-sam/deps/ee51225c-b9b8-433f-ab8b-3821871f820a&lt;span class="o"&gt;)&lt;/span&gt; is missing &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;helloFromLambdaFunction&lt;span class="o"&gt;)&lt;/span&gt;, downloading
dependencies and copying/building &lt;span class="nb"&gt;source
&lt;/span&gt;Building codeuri: /Users/alazaroc/Documents/MyProjects/github/aws/sam/sam-app runtime: nodejs20.x metadata:
&lt;span class="o"&gt;{}&lt;/span&gt; architecture: x86_64 functions: helloFromLambdaFunction
Running NodejsNpmBuilder:NpmPack
Running NodejsNpmBuilder:CopyNpmrcAndLockfile
Running NodejsNpmBuilder:CopySource
Running NodejsNpmBuilder:NpmInstall
Running NodejsNpmBuilder:CleanUp
Running NodejsNpmBuilder:CopyDependencies
Running NodejsNpmBuilder:CleanUpNpmrc
Running NodejsNpmBuilder:LockfileCleanUp
Running NodejsNpmBuilder:LockfileCleanUp

Build Succeeded

Built Artifacts  : .aws-sam/build
Built Template   : .aws-sam/build/template.yaml

Commands you can use next
&lt;span class="o"&gt;=========================&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; Validate SAM template: sam validate
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; Invoke Function: sam &lt;span class="nb"&gt;local &lt;/span&gt;invoke
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; Test Function &lt;span class="k"&gt;in &lt;/span&gt;the Cloud: sam &lt;span class="nb"&gt;sync&lt;/span&gt; &lt;span class="nt"&gt;--stack-name&lt;/span&gt; &lt;span class="o"&gt;{{&lt;/span&gt;stack-name&lt;span class="o"&gt;}}&lt;/span&gt; &lt;span class="nt"&gt;--watch&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; Deploy: sam deploy &lt;span class="nt"&gt;--guided&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the new files of our SAM project:&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%2F8ev9bnklotpdlrh7tizi.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%2F8ev9bnklotpdlrh7tizi.png" alt="build files" width="200" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Deploy manually your application with the CLI
&lt;/h3&gt;

&lt;p&gt;Now we want to deploy our application and We will do it manually using the CLI, although in &lt;a href="https://playingaws.com/posts/how-to-add-ci-cd-to-my-sam-project/" rel="noopener noreferrer"&gt;this other article&lt;/a&gt;. I will explain how to do it with a pipeline (automatically).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Remember that AWS SAM uses AWS CloudFormation as the underlying deployment mechanism.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As we don't have a &lt;strong&gt;configuration file&lt;/strong&gt; containing all the values, we are going to create one. We run the &lt;code&gt;sam deploy -- guided&lt;/code&gt; command which will search as a first step if a samconfig.toml file exists and if not the AWS SAM CLI will ask us about the necessary information to deploy our application.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;sam deploy&lt;/code&gt; command will package and upload the application artifacts to the S3 bucket, and deploys the application using AWS CloudFormation&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sam deploy &lt;span class="nt"&gt;--guided&lt;/span&gt;
&lt;span class="go"&gt;Configuring SAM deploy
======================

  Looking for config file [samconfig.toml] :  Found
  Reading default arguments  :  Success

  Setting default arguments for 'sam deploy'
  =========================================
  Stack Name [sam-app]:
  AWS Region [eu-west-1]:
&lt;/span&gt;&lt;span class="gp"&gt;  #&lt;/span&gt;Shows you resources changes to be deployed and require a &lt;span class="s1"&gt;'Y'&lt;/span&gt; to initiate deploy
&lt;span class="go"&gt;  Confirm changes before deploy [Y/n]:
&lt;/span&gt;&lt;span class="gp"&gt;  #&lt;/span&gt;SAM needs permission to be able to create roles to connect to the resources &lt;span class="k"&gt;in &lt;/span&gt;your template
&lt;span class="go"&gt;  Allow SAM CLI IAM role creation [Y/n]:
&lt;/span&gt;&lt;span class="gp"&gt;  #&lt;/span&gt;Preserves the state of previously provisioned resources when an operation fails
&lt;span class="go"&gt;  Disable rollback [y/N]:
  Save arguments to configuration file [Y/n]:
  SAM configuration file [samconfig.toml]:
  SAM configuration environment [default]:

  Looking for resources needed for deployment:

  Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-k2z3x0eqvuxq
  A different default S3 bucket can be set in samconfig.toml and auto resolution of buckets turned off by setting resolve_s3=False

        Parameter "stack_name=sam-app" in [default.deploy.parameters] is defined as a global parameter
[default.global.parameters].
        This parameter will be only saved under [default.global.parameters] in
/Users/alazaroc/Documents/MyProjects/github/aws/sam/sam-app/samconfig.toml.

  Saved arguments to config file
  Running 'sam deploy' for future deployments will use the parameters saved above.
  The above parameters can be changed by modifying samconfig.toml
  Learn more about samconfig.toml syntax at
  https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html

  Uploading to sam-app/c20f3d4923fb213486783dd25f269a52  38478 / 38478  (100.00%)

  Deploying with following values
  ===============================
  Stack name                   : sam-app
  Region                       : eu-west-1
  Confirm changeset            : True
  Disable rollback             : False
  Deployment s3 bucket         : aws-sam-cli-managed-default-samclisourcebucket-k2z3x0eqvuxq
  Capabilities                 : ["CAPABILITY_IAM"]
  Parameter overrides          : {}
  Signing Profiles             : {}

Initiating deployment
=====================

  Uploading to sam-app/3752a1ab023524618cd64cc55081484c.template  734 / 734  (100.00%)


Waiting for changeset to be created..

CloudFormation stack changeset
-------------------------------------------------------------------------------------------------------------
Operation                   LogicalResourceId           ResourceType                Replacement
-------------------------------------------------------------------------------------------------------------
+ Add                       helloFromLambdaFunctionRo   AWS::IAM::Role              N/A
                            le
+ Add                       helloFromLambdaFunction     AWS::Lambda::Function       N/A
-------------------------------------------------------------------------------------------------------------


Changeset created successfully. arn:aws:cloudformation:eu-west-1:000000000000:changeSet/samcli-deploy1705962828/ee61a1a2-9083-4029-9ee1-126661b04541


Previewing CloudFormation changeset before deployment
======================================================
Deploy this changeset? [y/N]: y

2024-01-22 23:34:17 - Waiting for stack create/update to complete

CloudFormation events from stack operations (refresh every 5.0 seconds)
-------------------------------------------------------------------------------------------------------------
ResourceStatus              ResourceType                LogicalResourceId           ResourceStatusReason
-------------------------------------------------------------------------------------------------------------
CREATE_IN_PROGRESS          AWS::CloudFormation::Stac   sam-app                     User Initiated
                            k
CREATE_IN_PROGRESS          AWS::IAM::Role              helloFromLambdaFunctionRo   -
                                                        le
CREATE_IN_PROGRESS          AWS::IAM::Role              helloFromLambdaFunctionRo   Resource creation
                                                        le                          Initiated
CREATE_COMPLETE             AWS::IAM::Role              helloFromLambdaFunctionRo   -
                                                        le
CREATE_IN_PROGRESS          AWS::Lambda::Function       helloFromLambdaFunction     -
CREATE_IN_PROGRESS          AWS::Lambda::Function       helloFromLambdaFunction     Resource creation
                                                                                    Initiated
CREATE_COMPLETE             AWS::Lambda::Function       helloFromLambdaFunction     -
CREATE_COMPLETE             AWS::CloudFormation::Stac   sam-app                     -
                            k
-------------------------------------------------------------------------------------------------------------

Successfully created/updated stack - sam-app in eu-west-1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember that the executed command will create the &lt;code&gt;samconfig.toml&lt;/code&gt; file in our project to save the deployment configuration and be able to repeat it without configuration.&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%2F9d1ee3b1qxqu6t0slmxt.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%2F9d1ee3b1qxqu6t0slmxt.png" alt="deploy guided" width="600" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From now on, to deploy our SAM project we just need to run the &lt;code&gt;sam deploy&lt;/code&gt; command, so we run it but if we have no changes, the deployment will fail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sam deploy
&lt;span class="go"&gt;Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-k2z3x0eqvuxq
    A different default S3 bucket can be set in samconfig.toml
    Or by specifying --s3-bucket explicitly.
File with same data already exists at sam-app/c20f3d4923fb213486783dd25f269a52, skipping upload

  Deploying with following values
  ===============================
  Stack name                   : sam-app
  Region                       : eu-west-1
  Confirm changeset            : True
  Disable rollback             : False
  Deployment s3 bucket         : aws-sam-cli-managed-default-samclisourcebucket-k2z3x0eqvuxq
  Capabilities                 : ["CAPABILITY_IAM"]
  Parameter overrides          : {}
  Signing Profiles             : {}

Initiating deployment
=====================

File with same data already exists at sam-app/3752a1ab023524618cd64cc55081484c.template, skipping upload


Waiting for changeset to be created..

Error: No changes to deploy. Stack sam-app is up to date
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 6 (Optional): AWS SAM Sync
&lt;/h3&gt;

&lt;p&gt;We already have deployed our application in the cloud and you may want to synchronize the changes, i.e. &lt;code&gt;deploy the changes in real-time when we save the changes&lt;/code&gt; (without running the deploy command).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;sam sync&lt;/code&gt; command syncs your local application changes to the AWS Cloud. Use sync to build, package, and deploy changes to your development environment as you iterate on your application. As a best practice, run sam sync after you finish iterating on your application to sync changes to your AWS CloudFormation stack.&lt;/p&gt;

&lt;p&gt;Be careful if you use this functionality.&lt;/p&gt;

&lt;p&gt;First &lt;code&gt;it is in preview&lt;/code&gt; and also as you will see in the next lines in the console: "The SAM CLI will use the AWS Lambda, Amazon API Gateway, and AWS StepFunctions APIs to &lt;code&gt;upload your code without performing a CloudFormation deployment. This will cause drift in your CloudFormation stack&lt;/code&gt;."&lt;/p&gt;

&lt;p&gt;The sync command should only be used against a development stack.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sam &lt;span class="nb"&gt;sync&lt;/span&gt; &lt;span class="nt"&gt;--stack-name&lt;/span&gt; sam-app &lt;span class="nt"&gt;--watch&lt;/span&gt;
&lt;span class="go"&gt;The SAM CLI will use the AWS Lambda, Amazon API Gateway, and AWS StepFunctions APIs to upload your code without
performing a CloudFormation deployment. This will cause drift in your CloudFormation stack.
**The sync command should only be used against a development stack**.

Confirm that you are synchronizing a development stack.

Enter Y to proceed with the command, or enter N to cancel:
[Y/n]:
Queued infra sync. Waiting for in progress code syncs to complete...
Starting infra sync.
Manifest is not changed for (helloFromLambdaFunction), running incremental build
Building codeuri: /Users/alazaroc/Documents/MyProjects/github/aws/sam/sam-app runtime: nodejs20.x
metadata: {} architecture: x86_64 functions: helloFromLambdaFunction
Running NodejsNpmBuilder:NpmPack
Running NodejsNpmBuilder:CopyNpmrcAndLockfile
Running NodejsNpmBuilder:CopySource
Running NodejsNpmBuilder:CleanUpNpmrc
Running NodejsNpmBuilder:LockfileCleanUp
Running NodejsNpmBuilder:LockfileCleanUp

Build Succeeded

Successfully packaged artifacts and wrote output template to file /var/folders/wq/bz6xngtx5h3f5gf8py3kf28c0000gn/T/tmppcg60qga.
Execute the following command to deploy the packaged template
&lt;/span&gt;&lt;span class="gp"&gt;sam deploy --template-file /var/folders/wq/bz6xngtx5h3f5gf8py3kf28c0000gn/T/tmppcg60qga --stack-name &amp;lt;YOUR STACK NAME&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="go"&gt;

  Deploying with following values
  ===============================
  Stack name                   : sam-app
  Region                       : eu-west-1
  Disable rollback             : False
  Deployment s3 bucket         : aws-sam-cli-managed-default-samclisourcebucket-k2z3x0eqvuxq
  Capabilities                 : ["CAPABILITY_NAMED_IAM", "CAPABILITY_AUTO_EXPAND"]
  Parameter overrides          : {}
  Signing Profiles             : null

Initiating deployment
=====================


2024-01-22 23:43:31 - Waiting for stack create/update to complete

CloudFormation events from stack operations (refresh every 0.5 seconds)
---------------------------------------------------------------------------------------------------------
ResourceStatus             ResourceType               LogicalResourceId          ResourceStatusReason
---------------------------------------------------------------------------------------------------------
UPDATE_IN_PROGRESS         AWS::CloudFormation::Sta   sam-app                    User Initiated
                          ck
UPDATE_IN_PROGRESS         AWS::CloudFormation::Sta   sam-app                    Transformation succeeded
                          ck
CREATE_IN_PROGRESS         AWS::CloudFormation::Sta   AwsSamAutoDependencyLaye   -
                          ck                         rNestedStack
CREATE_IN_PROGRESS         AWS::CloudFormation::Sta   AwsSamAutoDependencyLaye   Resource creation
                          ck                         rNestedStack               Initiated
CREATE_COMPLETE            AWS::CloudFormation::Sta   AwsSamAutoDependencyLaye   -
                          ck                         rNestedStack
UPDATE_IN_PROGRESS         AWS::Lambda::Function      helloFromLambdaFunction    -
UPDATE_COMPLETE            AWS::Lambda::Function      helloFromLambdaFunction    -
UPDATE_COMPLETE_CLEANUP_   AWS::CloudFormation::Sta   sam-app                    -
IN_PROGRESS                ck
UPDATE_COMPLETE            AWS::CloudFormation::Sta   sam-app                    -
                          ck
---------------------------------------------------------------------------------------------------------

Stack update succeeded. Sync infra completed.

Infra sync completed.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The console still listens for changes and if we change our lambda code and save it:&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%2F1iv3dp5xx8bso3fvcgko.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%2F1iv3dp5xx8bso3fvcgko.png" alt="sync lambda" width="600" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The console will be updated automatically as follow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Syncing Lambda Function helloFromLambdaFunction...
Manifest is not changed &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;helloFromLambdaFunction&lt;span class="o"&gt;)&lt;/span&gt;, running incremental build
Building codeuri: /Users/alazaroc/Documents/MyProjects/github/aws/sam/sam-app runtime: nodejs20.x
metadata: &lt;span class="o"&gt;{}&lt;/span&gt; architecture: x86_64 functions: helloFromLambdaFunction
 Running NodejsNpmBuilder:NpmPack
 Running NodejsNpmBuilder:CopyNpmrcAndLockfile
 Running NodejsNpmBuilder:CopySource
 Running NodejsNpmBuilder:CleanUpNpmrc
 Running NodejsNpmBuilder:LockfileCleanUp
 Running NodejsNpmBuilder:LockfileCleanUp
Finished syncing Lambda Function helloFromLambdaFunction.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you stop it (&lt;code&gt;control + C&lt;/code&gt;) in the console it will appear:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;^CShutting down sync watch...
Sync watch stopped.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;When you executed the sync command, a nested stack associated with your main stack (sam-app) was created:&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%2F3h29jc5bv5h08vzen041.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%2F3h29jc5bv5h08vzen041.png" alt="nested stack" width="200" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And when the console stops being synchronized, this nested stack is NOT deleted.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;How to &lt;strong&gt;remove the nested stack&lt;/strong&gt; created with the sync command?&lt;/p&gt;

&lt;p&gt;You have to run the &lt;code&gt;sam deploy&lt;/code&gt; command again and it will be removed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sam deploy
&lt;span class="go"&gt;Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-k2z3x0eqvuxq
      A different default S3 bucket can be set in samconfig.toml
      Or by specifying --s3-bucket explicitly.
  File with same data already exists at sam-app/c20f3d4923fb213486783dd25f269a52, skipping upload

    Deploying with following values
    ===============================
    Stack name                   : sam-app
    Region                       : eu-west-1
    Confirm changeset            : True
    Disable rollback             : False
    Deployment s3 bucket         : aws-sam-cli-managed-default-samclisourcebucket-k2z3x0eqvuxq
    Capabilities                 : ["CAPABILITY_IAM"]
    Parameter overrides          : {}
    Signing Profiles             : {}

  Initiating deployment
  =====================

  File with same data already exists at sam-app/3752a1ab023524618cd64cc55081484c.template, skipping upload


  Waiting for changeset to be created..

  CloudFormation stack changeset
  ---------------------------------------------------------------------------------------------------------
  Operation                  LogicalResourceId          ResourceType               Replacement
  ---------------------------------------------------------------------------------------------------------
  * Modify                   helloFromLambdaFunction    AWS::Lambda::Function      False
  - Delete                   AwsSamAutoDependencyLaye   AWS::CloudFormation::Sta   N/A
                            rNestedStack               ck
  ---------------------------------------------------------------------------------------------------------

  Changeset created successfully. arn:aws:cloudformation:eu-west-1:000000000000:changeSet/samcli-deploy1705963790/6b5464b9-0b8e-44c2-93c0-8e0f509c9110


  Previewing CloudFormation changeset before deployment
  ======================================================
  Deploy this changeset? [y/N]: y

  2024-01-22 23:50:02 - Waiting for stack create/update to complete

  CloudFormation events from stack operations (refresh every 5.0 seconds)
  ---------------------------------------------------------------------------------------------------------
  ResourceStatus             ResourceType               LogicalResourceId          ResourceStatusReason
  ---------------------------------------------------------------------------------------------------------
  UPDATE_IN_PROGRESS         AWS::CloudFormation::Sta   sam-app                    User Initiated
                            ck
  UPDATE_IN_PROGRESS         AWS::Lambda::Function      helloFromLambdaFunction    -
  UPDATE_COMPLETE            AWS::Lambda::Function      helloFromLambdaFunction    -
  UPDATE_COMPLETE_CLEANUP_   AWS::CloudFormation::Sta   sam-app                    -
  IN_PROGRESS                ck
  DELETE_IN_PROGRESS         AWS::CloudFormation::Sta   AwsSamAutoDependencyLaye   -
                            ck                         rNestedStack
  DELETE_COMPLETE            AWS::CloudFormation::Sta   AwsSamAutoDependencyLaye   -
                            ck                         rNestedStack
  UPDATE_COMPLETE            AWS::CloudFormation::Sta   sam-app                    -
                            ck
  ---------------------------------------------------------------------------------------------------------

  Successfully created/updated stack - sam-app in eu-west-1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 7: Clean up
&lt;/h3&gt;

&lt;p&gt;If you are followed this tutorial you will only have one stack in our AWS Account, so you can run the &lt;code&gt;sam delete&lt;/code&gt; command (which deletes the main stack: sam-app).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sam delete
&lt;span class="go"&gt;Are you sure you want to delete the stack sam-app in the region eu-west-1 ? [y/N]: y
Are you sure you want to delete the folder sam-app in S3 which contains the artifacts? [y/N]: y
      - Deleting S3 object with key sam-app/c20f3d4923fb213486783dd25f269a52
      - Deleting S3 object with key sam-app/3752a1ab023524618cd64cc55081484c.template
- Deleting Cloudformation stack sam-app

Deleted successfully
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Next steps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;If you need more information about SAM I recommend you to visit the AWS documentation &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Next post: &lt;a href="https://playingaws.com/posts/how-to-add-ci-cd-to-my-sam-project/" rel="noopener noreferrer"&gt;How to add CI/CD to my SAM project&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Comment this post&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>sam</category>
      <category>serverless</category>
      <category>iac</category>
      <category>aws</category>
    </item>
    <item>
      <title>Introduction to AWS SAM (Serverless Application Model)</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Tue, 23 Jan 2024 17:57:30 +0000</pubDate>
      <link>https://dev.to/aws-builders/introduction-to-aws-sam-serverless-application-model-12oc</link>
      <guid>https://dev.to/aws-builders/introduction-to-aws-sam-serverless-application-model-12oc</guid>
      <description>&lt;p&gt;I've decided to repost an article I originally published on my blog &lt;a href="https://playingaws.com/posts/how-to-create-serverless-applications-with-sam" rel="noopener noreferrer"&gt;here&lt;/a&gt; two years ago, but this isn't just a simple repost. After rereading the original pieces, labeled as '22 min read' and '20 min read,' I realized updates were necessary. Consequently, I've thoroughly reviewed, updated, and reorganized all the content to ensure it remains relevant and up-to-date.&lt;/p&gt;

&lt;p&gt;I will create an &lt;code&gt;AWS SAM series&lt;/code&gt; featuring 3 articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Introduction to AWS SAM (Serverless Application Model)&lt;/li&gt;
&lt;li&gt;How to create serverless applications with AWS SAM (Serverless Application Model)&lt;/li&gt;
&lt;li&gt;How to add CI/CD to my SAM project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will be my first series of articles here.&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The first thing to understand is the relationship between serverless applications and AWS SAM, followed by a review of the basics.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a serverless application?
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;serverless application&lt;/strong&gt; is more than just a Lambda Function. It is a &lt;code&gt;combination of&lt;/code&gt; Lambda functions, event sources, APIs, databases, and other &lt;code&gt;resources that work together to perform tasks&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is AWS SAM?
&lt;/h3&gt;

&lt;p&gt;The AWS &lt;code&gt;Serverless Application Model&lt;/code&gt; (AWS SAM) is an &lt;a href="https://github.com/aws/serverless-application-model" rel="noopener noreferrer"&gt;open-source framework&lt;/a&gt; that you can use to build serverless applications on AWS. SAM is an &lt;code&gt;extension of AWS CloudFormation&lt;/code&gt; but SAM is streamlined and specifically designed for Serverless resources.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SAM is the specific IaC solution of AWS for defining and deploying serverless applications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Benefits of SAM
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local Testing and Debugging&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;With the &lt;code&gt;aws sam cli&lt;/code&gt; you can execute and test your serverless applications on your local environment (by mounting a docker image and running the code)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Extension of AWS Cloud Formation&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;You get reliability on the deployment capabilities&lt;/li&gt;
&lt;li&gt;You can use the &lt;code&gt;SAM yaml template&lt;/code&gt; with all of the resources that are available in CloudFormation&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Single Deployment Configuration&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;You can easily manage all your necessary resources in one single place that belongs to the same stack&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Built-in best practices&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;You can define and deploy your Infrastructure as Config&lt;/li&gt;
&lt;li&gt;you can enforce code reviews&lt;/li&gt;
&lt;li&gt;you can enable safe deployments through &lt;code&gt;CodeDeploy&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;you can enable tracing by using &lt;code&gt;AWS X-Ray&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Deep integration with development tools&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;AWS Serverless Application Repository: discover new applications&lt;/li&gt;
&lt;li&gt;AWS Cloud9 IDE: For authoring, testing, and debugging. &lt;a href="https://dev.to/posts/mastering-aws-cloud9-for-docker-deployment/"&gt;I have written a post about Cloud9; you can find it here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;CodeBuild, CodeDeploy, and CodePipeline: To build a deployment pipeline&lt;/li&gt;
&lt;li&gt;AWS CodeStar: To get started with a project structure, code repository, and a CI/CD pipeline that's automatically configured for you&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Basics
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;We will use &lt;code&gt;NodeJS&lt;/code&gt; as programming language. However, as AWS Says in the &lt;a href="https://aws.amazon.com/serverless/sam/faqs/" rel="noopener noreferrer"&gt;FAQs&lt;/a&gt;, you can use AWS SAM to build serverless applications that use any runtime supported by AWS Lambda.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To understand the code structure of the SAM projects, five files are particularly important:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Common to all the programming languages:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;template.yaml&lt;/strong&gt;: This file contains the AWS SAM template that defines your application's AWS resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;events&lt;/strong&gt;/file.json: &lt;code&gt;events&lt;/code&gt; folder contains the invocation events that you can use to invoke the function.

&lt;ul&gt;
&lt;li&gt;Depends on the programming language (in this case &lt;code&gt;NodeJS&lt;/code&gt;), so it will be different in each case (but the idea is the same):&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;src&lt;/strong&gt;/handlers/file.js: &lt;code&gt;src&lt;/code&gt; folder contains the code for the application's Lambda Function.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;__tests&lt;/strong&gt;__/unit/handlers/file.test.js: &lt;code&gt;test&lt;/code&gt; folder contains the unit tests for the application code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;package.json&lt;/strong&gt;: This file of NodeJS contains the application dependencies and is used for the &lt;code&gt;sam build&lt;/code&gt;. If you are using Python language instead of NodeJS, the file will be &lt;strong&gt;requirements.txt&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  AWS SAM template anatomy
&lt;/h3&gt;

&lt;p&gt;This is the structure of the &lt;code&gt;template.yaml&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# The AWSTemplateFormatVersion identifies the capabilities of the template&lt;/span&gt;
&lt;span class="c1"&gt;# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/format-version-structure.html&lt;/span&gt;
&lt;span class="na"&gt;AWSTemplateFormatVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;2010-09-09'&lt;/span&gt;
&lt;span class="c1"&gt;# Optional: description&lt;/span&gt;
&lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;&amp;gt;-&lt;/span&gt;
  &lt;span class="s"&gt;Any text here.&lt;/span&gt;
  &lt;span class="s"&gt;Multi-line&lt;/span&gt;

&lt;span class="c1"&gt;# Transform section specifies one or more macros that AWS CloudFormation uses to process your template&lt;/span&gt;
&lt;span class="c1"&gt;# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html&lt;/span&gt;
&lt;span class="na"&gt;Transform&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Serverless-2016-10-31&lt;/span&gt;  

&lt;span class="c1"&gt;# Optional: Globals section defines properties that are common to all your serverless functions and APIs&lt;/span&gt;
&lt;span class="na"&gt;Globals&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;Function&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
    &lt;span class="na"&gt;MemorySize&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;128&lt;/span&gt;
    &lt;span class="na"&gt;Tracing&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Active&lt;/span&gt;
    &lt;span class="na"&gt;Tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;iac&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;SAM&lt;/span&gt;

&lt;span class="c1"&gt;# Optional: provides additional information about the template&lt;/span&gt;
&lt;span class="na"&gt;Metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;template metadata&lt;/span&gt;

&lt;span class="c1"&gt;# Optional: Values to pass to your template at runtime (when you create or update a stack).&lt;/span&gt;
&lt;span class="na"&gt;Parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;set of parameters&lt;/span&gt;

&lt;span class="c1"&gt;# Optioal: A mapping of keys and associated values that you can use to specify conditional parameter values, similar to a lookup table&lt;/span&gt;
&lt;span class="na"&gt;Mappings&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;set of mappings&lt;/span&gt;

&lt;span class="c1"&gt;# Optional: conditions that control whether certain resources are created or whether certain resource properties are assigned a value during stack creation or update&lt;/span&gt;
&lt;span class="na"&gt;Conditions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;set of conditions&lt;/span&gt;

&lt;span class="c1"&gt;# Resources declares the AWS resources that you want to include in the stack.&lt;/span&gt;
&lt;span class="c1"&gt;# Resources section can contain a combination of AWS CloudFormation resources and AWS SAM resources&lt;/span&gt;
&lt;span class="c1"&gt;# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html&lt;/span&gt;
&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;set of resources&lt;/span&gt;

&lt;span class="c1"&gt;# Optional: The values that are returned whenever you view your stack's properties&lt;/span&gt;
&lt;span class="na"&gt;Outputs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;set of outputs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More information &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;AWS CLI

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html" rel="noopener noreferrer"&gt;how to install it&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html" rel="noopener noreferrer"&gt;how configure it&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;AWS SAM CLI (&lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;)&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example of SAM application
&lt;/h2&gt;

&lt;p&gt;Let's start reviewing one example of the SAM application to show some options about what we can do here.&lt;/p&gt;

&lt;p&gt;I will show you the part of the &lt;code&gt;template.yaml&lt;/code&gt; file which affects the specific service.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It's important to remember that you can incorporate CloudFormation resources into our SAM template. However, AWS SAM offers specific resources that are specially tailored for creating Lambda Functions, API Gateway, AppSync, DynamoDB, Step Functions, among several other services. All the relevant information can be found &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-resources-and-properties.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Example of Lambda Function
&lt;/h3&gt;

&lt;p&gt;The first special type, and more important, is the &lt;code&gt;AWS::Serverless::Function&lt;/code&gt;, which you should use to create Lambda Functions (more information &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="c1"&gt;# Each Lambda function is defined by properties:&lt;/span&gt;
  &lt;span class="c1"&gt;# https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction&lt;/span&gt;

  &lt;span class="c1"&gt;# This is a Lambda function config associated with the source code: hello-from-lambda.js&lt;/span&gt;
  &lt;span class="na"&gt;HelloWorldFunction&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Serverless::Function&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;Handler&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;src/handlers/hello-from-lambda.helloFromLambdaHandler&lt;/span&gt;
      &lt;span class="na"&gt;Runtime&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nodejs14.x&lt;/span&gt;
      &lt;span class="na"&gt;Architectures&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;x86_64&lt;/span&gt;
      &lt;span class="na"&gt;MemorySize&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;128&lt;/span&gt;
      &lt;span class="na"&gt;Timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;
      &lt;span class="na"&gt;Description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;A Lambda function that returns a static string.&lt;/span&gt;
      &lt;span class="na"&gt;Policies&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Give Lambda basic execution Permission to the helloFromLambda&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;AWSLambdaBasicExecutionRole&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Adding an API Gateway
&lt;/h3&gt;

&lt;p&gt;To add the API Gateway resource you can use the specific type of &lt;code&gt;AWS::Serverless::Api&lt;/code&gt; (more information &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;...&lt;/span&gt;
  &lt;span class="s"&gt;BasicAWSApiGateway&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Serverless::Api&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;Name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Basic AWS Api Gateway resource&lt;/span&gt;
      &lt;span class="na"&gt;StageName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;poc&lt;/span&gt;
      &lt;span class="s"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also add a trigger in the Lambda Function updating the section &lt;code&gt;Events&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;HelloWorldFunction&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="s"&gt;...&lt;/span&gt;
      &lt;span class="s"&gt;Events&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;HelloWorld&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Api&lt;/span&gt;
          &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;Path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
            &lt;span class="na"&gt;Method&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;get&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you should create in &lt;code&gt;events&lt;/code&gt; folder the &lt;code&gt;json&lt;/code&gt; definition of the method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"httpMethod"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Adding an scheduled event to the Lambda Function
&lt;/h3&gt;

&lt;p&gt;Including a scheduled event to the Lambda Function is quite similar to adding an API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;HelloWorldFunction&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="s"&gt;...&lt;/span&gt;
      &lt;span class="s"&gt;Events&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;CloudWatchEvent&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Schedule&lt;/span&gt;
          &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;Schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cron(0 * * * ? *)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you should create in &lt;code&gt;events&lt;/code&gt; folder the &lt;code&gt;json&lt;/code&gt; definition of the rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cdc73f9d-aea9-11e3-9d5a-835b769c0d9c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"detail-type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Scheduled Event"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"source"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"aws.events"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"account"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1970-01-01T00:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"region"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"us-west-2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"resources"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:events:us-west-2:xxxxxxxxxxxx:rule/ExampleRule"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"detail"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Adding the SNS topic resource
&lt;/h3&gt;

&lt;p&gt;In this case, I will include the Lambda Function as a subscriber of my SNS topic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;...&lt;/span&gt;
  &lt;span class="s"&gt;SnsTopicAsTriggerOfLambdaFunction&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::SNS::Topic&lt;/span&gt;
    &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;TopicName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;${ResourcesName}'&lt;/span&gt;
      &lt;span class="na"&gt;DisplayName &lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Topic used for trigger the lambda function&lt;/span&gt;
      &lt;span class="na"&gt;Subscription&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;Protocol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;lambda&lt;/span&gt;
          &lt;span class="na"&gt;Endpoint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!GetAtt&lt;/span&gt; &lt;span class="s"&gt;HelloWorldFunction.Arn&lt;/span&gt;
      &lt;span class="na"&gt;TracingConfig&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Active&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Saving one property in the SSM Parameter Store
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;...&lt;/span&gt;
  &lt;span class="s"&gt;MySnsTopicArnParameter&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::SSM::Parameter&lt;/span&gt;
      &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;Name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/general/sns/topic-test&lt;/span&gt;
        &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
        &lt;span class="na"&gt;Value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;SnsTopicAsTriggerOfLambdaFunction&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  More examples
&lt;/h3&gt;

&lt;p&gt;As you can see, you can add any resource using the usual &lt;code&gt;CloudFormation code&lt;/code&gt; inside the &lt;code&gt;template.yaml&lt;/code&gt; file.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I recommend that you run &lt;code&gt;aws sam init&lt;/code&gt; and try to create different projects from the templates.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>aws</category>
      <category>sam</category>
      <category>serverless</category>
      <category>iac</category>
    </item>
    <item>
      <title>Using AWS Cloud9 to Test and Deploy Docker Applications: A Step-by-Step Guide</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Thu, 18 Jan 2024 07:44:04 +0000</pubDate>
      <link>https://dev.to/aws-builders/using-aws-cloud9-to-test-and-deploy-docker-applications-a-step-by-step-guide-2pg2</link>
      <guid>https://dev.to/aws-builders/using-aws-cloud9-to-test-and-deploy-docker-applications-a-step-by-step-guide-2pg2</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;I first wrote this post &lt;a href="https://www.playingaws.com/posts/mastering-aws-cloud9-for-docker-deployment/" rel="noopener noreferrer"&gt;here on my own blog&lt;/a&gt;. You will find much more content there.&lt;/p&gt;

&lt;p&gt;This is the guide I would have liked to find before I started using AWS Cloud9. There are many similar articles out there, but none quite like this one, or at least, I didn't find any!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS Cloud9 is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a browser.&lt;/li&gt;
&lt;li&gt;It includes a code editor, debugger, and terminal.&lt;/li&gt;
&lt;li&gt;You already have pre-installed the main tools you will need to download and create your code (including git or docker).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction to AWS Cloud9
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;Have you ever been frustrated by the restrictions of your local development environment?&lt;/code&gt; If so, you're not the only one.&lt;/p&gt;

&lt;p&gt;Enter AWS Cloud9, &lt;code&gt;cloud-based Integrated Development Environment (IDE)&lt;/code&gt; that stands apart with its seamless Docker integration and browser-based accessibility, liberating you from the constraints of traditional setups. Imagine running code, debugging, and integrating Docker applications directly from your browser, without the usual setup headaches. That's the power of Cloud9.&lt;/p&gt;

&lt;p&gt;In this article, we delve into how Cloud9 doesn't just offer convenience but brings a new level of power and versatility to your coding experience. Its robust code editor, efficient debugger, and integrated terminal transform coding into a streamlined, hassle-free process. This is especially crucial for projects that demand flexibility, such as serverless applications or containerized apps. With Cloud9, the world of cloud-based development is at your fingertips, allowing you to focus more on creating and less on configuring. Let's explore how Cloud9 can revolutionize your workflow and take your development projects to new heights.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages and Limitations
&lt;/h3&gt;

&lt;p&gt;To give you a clear picture, here are the foremost strengths and weaknesses.&lt;/p&gt;

&lt;h4&gt;
  
  
  Advantages:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Integrated Development Environment&lt;/code&gt;: Cloud9 offers a comprehensive IDE setup directly in the cloud. This means you can bypass the often tedious process of configuring your local environment, streamlining your development process significantly.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Accessibility&lt;/code&gt;: With its cloud-based nature, Cloud9 provides the flexibility to code from anywhere. Whether you're at home, in a café, or halfway across the world, all you need is an internet connection and you're ready to code.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AWS Integration&lt;/code&gt;: Cloud9's integration with AWS services is seamless, enhancing your workflow efficiency. This includes direct access to the AWS CLI, easy integration with AWS CodeCommit, and more, making it a breeze to manage AWS-related tasks within the IDE.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Collaborative Features&lt;/code&gt;: The platform supports real-time collaboration, allowing multiple developers to work on the same project simultaneously. This feature is invaluable for team projects and paired programming sessions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Limitations:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Cost Factor&lt;/code&gt;: While Cloud9 offers an abundant set of features, it's important to note that it's not entirely free. Usage beyond the AWS free tier involves costs, such as running an EC2 instance or a server. For instance, in Ireland, a t2.micro instance costs about $0.0126 per hour.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Internet Dependency&lt;/code&gt;: As a cloud-based IDE, Cloud9 requires a stable and continuous internet connection. This could be a drawback in environments with limited or unreliable internet access.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Limited Customization&lt;/code&gt;: When compared to some local IDEs, Cloud9 might have limitations in terms of customization options. While it offers a range of functionalities, developers accustomed to highly personalized local environments might find this aspect slightly restrictive.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Starting with Cloud9
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Initializing Your Cloud9 Environment
&lt;/h3&gt;

&lt;p&gt;Setting up your AWS Cloud9 environment is a straightforward process. Here's how you can do it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Access AWS Cloud9 Service&lt;/code&gt;: Log in to your AWS account and navigate to the Cloud9 service.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Create a New Environment&lt;/code&gt;: Select the Create a new environment option. Here, you'll need to provide some details:

&lt;ul&gt;
&lt;li&gt;Instance Type: Choose the appropriate EC2 instance type based on your project needs.&lt;/li&gt;
&lt;li&gt;Timeout Settings: Set the desired idle time after which the instance should shut down to save resources.&lt;/li&gt;
&lt;li&gt;Network Settings: Configure network settings as per your requirements.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Start the Environment&lt;/code&gt;: Once you've configured these options, AWS will initiate the EC2 instance. To enter the Cloud9 IDE, click the Open button, and a new browser tab will launch with your environment.&lt;/li&gt;
&lt;/ol&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%2F9xfr1sppvn0re7tricg7.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%2F9xfr1sppvn0re7tricg7.png" alt="Open Cloud9 environment" width="600" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Managing Your Environment Post-Use
&lt;/h3&gt;

&lt;p&gt;You have to know how to stop the environment if you want to reuse it.&lt;/p&gt;

&lt;p&gt;You have different options.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Stopping the Instance in the EC2 console&lt;/code&gt;: If you stop the EC2 instance, the environment will be stopped. However, if you leave the IDE open in the browser, the instance will be initialized again. Be careful.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Closing the IDE in the browser&lt;/code&gt;: Closing the IDE leads to the automatic stopping of the EC2 instance &lt;code&gt;after the defined timeout&lt;/code&gt;, helping save resources.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Important Note: If you terminate the EC2 instance via the EC2 console, &lt;code&gt;the Cloud9 environment remains but becomes inaccessible&lt;/code&gt;, leading to errors when trying to re-access it. Therefore, terminate the instance only if you intend to permanently remove the environment.&lt;br&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%2Fy3k8oi4kcnf4jpy44iga.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%2Fy3k8oi4kcnf4jpy44iga.png" alt="error: unable to access" width="450" height="174"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Sharing your environment
&lt;/h3&gt;

&lt;p&gt;Cloud9 also allows for &lt;code&gt;collaborative work&lt;/code&gt;. You can share your development environment with another IAM user within AWS:&lt;br&gt;
In the IDE, use the Share option to grant access to another user.&lt;/p&gt;

&lt;p&gt;These environments will then appear under 'My environments' or 'Shared with me' in the AWS Cloud9 service, facilitating easy collaboration.&lt;/p&gt;
&lt;h2&gt;
  
  
  Working with Cloud9
&lt;/h2&gt;

&lt;p&gt;Now that your Cloud9 environment is set up, let's explore some tasks you can perform within this versatile IDE.&lt;/p&gt;
&lt;h3&gt;
  
  
  Integration with git repositories
&lt;/h3&gt;

&lt;p&gt;Version control integration is a crucial first step in any development project, and Cloud9 simplifies this with its seamless Git integration.&lt;/p&gt;

&lt;p&gt;With Cloud9, you can effortlessly connect with AWS CodeCommit or other Git repositories, streamlining your workflow. Here’s how you can clone a repository:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Cloning from &lt;code&gt;GitHub&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;I have created &lt;a href="https://github.com/alazaroc/microservices" rel="noopener noreferrer"&gt;this public repository with 2 microservices&lt;/a&gt;, (one in Node.js and the other in Python). You can use it to follow this tutorial.&lt;/p&gt;

&lt;p&gt;Use the command below to clone&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/alazaroc/microservices.git
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Cloning from AWS &lt;code&gt;CodeCommit&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;The integration is straightforward. You don’t have to manage permissions, users, or anything like that. You can directly clone the CodeCommit code:&lt;/p&gt;

&lt;p&gt;The following is an example of how you can clone the CodeCommit repository (you have to use your own repository):&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone codecommit::eu-west-1://microservices
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;After cloning, your application code is immediately accessible in the IDE, ready for the next steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prepare the application for Testing
&lt;/h3&gt;

&lt;p&gt;Before diving into testing, there are a couple of essential steps we need to take to ensure our application is ready and accessible.&lt;/p&gt;

&lt;h4&gt;
  
  
  Security Group Configuration
&lt;/h4&gt;

&lt;p&gt;To ensure our application is accessible and secure, we first need to address the &lt;code&gt;Security Group settings&lt;/code&gt; in our Cloud9 EC2 instance. Initially, it comes with no inbound rules, which means external access is restricted. This is a crucial aspect of AWS's security-first approach, minimizing vulnerabilities.&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%2Fq4ph6durpkyuov1qf1vg.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%2Fq4ph6durpkyuov1qf1vg.png" alt="Security group configuration" width="600" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, to test our application from outside, we'll need to modify these settings by adding specific inbound rules, allowing traffic on necessary ports while keeping our instance secure.&lt;/p&gt;

&lt;h4&gt;
  
  
  Third-party cookies
&lt;/h4&gt;

&lt;p&gt;In your browser settings, ensure that third-party cookies or cross-site tracking is enabled. This step is crucial for certain functionalities within Cloud9 to work seamlessly. Without this setting, you might encounter issues or error messages in the preview phase.&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%2F3f921ajhop17sgdifcov.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%2F3f921ajhop17sgdifcov.png" alt="third party cookies warning" width="400" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing your application
&lt;/h3&gt;

&lt;p&gt;Now, let's proceed to test two microservices – one built with &lt;code&gt;Node.js&lt;/code&gt; and the other with &lt;code&gt;Python&lt;/code&gt;. You can find the sample code for these microservices &lt;a href="https://github.com/alazaroc/microservices" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These two applications are prepared to be executed locally directly (after installation of the packages/libraries), but they also contain a Dockerfile, so they are containerized and we can use docker to test them.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Docker and Cloud9 together create a robust environment for containerized application development. &lt;br&gt;
Docker encapsulates the application environment, ensuring consistency across different stages of development. &lt;br&gt;
This integration with Cloud9 enhances productivity and &lt;code&gt;reduces the 'it works on my machine' syndrome&lt;/code&gt;. We'll delve into how Dockerizing our Node.js and Python applications within Cloud9 streamlines the development and deployment processes, making our applications more portable and scalable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Node.js application
&lt;/h4&gt;

&lt;h5&gt;
  
  
  Installation
&lt;/h5&gt;

&lt;p&gt;Install the required npm packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Running the Application
&lt;/h5&gt;

&lt;p&gt;To start the Node.js microservice, use the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node app.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Alternatively, you can open the &lt;code&gt;app.js&lt;/code&gt; file and click on the &lt;code&gt;Run&lt;/code&gt; button in the Cloud9 IDE.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The server will start and be available at &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Accessing the Application
&lt;/h5&gt;

&lt;p&gt;Now that our application is running, the next step is to verify its functionality. AWS Cloud9 offers two primary methods to access your running application:&lt;/p&gt;

&lt;h6&gt;
  
  
  Preview running application
&lt;/h6&gt;

&lt;p&gt;If you try to preview the application running in this port 3000, you will receive a message 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%2Fa7dkxv1pr04vverj6f0m.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%2Fa7dkxv1pr04vverj6f0m.png" alt="running docker apps" width="750" height="465"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You aren't required run using HTTP over port 8080, 8081, or 8082. &lt;code&gt;If you don't do this, you can't preview your running application from within the IDE&lt;/code&gt;. For more information, see &lt;a href="https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html#app-preview-preview-app" rel="noopener noreferrer"&gt;Preview a running application&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In our case we are using the port 3000, so we can't use the preview functionality.&lt;/p&gt;

&lt;p&gt;If you change the application port for 8080, then, you are able to do it:&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%2Fee0s633ktbbt9n1vgl4o.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%2Fee0s633ktbbt9n1vgl4o.png" alt="running docker apps in port 8080" width="750" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h6&gt;
  
  
  Using the public IP of the instance
&lt;/h6&gt;

&lt;p&gt;If changing the port is not an option or if you prefer external access, you can use the public IP of the EC2 instance. Here’s how to find your instance's public IP and access the application:&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%2Fbqk39th6s5bj90m7bf64.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%2Fbqk39th6s5bj90m7bf64.png" alt="running docker apps with public ip" width="750" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Dockerization
&lt;/h5&gt;

&lt;p&gt;To build the Docker image of the application, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;-t&lt;/span&gt; ms-nodejs &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run the application as a Docker container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-p&lt;/span&gt; 3000:3000 &lt;span class="nt"&gt;--name&lt;/span&gt; ms-nodejs ms-nodejs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Python application
&lt;/h4&gt;

&lt;h5&gt;
  
  
  Installation
&lt;/h5&gt;

&lt;p&gt;Install the required Python packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;Flask requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Running the Application
&lt;/h5&gt;

&lt;p&gt;To run the microservice, execute the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python app.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, the server starts at &lt;a href="http://localhost:5000" rel="noopener noreferrer"&gt;http://localhost:5000&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Refer to the Node.js application section to know how to access this URL.&lt;/p&gt;

&lt;h5&gt;
  
  
  Dockerization
&lt;/h5&gt;

&lt;p&gt;To build the Docker image, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker build &lt;span class="nt"&gt;-t&lt;/span&gt; ms-python &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run the application as a Docker container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-p&lt;/span&gt; 5000:5000 &lt;span class="nt"&gt;--name&lt;/span&gt; ms-python ms-python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pushing Docker Images to Amazon ECR
&lt;/h3&gt;

&lt;p&gt;The next step, after building and testing the Docker images of these 2 applications is upload them to &lt;code&gt;Amazon Elastic Container Registry&lt;/code&gt; (ECR).&lt;/p&gt;

&lt;h4&gt;
  
  
  Create the ECR repositories
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ecr create-repository &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--repository-name&lt;/span&gt; ms-nodejs &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--image-scanning-configuration&lt;/span&gt; &lt;span class="nv"&gt;scanOnPush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt; eu-west-1
aws ecr create-repository &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--repository-name&lt;/span&gt; ms-python  &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--image-scanning-configuration&lt;/span&gt; &lt;span class="nv"&gt;scanOnPush&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt; eu-west-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Get the local images
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker images 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fgztsqflk7dg5hro8d3ik.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%2Fgztsqflk7dg5hro8d3ik.png" alt="Docker images" width="786" height="73"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Login to ECR
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ecr get-login-password &lt;span class="nt"&gt;--region&lt;/span&gt; eu-west-1 | docker login &lt;span class="nt"&gt;--username&lt;/span&gt; AWS &lt;span class="nt"&gt;--password-stdin&lt;/span&gt; xxxxxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Replace &lt;code&gt;xxxxxxxxxxxx&lt;/code&gt; by your account_number&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Push images to ECR
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker tag edSae8fef003 xxxxxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/ms-python:latest
docker push xxxxxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/ms-python:latest

docker tag fa3757c48c72 xxxxxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/ms-nodejs:latest
docker push xxxxxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/ms-nodejs:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Replace &lt;code&gt;edSae8fef003&lt;/code&gt; and &lt;code&gt;fa3757c48c72&lt;/code&gt; by your ms_nodejs and ms_python images ids&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;We've journeyed through setting up AWS Cloud9, integrating it with Git repositories, testing Docker applications, and finally, pushing Docker images to Amazon ECR. This walkthrough demonstrates the seamless integration and powerful capabilities of AWS Cloud9 in managing Docker-based projects.&lt;/p&gt;

&lt;p&gt;Now, as you embark on applying these insights to your development endeavors, remember that each project is a unique mosaic of challenges and learning opportunities. I encourage you to not just use Cloud9, but to experiment with it, mold it into your workflow, and uncover the myriad ways it can amplify your productivity and creativity within the AWS ecosystem.&lt;/p&gt;

&lt;p&gt;But don't let the journey end here. Your experiences, insights, and innovations are invaluable – and sharing them creates a rich tapestry of knowledge that benefits the entire development community. &lt;code&gt;I invite you to use the comments section below&lt;/code&gt; as a platform to share your own stories with Cloud9. How has it transformed your development process? What unique challenges have you overcome using it? Your shared experiences are not just stories; they're the waypoints for others in their journey of cloud-based development.&lt;/p&gt;

&lt;p&gt;Together, let's continue to explore, innovate, and elevate the art of development with AWS Cloud9. Dive in, share your story, and let's all grow as a community of forward-thinking developers.&lt;/p&gt;

&lt;p&gt;If you want to find much more content like this you can check my aws blog: &lt;a href="https://www.playingaws.com" rel="noopener noreferrer"&gt;https://www.playingaws.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud9</category>
      <category>developer</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Challenge: 'AWS Certified Data Analytics Specialty' in 30 days [before to be retired - April 9, 2024]</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Sun, 12 Nov 2023 14:57:20 +0000</pubDate>
      <link>https://dev.to/aws-builders/challenge-aws-certified-data-analytics-specialty-in-30-days-before-to-be-retired-april-9-2024-29m5</link>
      <guid>https://dev.to/aws-builders/challenge-aws-certified-data-analytics-specialty-in-30-days-before-to-be-retired-april-9-2024-29m5</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;I wrote this article in first place in my own blog, &lt;a href="https://www.playingaws.com/posts/challenge-data-certification-in-30-days/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/challenge-data-certification-in-30-days/&lt;/a&gt;, but I want to post it here to expose it to all interested people!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;AWS Certified Data Analytics Specialty&lt;/code&gt; is going to be retired on April 9, 2024. You still have time to do it. However, you have another option, AWS presented a new &lt;code&gt;Data&lt;/code&gt; certification of the Associate level, &lt;code&gt;AWS Certified Data Engineer&lt;/code&gt;, you have more information &lt;a href="https://aws.amazon.com/certification/certified-data-engineer-associate/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are here, it's likely because you're eager to obtain the certification, or perhaps you're curious about the insights I've shared in this guide!&lt;/p&gt;

&lt;p&gt;In either case, rest assured that this guide is a firsthand account of my successful journey to achieve the AWS Certified Data Analytics Specialty certification. I conquered the exam on &lt;code&gt;October 15th&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If I could do it, you certainly can too.&lt;/p&gt;

&lt;p&gt;I didn't have experience in data analytics (not enough) and neither specific knowledge, but I wanted to prepare the certification because I wanted to get more knowledge in this area. I am a Cloud &amp;amp; Solutions Architect who wanted to know how to design, build, secure, and maintain analytics solutions using AWS tools and services. However, this &lt;code&gt;certification is not easy&lt;/code&gt; and I had to dedicate a lot of hours to be prepared to pass the exam.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I will use in this article &lt;code&gt;[30 days]&lt;/code&gt; to prepare the certification's journey. However, remember, everyone's learning pace is different. Adjust the suggested plan based on your comfort level and progress. You could need more or less than 30 days.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Welcome to the challenge of achieving the &lt;code&gt;AWS Certified Data Analytics Specialty&lt;/code&gt; certification in just 30 days!&lt;/p&gt;

&lt;p&gt;In this article, we will embark on a journey together to prepare for and conquer this certification. Whether you are an AWS Solutions Architect or a data enthusiast looking to expand your knowledge and credentials, this challenge will provide you with the guidance and resources needed to succeed.&lt;/p&gt;

&lt;p&gt;Good luck with your certification journey!&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenge: 'AWS Certified Data Analytics Specialty' in 30 days
&lt;/h2&gt;

&lt;p&gt;I wrote this other article about &lt;a href="https://www.playingaws.com/posts/10-steps-to-prepare-any-aws-certification/" rel="noopener noreferrer"&gt;10 steps to prepare any AWS Certification&lt;/a&gt;, and I will follow those 10 steps in this challenge. This is the summary:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find the proper certification for you&lt;/li&gt;
&lt;li&gt;Find your WHY: Motivation is the key&lt;/li&gt;
&lt;li&gt;Create a study plan&lt;/li&gt;
&lt;li&gt;Take the official AWS Exam Readiness course&lt;/li&gt;
&lt;li&gt;Choose a main training course&lt;/li&gt;
&lt;li&gt;Practice using the AWS console to gain hands-on experience&lt;/li&gt;
&lt;li&gt;Read the recommended whitepapers&lt;/li&gt;
&lt;li&gt;Read the recommended FAQs&lt;/li&gt;
&lt;li&gt;Take your own notes (and study them)&lt;/li&gt;
&lt;li&gt;Practice with exam-style questions (tests)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Day 1: validate that the Data analytics certification is right for you and know what is your motivation (WHY)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Validate that the certification is right for you (step 1)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;[x] Read exam guide&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this challenge, our goal is to obtain the &lt;code&gt;AWS Certified Data Analytics Specialty&lt;/code&gt; certification, so it is important to carefully read the exam guide and ensure that this certification aligns with your goals and aspirations:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Data Analytics &lt;a href="https://aws.amazon.com/certification/certified-data-analytics-specialty/?nc1=h_ls" rel="noopener noreferrer"&gt;exam landing page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Data Analytics &lt;a href="https://d1.awsstatic.com/training-and-certification/docs-data-analytics-specialty/AWS-Certified-Data-Analytics-Specialty_Exam-Guide.pdf" rel="noopener noreferrer"&gt;Exam guide&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[x] Decide if you want to achieve the certification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am far from being the &lt;code&gt;target candidate&lt;/code&gt; described in the exam guide:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The target candidate should have &lt;code&gt;5 years of experience with common data analytics technologies&lt;/code&gt;. The target candidate also should have at least &lt;code&gt;2 years of hands-on experience&lt;/code&gt; and expertise working with AWS services to design, build, secure, and maintain analytics solutions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It means that I need to intensify my efforts and commence my journey with a solid grasp of the essentials.&lt;/p&gt;

&lt;h4&gt;
  
  
  Motivation (step 2)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;[x] WHY?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before starting, you must have a very good reason to do it, good enough to not quit in the middle.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What are your reasons for getting this new AWS certification?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In my case, I need the Data certification because I don't have as much experience in data projects as I want, and &lt;code&gt;I truly wanted to learn how to design, build, secure, and maintain analytics solutions using AWS tools and services&lt;/code&gt; so that I can collaborate in a helpful way on data projects. The second reason is because the data certification is the nearest one to an event driven solution, and I want to be involved in this solutions in the future.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your motivation is your WHY. How powerful to you is your WHY to you? &lt;/p&gt;

&lt;p&gt;If it is not good enough, probably you are going to give up...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Day 2: Target date, buy the exam and create the study plan (step 3)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[x] Purchase the exam&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My target date was one month away, so I purchased the exam to do it even more real. I usually set a target date and buy the exam to motivate myself. Don't worry, you can always reschedule the exam twice for free with at least a minimum of 24 hours prior notice. I had to reschedule exams several times, but it is a good idea have a date in mind from the beginning.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I strongly recommend you request the time extension of 30 minutes if English is not your mother tongue.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[x] Create a study plan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Like I said, we will follow these &lt;a href="https://www.playingaws.com/posts/10-steps-to-prepare-any-aws-certification/" rel="noopener noreferrer"&gt;10 steps to prepare any AWS Certification&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You have to allocate time to prepare the exam. When creating your study plan, it is important to &lt;code&gt;be realistic about the amount of time you can commit to studying&lt;/code&gt;. Be sure to factor in other commitments, such as work, family, and social obligations.&lt;/p&gt;

&lt;p&gt;Probably your plan will change and you need to be flexible, but it is a good idea try to plan all the things you want to do to prepare the exam.&lt;/p&gt;

&lt;p&gt;These are all the tasks that I had to do to prepare the exam, with an estimated amount of time [&lt;code&gt;updated&lt;/code&gt;: I had to spend more hours in practically all the tasks]:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;8h: Learn the basics of data analytics&lt;/li&gt;
&lt;li&gt;4h of online content (so I will spend at least 8 hours)&lt;/li&gt;
&lt;li&gt;Xh: Take a main training course. I will left here different options for you (there are many many more).&lt;/li&gt;
&lt;li&gt;4h (my estimation) - Whitepapers:&lt;/li&gt;
&lt;li&gt;5h (my estimation) - FAQs&lt;/li&gt;
&lt;li&gt;20h (my estimation) - Practice with the main services (list above)&lt;/li&gt;
&lt;li&gt;8h (my estimation) - Take my own notes and study it&lt;/li&gt;
&lt;li&gt;8h (my estimation) - Practice exam questions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Day 3 - Starting with the basics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[x] Introduction to AWS Data Analytics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In my case, I had to start with the basics, so I decided to spend one full day and also writing this article about the &lt;a href="https://dev.to/posts/introduction-to-data-analytics/"&gt;Introduction to Data Analytics&lt;/a&gt;. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Initially I have included all the information in the same article but it was too long so I decided separate, also because maybe you are not interested in the introduction to the Data Analytics!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Days 4-6 - Exam readiness (step 4)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[x] Exam readiness&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Take the time to go through the &lt;a href="https://explore.skillbuilder.aws/learn/course/external/view/elearning/51/exam-readiness-aws-certified-data-analytics-specialty?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Exam Readiness: AWS Certified Data Analytics Specialty&lt;/a&gt; course provided by AWS. This course is specifically designed to help you prepare for the exam and covers important topics, including domain areas, question formats, and exam strategies.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AWS always show one message similar to this one: &lt;code&gt;This is NOT training&lt;/code&gt;. This is to &lt;code&gt;complement&lt;/code&gt; your training....&lt;br&gt;
{: .prompt-warning }&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are the five domains for this certification. Four of them are the same that the &lt;code&gt;Process of Data Analytics&lt;/code&gt; mentioned above + Security domain.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Collection (18%)&lt;/li&gt;
&lt;li&gt;Storage and data management (22%)&lt;/li&gt;
&lt;li&gt;Processing (24%)&lt;/li&gt;
&lt;li&gt;Analysis and visualization (18%)&lt;/li&gt;
&lt;li&gt;Security (18%)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me show the main AWS Services for each domain, and let me show you the more important ones.&lt;/p&gt;

&lt;h4&gt;
  
  
  Domain 1: Collection
&lt;/h4&gt;

&lt;p&gt;Focuses on ingesting raw data from transactions, logs, and Internet of Things (IoT) devices.&lt;/p&gt;

&lt;p&gt;Main AWS Services&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Amazon Kinesis Data Streams&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AWS Glue&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Amazon Kinesis Data Firehose&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;AWS DMS&lt;/li&gt;
&lt;li&gt;Amazon SQS&lt;/li&gt;
&lt;li&gt;AWS IoT&lt;/li&gt;
&lt;li&gt;AWS Snowball&lt;/li&gt;
&lt;li&gt;Amazon MSK&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Domain 2: Storage and Data Management
&lt;/h4&gt;

&lt;p&gt;Main AWS Services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon RDS&lt;/li&gt;
&lt;li&gt;Amazon Neptune&lt;/li&gt;
&lt;li&gt;Amazon DynamoDB&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Amazon Redshift&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Amazon ElastiCache&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Amazon S3&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AWS Lake Formation&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Amazon Aurora&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Domain 3: Processing
&lt;/h4&gt;

&lt;p&gt;The goal of the processing system is to transform data and make it more consumable by analytics and visualization tools&lt;/p&gt;

&lt;p&gt;Main AWS Services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Amazon EMR&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Amazon Kinesis Data Analytics&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AWS Glue&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;AWS Lambda&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AWS Step Functions&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;AWS Data Pipeline&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Domain 4: Analysis and Visualization
&lt;/h4&gt;

&lt;p&gt;The analysis and visualization domain is about using the data you've collected, processed and transformed to generate actionable insights. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Amazon Athena&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Amazon Kinesis Video Streams&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Amazon OpenSearch&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Amazon EMR&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Amazon Redshift&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Amazon kinesis Data Analytics&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Amazon SageMaker&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Amazon QuickSight&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Domain 5: Security
&lt;/h4&gt;

&lt;p&gt;Main AWS Services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;AWS IAM&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AWS KMS&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check encryption of the following services: S3, Redshift, Kinesis, EMR and Glue&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;[x] Take my own notes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I take notes of all the videos/material I think it is useful so after that I can check it again. Sometimes is just do an screenshot of something important and sometimes I take my own notes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Days 7-17 - Main training course &amp;amp; Practice resources (step 5 &amp;amp; 6)
&lt;/h3&gt;

&lt;p&gt;First of all, I think you have to check this AWS resource: &lt;a href="https://d1.awsstatic.com/training-and-certification/ramp-up_guides/Ramp-Up_Guide_Data_Analytics.pdf" rel="noopener noreferrer"&gt;Ramp-up data analytics&lt;/a&gt;. This is a recompilation of many other courses and AWS content related with Data Analytics.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Main training course&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You have to select your own training course. Here, if you select one course that covers all the certification content you will save a lot of time searching for additional resources.&lt;/p&gt;

&lt;p&gt;Some examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;17h of content: &lt;a href="https://www.udemy.com/course/aws-data-analytics/" rel="noopener noreferrer"&gt;Udemy&lt;/a&gt; [not free course]&lt;/li&gt;
&lt;li&gt;42h of content: &lt;a href="https://cloudacademy.com/learning-paths/aws-certified-data-analytics-specialty-das-c01-certification-preparation-for-aws-1804/" rel="noopener noreferrer"&gt;Cloud Academy&lt;/a&gt; [not free course]&lt;/li&gt;
&lt;li&gt;AWS SkillBuilder courses [not free courses]&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In my case, I selected &lt;code&gt;SkillBuilder&lt;/code&gt; resources because I wanted to test this platform. Also, I don't wanted to watch training videos... I preferred choose all downloadable content and online content, and take my own notes to check them later. However, there is no one official preparation course in the SkillBuilder platform, so I had to select a few resources to try to cover all the content (and definitely I had to invest more time).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Disclaimer: these are not free courses. If you are only looking for free content, you can search yourself a free main training course or you can omit this step. However, probably you have to compensate with MANY more hours of preparation to fill all the gaps you have and to cover all the certification content&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are a few courses I did in the SkillBuilder platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Analytics on AWS (Technical), 4h. Digital content (no videos)&lt;/li&gt;
&lt;li&gt;AWS Partner Certification Readiness: Data Analytics - Specialty (18h 27m). It includes pdf material that you can download, very useful! I didn't check the videos... only the pdf content! Also, this is a readiness course...&lt;/li&gt;
&lt;li&gt;Data &amp;amp; Analytics Tech Talk (Partner Learning Plan), 10h 32m. Again, it includes pdf content that you can download, very useful! It contains 8 different courses

&lt;ul&gt;
&lt;li&gt;Transform your data approach: Develop a modern data strategy - Technical&lt;/li&gt;
&lt;li&gt;Better, faster, and lower-cost storage : Optimizing Amazon S3 &amp;amp; FSx/EFS storage - Technical&lt;/li&gt;
&lt;li&gt;Analytics Readiness for BFSI - Technical&lt;/li&gt;
&lt;li&gt;Transactional data lakes on AWS - Technical&lt;/li&gt;
&lt;li&gt;Serverless Data Integration for a Modern Data Infrastructure with AWS Glue - Technical&lt;/li&gt;
&lt;li&gt;Analytics on SAP Data - Technical&lt;/li&gt;
&lt;li&gt;Redshift Migrations &amp;amp; POCs - Technical&lt;/li&gt;
&lt;li&gt;Right Data Streaming Architecture for your Streaming Analytics&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;AWS Cloud Quest Data Analytics. AWS Cloud Quest is the only &lt;code&gt;role-playing game&lt;/code&gt; to help you build practical AWS Cloud skills. The challenges were easy and you have to complete many very un-useful challenges related with other services not related with the Data Analytics certification, but it was funny! I completed all the challenges and I achieved the &lt;code&gt;AWS Cloud Quest Data Analytics&lt;/code&gt; badge&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;[x] Practice&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Follow a training course is highly recommended but practice with the AWS console is even more useful to retain information. And much more if you don't have much experience with some of the AWS services.&lt;/p&gt;

&lt;p&gt;I experiment by myself directly with some of the AWS services but I also get some internet examples.&lt;/p&gt;

&lt;p&gt;I used these &lt;a href="https://skillbuilder.aws/search?page=1&amp;amp;sort=item_relevancy&amp;amp;isPaid=1&amp;amp;trainingCategory=4&amp;amp;domain=16" rel="noopener noreferrer"&gt;Skill Builder labs&lt;/a&gt; to practice with the main AWS resources in a provided AWS account.&lt;/p&gt;

&lt;p&gt;Again, there is A LOT of free content you can check... Here are a few examples:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/build-and-automate-a-serverless-data-lake-using-an-aws-glue-trigger-for-the-data-catalog-and-etl-jobs/" rel="noopener noreferrer"&gt;Build and automate a serverless data lake using an AWS Glue trigger for the Data Catalog and ETL jobs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/solutions/implementations/game-analytics-pipeline/" rel="noopener noreferrer"&gt;Game Analytics Pipeline&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://catalog.us-east-1.prod.workshops.aws/workshops/29253aed-05ee-46f3-bcf3-bb3f90919de4/en-US" rel="noopener noreferrer"&gt;Serverless Analytics for Games&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Create business intelligence dashboards with Amazon QuickSight: &lt;a href="https://aws.amazon.com/getting-started/hands-on/create-business-intelligence-dashboards-using-amazon-quicksight/?p=ft&amp;amp;c=aa&amp;amp;z=4" rel="noopener noreferrer"&gt;https://aws.amazon.com/getting-started/hands-on/create-business-intelligence-dashboards-using-amazon-quicksight/?p=ft&amp;amp;c=aa&amp;amp;z=4&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/orchestrate-amazon-emr-serverless-jobs-with-aws-step-functions/" rel="noopener noreferrer"&gt;Orchestrate Amazon EMR Serverless jobs with AWS Step functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/modernize-a-legacy-real-time-analytics-application-with-amazon-managed-service-for-apache-flink/" rel="noopener noreferrer"&gt;Modernize a legacy real-time analytics application with Amazon Managed Service for Apache Flink&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/using-aws-appsync-and-aws-lake-formation-to-access-a-secure-data-lake-through-a-graphql-api/" rel="noopener noreferrer"&gt;Using AWS AppSync and AWS Lake Formation to access a secure data lake through a GraphQL API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/build-event-driven-architectures-with-amazon-msk-and-amazon-eventbridge/" rel="noopener noreferrer"&gt;Build event-driven architectures with Amazon MSK and Amazon EventBridge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/securely-process-near-real-time-data-from-amazon-msk-serverless-using-an-aws-glue-streaming-etl-job-with-iam-authentication/" rel="noopener noreferrer"&gt;Securely process near-real-time data from Amazon MSK Serverless using an AWS Glue streaming ETL job with IAM authentication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/introducing-amazon-msk-as-a-source-for-amazon-opensearch-ingestion/" rel="noopener noreferrer"&gt;Introducing Amazon MSK as a source for Amazon OpenSearch Ingestion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/generate-security-insights-from-amazon-security-lake-data-using-amazon-opensearch-ingestion/" rel="noopener noreferrer"&gt;Generate security insights from Amazon Security Lake data using Amazon OpenSearch Ingestion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/big-data/end-to-end-development-lifecycle-for-data-engineers-to-build-a-data-integration-pipeline-using-aws-glue/" rel="noopener noreferrer"&gt;End-to-end development lifecycle for data engineers to build a data integration pipeline using AWS Glue&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/business-intelligence/build-and-share-a-business-capability-model-with-amazon-quicksight" rel="noopener noreferrer"&gt;Build and share a business capability model with Amazon QuickSight&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Days 18-19 - Whitepapers (step 7)
&lt;/h3&gt;

&lt;p&gt;The link of the official AWS Whitepapers is included in the &lt;a href="https://aws.amazon.com/certification/certified-data-analytics-specialty/" rel="noopener noreferrer"&gt;documentation landing page&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://d1.awsstatic.com/whitepapers/amazon_emr_migration_guide.pdf" rel="noopener noreferrer"&gt;Amazon EMR Migration Guide: How to Move Apache Spark and Apache Hadoop From On-Premises to AWS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/whitepapers/latest/big-data-analytics-options/welcome.html" rel="noopener noreferrer"&gt;Big Data Options on AWS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://d1.awsstatic.com/whitepapers/whitepaper-streaming-data-solutions-on-aws-with-amazon-kinesis.pdf" rel="noopener noreferrer"&gt;Streaming Data Solutions on AWS with Amazon Kinesis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://d1.awsstatic.com/whitepapers/teaching-big-data-skills-amazon-emr.pdf" rel="noopener noreferrer"&gt;Teaching Big Data Skills with Amazon EMR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://d1.awsstatic.com/architecture-diagrams/ArchitectureDiagrams/sql_based_data_processing_amazon_ecs.pdf" rel="noopener noreferrer"&gt;Reference Architecture: SQL Based Data Processing in Amazon ECS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Days 20-21 - FAQs of the main services (step 8)
&lt;/h3&gt;

&lt;p&gt;The link of the official FAQs is included (again) in the same &lt;a href="https://aws.amazon.com/certification/certified-data-analytics-specialty/" rel="noopener noreferrer"&gt;documentation landing page&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/athena/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon Athena&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/emr/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon EMR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/redshift/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon Redshift&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/cloudsearch/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon CloudSearch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/kinesis/video-streams/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon Kinesis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/kinesis/data-streams/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon Kinesis Data Streams&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/kinesis/data-firehose/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon Kinesis Data Firehose&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/kinesis/data-analytics/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon Kinesis Data Analytics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/elasticsearch-service/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon ElasticSearch Service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/msk/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon Managed Service for Kafka (MSK)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/quicksight/resources/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;Amazon QuickSight&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/data-exchange/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;AWS Data Exchange&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/glue/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;AWS Glue&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/lake-formation/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;AWS Lake Formation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/datapipeline/faqs/?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;AWS Data Pipeline&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Days 22-24 - Study my notes (step 9)
&lt;/h3&gt;

&lt;p&gt;Unfortunately I cannot share my own notes, but I used this time to check everything again and again.&lt;/p&gt;

&lt;h3&gt;
  
  
  Days 25-29 - Practice with exam-style questions (step 10)
&lt;/h3&gt;

&lt;p&gt;You have many options on internet.&lt;/p&gt;

&lt;p&gt;The 2 AWS official test resources are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;10 questions - &lt;a href="https://d1.awsstatic.com/training-and-certification/docs-data-analytics-specialty/AWS-Certified-Data-Analytics-Specialty_Sample-Questions.pdf" rel="noopener noreferrer"&gt;AWS Certified Data Analytics Specialty Sample Questions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;20 questions - &lt;a href="https://explore.skillbuilder.aws/learn/course/external/view/elearning/12472/aws-certified-data-analytics-specialty-official-practice-question-set-das-c01-english?das=sec&amp;amp;sec=prep" rel="noopener noreferrer"&gt;AWS Certified Data Analytics Specialty Official Practice Question Set&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Day 30 - EXAM
&lt;/h3&gt;

&lt;p&gt;A few advices that you already know... so, reminders!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;BEFORE the exam&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Sleep well the previous night to be rest in the exam. It will be a long exam with long questions...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;DURING the exam&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Identify keywords in the questions&lt;/li&gt;
&lt;li&gt;Eliminate wrong answers&lt;/li&gt;
&lt;li&gt;If you have doubts, answer the question, write in the comments your possible answers and everything that will help you in your next revision (example: A or B doubt in xxxxx), flag it, and go to the next one&lt;/li&gt;
&lt;li&gt;Don't spend to much time on each question. 3 minutes if you have requested the additional 30 minutes for non-native english speakers&lt;/li&gt;
&lt;li&gt;Review all the flagged questions and un-flag the ones that you are more confident now&lt;/li&gt;
&lt;li&gt;Review again&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With all the work already done, you only have to do the exam and pass it!&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%2F92819o6csvx5itoxg32u.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%2F92819o6csvx5itoxg32u.png" alt="Certification badge" width="150" height="150"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One last thing! If you followed this guide or found it helpful, let me know in the comments, or you can access to my blog to find more AWS useful content! &lt;a href="https://www.playingaws.com/" rel="noopener noreferrer"&gt;https://www.playingaws.com/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AWS WAF (Web Application Firewall): Deep Dive</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Fri, 19 May 2023 18:41:17 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-waf-web-application-firewall-deep-dive-15bd</link>
      <guid>https://dev.to/aws-builders/aws-waf-web-application-firewall-deep-dive-15bd</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;This article was first published in my own blog:&lt;br&gt;
&lt;a href="https://www.playingaws.com/posts/aws-waf-web-application-firewall-deep-dive/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/aws-waf-web-application-firewall-deep-dive/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A Web Application Firewall (WAF) is a security solution that &lt;code&gt;protects web applications&lt;/code&gt; from malicious attacks, such as cross-site scripting, SQL injection, and malicious bot traffic. WAF is typically deployed as a reverse proxy, sitting between the internet and the web application, to inspect and filter incoming requests before they reach the web server.&lt;/p&gt;

&lt;p&gt;Here's a visual representation of the basic architecture of AWS WAF:&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%2Fd40gdqbuwbwfngw1vy4t.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%2Fd40gdqbuwbwfngw1vy4t.png" alt="WAF basic diagram" width="350" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How WAF Works
&lt;/h3&gt;

&lt;p&gt;WAF works by analyzing incoming &lt;code&gt;HTTP and HTTPS&lt;/code&gt; requests to a web application and allows or blocks requests based on pre-defined security rules. Security rules can be based on IP addresses, headers, parameters, and other attributes of the request. WAF can also perform Deep Packet Inspection (DPI) to inspect the contents of the request payload and determine if the request contains malicious content.&lt;/p&gt;

&lt;p&gt;If a request violates a security rule, the WAF blocks the request and returns an error response to the client.&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS WAF
&lt;/h3&gt;

&lt;p&gt;AWS WAF is a popular choice for cloud-based WAF solutions, providing a comprehensive set of security rules to protect web applications.&lt;/p&gt;

&lt;p&gt;AWS WAF (Web Application Firewall) is a cloud-based service that protects your web applications, defending against common web exploits that could impact availability, compromise security, or consume excessive resources. It enables you to control access to your web content and provides customizable security rules to filter traffic based on IP addresses, HTTP headers, HTTP body content, or URI strings.&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%2Fk1t4xqt1rh0iwzq9r9l6.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%2Fk1t4xqt1rh0iwzq9r9l6.png" alt="WAF service" width="760" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Protected resources
&lt;/h3&gt;

&lt;p&gt;You can protect the following resource types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon CloudFront distribution&lt;/li&gt;
&lt;li&gt;Amazon API Gateway REST API&lt;/li&gt;
&lt;li&gt;Application Load Balancer&lt;/li&gt;
&lt;li&gt;AWS AppSync GraphQL API&lt;/li&gt;
&lt;li&gt;Amazon Cognito user pool&lt;/li&gt;
&lt;li&gt;AWS App Runner service&lt;/li&gt;
&lt;li&gt;AWS Verified Access instance&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Main components
&lt;/h3&gt;

&lt;p&gt;The main components of AWS WAF include the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Rules&lt;/strong&gt;: AWS WAF allows you to create rules that define the types of traffic you want to allow or block from reaching your web applications. You can create rules based on various conditions such as IP addresses, HTTP headers, URI strings, and HTTP body content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Managed Rule Groups&lt;/strong&gt;: AWS WAF provides pre-built managed rule groups that offer protection against common web attacks such as SQL injection, cross-site scripting (XSS), and more. These rule groups are created and maintained by AWS and updated regularly to ensure they provide up-to-date protection against the latest threats.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Web ACLs&lt;/strong&gt;: AWS WAF uses web ACLs (Web Access Control Lists) to group together rules that you can then apply to one or more web applications. Web ACLs allow you to apply a set of rules across multiple web applications, making it easier to manage and apply security policies consistently.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Benefits and features
&lt;/h3&gt;

&lt;p&gt;AWS WAF offers a wide range of &lt;code&gt;benefits and features&lt;/code&gt;, empowering you to secure your web applications effectively. Here are some key advantages of using AWS WAF:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Agile protection against web attacks&lt;/strong&gt;: AWS WAF rule propagation and updates take just under a minute, enabling you to react faster when you are under an attack or when security issues arise.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ease of deployment and maintenance&lt;/strong&gt;: AWS WAF is easy to deploy and protects application(s) deployed on either Amazon CloudFront, the Application Load Balancer, or Amazon API Gateway. There is no additional software to deploy, DNS configuration, or SSL/TLS certificate to manage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cost-effective&lt;/strong&gt;: AWS WAF is a pay-as-you-go service, which means you only pay for the resources you use. This makes it a cost-effective solution for securing your web applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improved web traffic visibility&lt;/strong&gt;: AWS WAF gives near real-time visibility into your web traffic, which you can use to create new rules or alerts in Amazon CloudWatch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: AWS WAF is designed to handle high volumes of traffic and can scale automatically to meet the demands of your web applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;: AWS WAF provides a wide range of options for creating custom rules to filter traffic, giving you greater flexibility in defining your security policies.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-on with AWS WAF
&lt;/h2&gt;

&lt;p&gt;First of all, you must know that AWS WAF is a regional service. However, it seems a global service when you access it, but you have to change between regions using this option:&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%2Ftehnbd7ohrvrans04s8a.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%2Ftehnbd7ohrvrans04s8a.png" alt="WAF regional" width="765" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Getting started with WAF is relatively straightforward, simply log in to the AWS Management Console and navigate to the AWS WAF service. From there, you can create a new WAF policy and configure the policy with the desired security rules.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Step 1: Describe web ACL and associate it to AWS resources&lt;br&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%2Fpz8qu2ahqzro3p60hhnc.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%2Fpz8qu2ahqzro3p60hhnc.png" alt="WAF step 1" width="750" height="860"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Step 2: Add rules and rule groups&lt;br&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%2Fb6i3nc8tkgtufpq9nljv.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%2Fb6i3nc8tkgtufpq9nljv.png" alt="WAF step 2" width="800" height="846"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Step 3:Set rule priority&lt;br&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%2Ffwsgoj2cbn1ozzpwbrne.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%2Ffwsgoj2cbn1ozzpwbrne.png" alt="WAF step 3" width="750" height="382"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Step 4: Configure metrics&lt;br&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%2Fnccoype20zuovzjghvio.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%2Fnccoype20zuovzjghvio.png" alt="WAF step 4" width="750" height="554"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Step 5: Review and create web ACL&lt;br&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%2F0dcigqkbp1tde1rlch7e.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%2F0dcigqkbp1tde1rlch7e.png" alt="WAF step 5-1" width="750" height="761"&gt;&lt;/a&gt;&lt;br&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%2Fq6lrtfif8iu8fc0qeams.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%2Fq6lrtfif8iu8fc0qeams.png" alt="WAF step 5-2" width="800" height="884"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Enabling logs
&lt;/h3&gt;

&lt;p&gt;Logs are disabled by default, so we have to enable it. We have to enter the Web ACL created and access to &lt;code&gt;Logging and Metrics&lt;/code&gt; tab:&lt;br&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%2F33en82m7fu3c6hcotqh7.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%2F33en82m7fu3c6hcotqh7.png" alt="WAF logs" width="750" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can check in the following image We will have 3 options as &lt;code&gt;Logging Destination&lt;/code&gt; (CloudWatch Logs Groups, Kinesis Data Firehose stream and S3 bucket):&lt;br&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%2F3rzci5ioczbh00besd1k.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%2F3rzci5ioczbh00besd1k.png" alt="WAF log destination" width="800" height="886"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After enabling CloudWatch logs, we can access the &lt;code&gt;CloudWatch Log Insights&lt;/code&gt; tab and execute sample queries or create custom queries to analyze the logs. We can see the results as logs or in a diagram (Visualization):&lt;br&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%2Fhr0hn3d2m9fdeppzcp97.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%2Fhr0hn3d2m9fdeppzcp97.png" alt="WAF visualization" width="750" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Metrics
&lt;/h3&gt;

&lt;p&gt;AWS WAF reports &lt;code&gt;metrics&lt;/code&gt; to CloudWatch in one-minute intervals by default, and the metrics are retained for 2 weeks.&lt;/p&gt;

&lt;p&gt;The metrics monitored are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AllowedRequests&lt;/li&gt;
&lt;li&gt;BlockedRequests&lt;/li&gt;
&lt;li&gt;CountedRequests&lt;/li&gt;
&lt;li&gt;PassedRequests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These metrics provide a SUM count of web requests that hit a specific Rule or Web ACL.&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%2F0if4k3bir8jtxiurndgd.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%2F0if4k3bir8jtxiurndgd.png" alt="WAF metrics" width="750" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create custom alarms
&lt;/h3&gt;

&lt;p&gt;Usually is a good idea to create some alarms to be notified if some block requests appear on our web, so we can configure a &lt;code&gt;CloudWatch Alarm&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The easy way to create the alarm is through the AWS WAF Metric for &lt;code&gt;BlockeRequests&lt;/code&gt;. There we have a direct link to create one alarm with this associated metric if we access &lt;code&gt;Graphed Metrics&lt;/code&gt;` and select the indicated icon in red color:&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%2F49hdtiqfcgsujwcdiwlx.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%2F49hdtiqfcgsujwcdiwlx.png" alt="WAF alarm 1" width="800" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the creation, we will have something like that:&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%2F9fsar2cxb58l2an991yc.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%2F9fsar2cxb58l2an991yc.png" alt="WAF alarm 2" width="800" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Estimating Costs
&lt;/h3&gt;

&lt;p&gt;The cost of AWS WAF can vary depending on the scale of your deployment, ranging &lt;code&gt;from a few dollars&lt;/code&gt; per month for small deployments &lt;code&gt;to several thousand dollars per month&lt;/code&gt; for large-scale deployments. AWS WAF pricing is based on the number of web requests processed and the number of security rules that are used.&lt;/p&gt;

&lt;p&gt;Example of cost for our example (1 Web ACL with a few managed rules):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;$5.00 per web ACL per month (prorated hourly) * 1 web ACL = $5.00&lt;/li&gt;
&lt;li&gt;$1.00 per rule per month (prorated hourly) * 5 rules = $1.00&lt;/li&gt;
&lt;li&gt;$0.60 per million requests processed * 1 (we will assume 1 million request) = $0.60&lt;/li&gt;
&lt;li&gt;$0.10 per alarm metric * 1 alarm = $0.10&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total: &lt;strong&gt;$6.70 per month&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  More Information about AWS WAF
&lt;/h2&gt;

&lt;p&gt;For more information about AWS WAF, you can visit the following links&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS WAF (Developer Guide): &lt;a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Security Automations for AWS WAF: &lt;a href="https://aws.amazon.com/solutions/implementations/security-automations-for-aws-waf/" rel="noopener noreferrer"&gt;https://aws.amazon.com/solutions/implementations/security-automations-for-aws-waf/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;WAF FAQs: &lt;a href="https://aws.amazon.com/waf/faqs/" rel="noopener noreferrer"&gt;https://aws.amazon.com/waf/faqs/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>How to deploy a serverless website with Terraform</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Sat, 06 May 2023 10:18:48 +0000</pubDate>
      <link>https://dev.to/aws-builders/how-to-deploy-a-serverless-website-with-terraform-5677</link>
      <guid>https://dev.to/aws-builders/how-to-deploy-a-serverless-website-with-terraform-5677</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;This article was first published in my own blog: &lt;a href="https://www.playingaws.com/posts/how-to-deploy-serverless-website-with-terraform/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/how-to-deploy-serverless-website-with-terraform/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As you already know, creating and managing infrastructure can be a complex and time-consuming process, and fortunately, tools like &lt;strong&gt;Terraform&lt;/strong&gt; can simplify this process by allowing you to define your Infrastructure as Code (IaC). In this article, we will explore the basics of Terraform and walk through how to create infrastructure on AWS using it.&lt;/p&gt;

&lt;p&gt;However, this is not my first article about Infrastructure as Code tools.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you want to know how to create infrastructure using familiar &lt;strong&gt;programming languages&lt;/strong&gt; you can review this article about CDK: &lt;a href="https://dev.to/posts/how-to-add-ci-cd-to-my-cdk-project/"&gt;How to create infrastructure with CDK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If you want to create &lt;strong&gt;serverless applications&lt;/strong&gt; on AWS, you can review this other article about SAM: &lt;a href="https://dev.to/posts/how-to-create-serverless-applications-with-sam/"&gt;How to create serverless applications with SAM&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;I have uploaded the source code used in this article in the following GitHub repository &lt;a href="https://github.com/alazaroc/aws-terraform-serverless-website" rel="noopener noreferrer"&gt;https://github.com/alazaroc/aws-terraform-serverless-website&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is Terraform?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.terraform.io/" rel="noopener noreferrer"&gt;Terraform&lt;/a&gt; is an open-source Infrastructure as Code (IaC) software tool created by HashiCorp. It allows you to define and manage your infrastructure using human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle. Terraform supports a wide range of cloud providers, including AWS, Microsoft Azure, and Google Cloud Platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Terraform Works
&lt;/h2&gt;

&lt;p&gt;Terraform uses a declarative configuration language called HashiCorp Configuration Language (HCL).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In a nutshell:&lt;/strong&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%2Frgxpeueyi0gm2g2j79n6.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%2Frgxpeueyi0gm2g2j79n6.png" alt="how terraform works" width="600" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Write&lt;/strong&gt;: You define your infrastructure in a series of .tf files, which contain the configuration for your resources&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan&lt;/strong&gt;: Terraform then uses this configuration to generate an execution plan, which outlines the changes that will be made to your infrastructure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply&lt;/strong&gt;: Once you have reviewed the execution plan, you can apply it to your infrastructure using the "&lt;code&gt;terraform apply&lt;/code&gt;" command. Terraform will then provision your resources according to the configuration you defined.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started with Terraform
&lt;/h2&gt;

&lt;p&gt;To get started with Terraform, you will need to &lt;strong&gt;install it&lt;/strong&gt; on your machine. You can download the latest version of Terraform from the official website &lt;a href="https://developer.hashicorp.com/terraform/downloads" rel="noopener noreferrer"&gt;here&lt;/a&gt;, and if you want to deploy on AWS, you also need AWS CLI.&lt;/p&gt;

&lt;p&gt;Once you have installed Terraform, you can start creating your infrastructure.&lt;/p&gt;

&lt;p&gt;In this section, we will review how Terraform works creating a first example to deploy a simple S3 bucket:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new directory for your Terraform configuration file:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;  mkdir my-serverless-website
  cd my-serverless-website
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a new file called "main.tf" and there we are going to include the &lt;code&gt;AWS provider information&lt;/code&gt; with the "us-east-1" region, and one resource of type &lt;code&gt;aws_s3_bucket&lt;/code&gt; to create an S3 bucket with all the default configuration. Remember that the S3 bucket name must be unique globally.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;  &lt;span class="k"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"aws"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_bucket"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my-unique-bucket-name-12y398y13489148h"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Initialize&lt;/strong&gt; your Terraform configuration.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;  terraform init
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run &lt;code&gt;terraform init&lt;/code&gt;, Terraform downloads and installs the necessary provider plugins and modules required for your configuration. It also initializes the backend, which is the storage location for your &lt;code&gt;Terraform state file&lt;/code&gt;. The state file is used to store the current state of your infrastructure, and it is used by Terraform to plan and apply changes to your infrastructure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generate an execution &lt;strong&gt;plan&lt;/strong&gt; (optional):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;  terraform plan
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command generates an execution plan based on the configuration in your &lt;code&gt;main.tf&lt;/code&gt; file, and let you check what is going to be deployed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Apply&lt;/strong&gt; the execution plan to deploy on AWS:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;  terraform apply
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you run &lt;code&gt;terraform apply&lt;/code&gt;, Terraform compares the current state of your infrastructure with the desired state defined in your configuration. It then creates, modifies, or deletes resources as necessary to bring your infrastructure into the desired state. In our example, a new S3 bucket will be deployed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, the AWS resources have been created. Let's check it accessing the AWS S3 service to access the new resource created by Terraform:&lt;/li&gt;
&lt;/ul&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%2Fzsumgibu5lderkp16jht.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%2Fzsumgibu5lderkp16jht.png" alt="s3 bucket" width="800" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We already know how to deploy AWS resources with Terraform, so in the following section, we will evolve the initial example to deploy three serverless websites using S3 bucket.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How to deploy a serverless website with Terraform
&lt;/h2&gt;

&lt;p&gt;We have an AWS S3 bucket deployed, and now we are going to use it to host a serverless website. There are different ways to do it, and we are going to evolve the S3 bucket to create a serverless static website.&lt;/p&gt;

&lt;p&gt;This is what we are going to build:&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%2Fh0ncxz1lcbquzj3ndsjq.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%2Fh0ncxz1lcbquzj3ndsjq.png" alt="serverless options" width="750" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;v1.1&lt;/strong&gt;: public S3 bucket

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Advantage&lt;/strong&gt;: easy to implement&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disadvantages&lt;/strong&gt;: no custom domain, no aligned with security best practices (public bucket), no cache for static files&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;v1.2&lt;/strong&gt;: public S3 as &lt;code&gt;Static website hosting&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Advantages&lt;/strong&gt;: easy to implement, index document and error page, redirection rules&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disadvantages&lt;/strong&gt;: not aligned with security best practices (public bucket), no cache for static files, Amazon S3 website endpoints do not support HTTPS (if you want to use HTTPS, you can use Amazon CloudFront to serve a static website hosted on Amazon S3)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;v2&lt;/strong&gt;: CloudFront distribution + private S3 bucket

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Advantage&lt;/strong&gt;: easy to implement, private s3 bucket, cache for static files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disadvantages&lt;/strong&gt;: auto-generated domain name&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;v3&lt;/strong&gt;: Route53 + ACM + CloudFront Distribution + private S3 bucket + optionally Lambda Edge

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Advantages&lt;/strong&gt;: custom domain name using AWS managed certificates, private s3 bucket, cache for static files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disadvantages&lt;/strong&gt;: more complex to implement&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;In these examples, we are going to deploy a static website based on an &lt;code&gt;index.html&lt;/code&gt; file with this content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;This is my serverless website
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  v1.1: public S3 bucket
&lt;/h3&gt;

&lt;p&gt;In this version 1.1 we are going to expose the S3 bucket publicly so any person can access the &lt;code&gt;index.html&lt;/code&gt; file using the public S3 endpoint.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Advantage&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;easy to implement&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Disadvantages&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;no custom domain&lt;/li&gt;
&lt;li&gt;no aligned with security best practices (public bucket)&lt;/li&gt;
&lt;li&gt;no cache for static files&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This solution is not aligned with security best practices because it expose an S3 bucket publicly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Update the file "main.tf" with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="k"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"aws"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1"&lt;/span&gt;
  &lt;span class="nx"&gt;default_tags&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;tags&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;project&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"serverless-demo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;type&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"web"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;iac&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"terraform"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_bucket"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my-unique-bucket-name-12y398y13489148h"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_object"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;key&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"index.html"&lt;/span&gt;
  &lt;span class="nx"&gt;source&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"index.html"&lt;/span&gt;
  &lt;span class="nx"&gt;content_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"text/html"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_account_public_access_block"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;block_public_acls&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="nx"&gt;block_public_policy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_bucket_public_access_block"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;block_public_acls&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="nx"&gt;block_public_policy&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="nx"&gt;ignore_public_acls&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="nx"&gt;restrict_public_buckets&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_bucket_policy"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;policy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;jsonencode&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="nx"&gt;Version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;
    &lt;span class="nx"&gt;Statement&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;Sid&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"PublicReadGetObject"&lt;/span&gt;
        &lt;span class="nx"&gt;Effect&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Allow"&lt;/span&gt;
        &lt;span class="nx"&gt;Principal&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"*"&lt;/span&gt;
        &lt;span class="nx"&gt;Action&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="s2"&gt;"s3:ListBucket"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="nx"&gt;Resource&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/*"&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, execute the terraform apply command: &lt;code&gt;terraform apply --auto-approve&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, open a private window in your browser and access the &lt;code&gt;index.html&lt;/code&gt; content using the public endpoint of our S3 bucket. If you have executed the code before, it will be the following URL: &lt;a href="https://my-unique-bucket-name-12y398y13489148h.s3.amazonaws.com/index.html" rel="noopener noreferrer"&gt;https://my-unique-bucket-name-12y398y13489148h.s3.amazonaws.com/index.html&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%2Fb1hb43dousljfhp5d9g8.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%2Fb1hb43dousljfhp5d9g8.png" alt="s3 website" width="500" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  v1.2: Static website hosting using S3
&lt;/h3&gt;

&lt;p&gt;In this version, similar to the previous one, we still have exposed the S3 bucket publicly but we will enable the static website hosting feature of S3.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Advantages&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;easy to implement&lt;/li&gt;
&lt;li&gt;static website includes the configuration of an index document, an error page and also redirection rules&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Disadvantages&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;not aligned with security best practices (public bucket)&lt;/li&gt;
&lt;li&gt;no cache for static files&lt;/li&gt;
&lt;li&gt;Amazon S3 website endpoints &lt;strong&gt;do not support HTTPS&lt;/strong&gt; (if you want to use HTTPS, you can use Amazon CloudFront to serve a static website hosted on Amazon S3)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This solution is not aligned with security best practices because it expose an S3 bucket publicly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Using the content of the "main.tf" showed in the previous v1.1 example, add at the end of the document the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_bucket_website_configuration"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;index_document&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;suffix&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"index.html"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, execute the terraform apply command: &lt;code&gt;terraform apply --auto-approve&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, open a private window in your browser and access through the static website to the &lt;code&gt;index.html&lt;/code&gt; content: &lt;a href="http://my-unique-bucket-name-12y398y13489148h.s3-website-us-east-1.amazonaws.com/" rel="noopener noreferrer"&gt;http://my-unique-bucket-name-12y398y13489148h.s3-website-us-east-1.amazonaws.com/&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%2Fr43983atutqu149j65bk.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%2Fr43983atutqu149j65bk.png" alt="s3 static website" width="800" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you didn't realize before, look that we are using HTTP, not HTTPS. S3 static website don't support HTTPS.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  v2: CloudFront Distribution + private S3 bucket
&lt;/h3&gt;

&lt;p&gt;In this version, we are going to change the bucket to private again (and also, we are going to enable again the &lt;code&gt;Block Public Access settings for this account&lt;/code&gt; feature of S3), and we are going to create a CloudFront Distribution connected with the private S3 bucket. So, we are going to access the S3 bucket using the CloudFront distribution.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Advantage&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;easy to implement&lt;/li&gt;
&lt;li&gt;private s3 bucket (aligned with the security best practices)&lt;/li&gt;
&lt;li&gt;includes cache for static files&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Disadvantages&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;auto-generated domain name (by CloudFront)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Replace the "main.tf" content with the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;&lt;span class="k"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"aws"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_bucket"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my-unique-bucket-name-12y398y13489148h"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_account_public_access_block"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;block_public_acls&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="nx"&gt;block_public_policy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="nx"&gt;ignore_public_acls&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="nx"&gt;restrict_public_buckets&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_object"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;key&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"index.html"&lt;/span&gt;
  &lt;span class="nx"&gt;source&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"index.html"&lt;/span&gt;
  &lt;span class="nx"&gt;content_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"text/html"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_cloudfront_distribution"&lt;/span&gt; &lt;span class="s2"&gt;"cdn_static_site"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;enabled&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="nx"&gt;is_ipv6_enabled&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="nx"&gt;default_root_object&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"index.html"&lt;/span&gt;
  &lt;span class="nx"&gt;comment&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my cloudfront in front of the s3 bucket"&lt;/span&gt;

  &lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;domain_name&lt;/span&gt;              &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bucket_regional_domain_name&lt;/span&gt;
    &lt;span class="nx"&gt;origin_id&lt;/span&gt;                &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my-s3-origin"&lt;/span&gt;
    &lt;span class="nx"&gt;origin_access_control_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_cloudfront_origin_access_control&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;default&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;default_cache_behavior&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;min_ttl&lt;/span&gt;                &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="nx"&gt;default_ttl&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="nx"&gt;max_ttl&lt;/span&gt;                &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="nx"&gt;viewer_protocol_policy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"redirect-to-https"&lt;/span&gt;

    &lt;span class="nx"&gt;allowed_methods&lt;/span&gt;  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"HEAD"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"OPTIONS"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="nx"&gt;cached_methods&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"GET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"HEAD"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="nx"&gt;target_origin_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my-s3-origin"&lt;/span&gt;

    &lt;span class="nx"&gt;forwarded_values&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;query_string&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
      &lt;span class="nx"&gt;cookies&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;forward&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"none"&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;restrictions&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;geo_restriction&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;locations&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
      &lt;span class="nx"&gt;restriction_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"none"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;viewer_certificate&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;cloudfront_default_certificate&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; 
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_cloudfront_origin_access_control"&lt;/span&gt; &lt;span class="s2"&gt;"default"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;name&lt;/span&gt;                              &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"cloudfront OAC"&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt;                       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"description of OAC"&lt;/span&gt;
  &lt;span class="nx"&gt;origin_access_control_origin_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"s3"&lt;/span&gt;
  &lt;span class="nx"&gt;signing_behavior&lt;/span&gt;                  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"always"&lt;/span&gt;
  &lt;span class="nx"&gt;signing_protocol&lt;/span&gt;                  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"sigv4"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"cloudfront_url"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_cloudfront_distribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cdn_static_site&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"aws_iam_policy_document"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;statement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;actions&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="nx"&gt;resources&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/*"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="nx"&gt;principals&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;type&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Service"&lt;/span&gt;
      &lt;span class="nx"&gt;identifiers&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"cloudfront.amazonaws.com"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;condition&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;test&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"StringEquals"&lt;/span&gt;
      &lt;span class="k"&gt;variable&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"aws:SourceArn"&lt;/span&gt;
      &lt;span class="nx"&gt;values&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;aws_cloudfront_distribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cdn_static_site&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_bucket_policy"&lt;/span&gt; &lt;span class="s2"&gt;"website_bucket_policy"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;policy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aws_iam_policy_document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;website_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Now, execute the terraform apply command: &lt;code&gt;terraform apply --auto-approve&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, open a private window in your browser and access the &lt;code&gt;index.html&lt;/code&gt; content using the CloudFront DNS. The execution of the terraform template has as output the URL of the CloudFront Distribution.&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%2Ff9s9hfkoyx7bgjarxrmp.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%2Ff9s9hfkoyx7bgjarxrmp.png" alt="cloudfront access" width="500" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now, the S3 bucket is private, so if you access to the public endpoint of S3 trying to get the &lt;code&gt;index.html&lt;/code&gt; file you will receive an error&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  v3: Route53 + ACM + CloudFront Distribution + private S3 bucket
&lt;/h3&gt;

&lt;p&gt;In the last example, we will use our domain (registered in Route53) and we will create a certificate using ACM.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Requirement&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Required a custom domain&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Advantages&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;custom domain name using AWS managed certificates&lt;/li&gt;
&lt;li&gt;private s3 bucket (aligned with the security best practices)&lt;/li&gt;
&lt;li&gt;includes cache for static files&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Disadvantages&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;more complex to implement&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;To be able to run this example you need your own domain (example.com) and you have to register it in Route53 service. If you don't have it you can buy a new domain in the Route53 server but it will cost you about 10 dollars per year.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These are the changes that you have to do in the previous "main.tf" file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update in your CloudFront Distribution resource &lt;code&gt;aws_cloudfront_distribution&lt;/code&gt; the following, (where &lt;code&gt;${var.domain_name_simple}&lt;/code&gt; is for example &lt;code&gt;example.com&lt;/code&gt;):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;    &lt;span class="nx"&gt;viewer_certificate&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;cloudfront_default_certificate&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; 
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;replacing it for this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;    &lt;span class="nx"&gt;viewer_certificate&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;acm_certificate_arn&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_acm_certificate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&lt;/span&gt;
      &lt;span class="nx"&gt;ssl_support_method&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"sni-only"&lt;/span&gt;
      &lt;span class="nx"&gt;minimum_protocol_version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"TLSv1.2_2021"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;aliases&lt;/span&gt; &lt;span class="err"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name_simple&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Next, add the following lines:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight terraform"&gt;&lt;code&gt;  &lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_acm_certificate"&lt;/span&gt; &lt;span class="s2"&gt;"cert"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;provider&lt;/span&gt;                  &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use_default_region&lt;/span&gt;
    &lt;span class="nx"&gt;domain_name&lt;/span&gt;               &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"*.&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name_simple&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nx"&gt;validation_method&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"DNS"&lt;/span&gt;
    &lt;span class="nx"&gt;subject_alternative_names&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name_simple&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="nx"&gt;lifecycle&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;create_before_destroy&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"aws_route53_zone"&lt;/span&gt; &lt;span class="s2"&gt;"zone"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;provider&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use_default_region&lt;/span&gt;
    &lt;span class="nx"&gt;name&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name_simple&lt;/span&gt;
    &lt;span class="nx"&gt;private_zone&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_route53_record"&lt;/span&gt; &lt;span class="s2"&gt;"cert_validation"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;provider&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use_default_region&lt;/span&gt;
    &lt;span class="nx"&gt;for_each&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;dvo&lt;/span&gt; &lt;span class="nx"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;aws_acm_certificate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_validation_options&lt;/span&gt; &lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;dvo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;name&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dvo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resource_record_name&lt;/span&gt;
        &lt;span class="nx"&gt;record&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dvo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resource_record_value&lt;/span&gt;
        &lt;span class="nx"&gt;type&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dvo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resource_record_type&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nx"&gt;allow_overwrite&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="nx"&gt;name&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;
    &lt;span class="nx"&gt;records&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;record&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="nx"&gt;type&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;each&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;
    &lt;span class="nx"&gt;zone_id&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aws_route53_zone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;zone_id&lt;/span&gt;
    &lt;span class="nx"&gt;ttl&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_acm_certificate_validation"&lt;/span&gt; &lt;span class="s2"&gt;"cert"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;provider&lt;/span&gt;                &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use_default_region&lt;/span&gt;
    &lt;span class="nx"&gt;certificate_arn&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_acm_certificate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&lt;/span&gt;
    &lt;span class="nx"&gt;validation_record_fqdns&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;record&lt;/span&gt; &lt;span class="nx"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;aws_route53_record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cert_validation&lt;/span&gt; &lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;record&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fqdn&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_route53_record"&lt;/span&gt; &lt;span class="s2"&gt;"www"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;zone_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aws_route53_zone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
    &lt;span class="nx"&gt;name&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"www.&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name_simple&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nx"&gt;type&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"A"&lt;/span&gt;

    &lt;span class="nx"&gt;alias&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;name&lt;/span&gt;                   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_cloudfront_distribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cdn_static_site&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name&lt;/span&gt;
      &lt;span class="nx"&gt;zone_id&lt;/span&gt;                &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_cloudfront_distribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cdn_static_site&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hosted_zone_id&lt;/span&gt;
      &lt;span class="nx"&gt;evaluate_target_health&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_route53_record"&lt;/span&gt; &lt;span class="s2"&gt;"apex"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;zone_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aws_route53_zone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;zone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
    &lt;span class="nx"&gt;name&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name_simple&lt;/span&gt;
    &lt;span class="nx"&gt;type&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"A"&lt;/span&gt;

    &lt;span class="nx"&gt;alias&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;name&lt;/span&gt;                   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_cloudfront_distribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cdn_static_site&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain_name&lt;/span&gt;
      &lt;span class="nx"&gt;zone_id&lt;/span&gt;                &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_cloudfront_distribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cdn_static_site&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hosted_zone_id&lt;/span&gt;
      &lt;span class="nx"&gt;evaluate_target_health&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Now, execute the terraform apply command: &lt;code&gt;terraform apply --auto-approve&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally, open a private window in your browser and access your registered domain: &lt;a href="https://example.com" rel="noopener noreferrer"&gt;https://example.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;In this article, we have explored the basics of Terraform and walked through how to create infrastructure with different examples. With Terraform, you can define your infrastructure as code and automate the process of creating and updating your resources.&lt;/p&gt;

&lt;p&gt;This example is based on the code I have created to deploy my own blog &lt;a href="https://playingaws.com" rel="noopener noreferrer"&gt;https://playingaws.com&lt;/a&gt; using &lt;code&gt;Route53 + ACM + CloudFront Distribution + private S3 bucket&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>iac</category>
      <category>terraform</category>
      <category>serverless</category>
      <category>aws</category>
    </item>
    <item>
      <title>My first year with my AWS blog</title>
      <dc:creator>Alejandro Lazaro</dc:creator>
      <pubDate>Thu, 16 Feb 2023 07:30:53 +0000</pubDate>
      <link>https://dev.to/aws-builders/my-first-year-with-my-aws-blog-1adc</link>
      <guid>https://dev.to/aws-builders/my-first-year-with-my-aws-blog-1adc</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hello! I am Alejandro Lazaro, AWS community builder, and I want to share with you all my experience after 1 year with my own blog about AWS.&lt;/p&gt;

&lt;p&gt;It has not been easy, writing articles takes a lot of time, and in this year I have published 17 articles about different topics (the blog itself; IaC &amp;amp; DevOps with SAM &amp;amp; CDK; Security; Machine Learning; Multi-account approach; Open-source tools...), but let's start at the beginning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I decided to create my personal AWS blog?
&lt;/h2&gt;

&lt;p&gt;I know, there is a lot of content on the Internet, and the official AWS content is awesome, but I had two main reasons to do it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The main goal was to &lt;strong&gt;create periodic AWS-related content and share it&lt;/strong&gt; publicly. Learning something is good, but sharing it is the next level, and I wanted to do that.&lt;/li&gt;
&lt;li&gt;The secondary goal was to have an &lt;strong&gt;excuse to keep learning and practicing with AWS resources&lt;/strong&gt;. I like to use the expression "play with AWS"... and so, my blog is &lt;a href="https://playingaws.com" rel="noopener noreferrer"&gt;https://playingaws.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lessons learned
&lt;/h2&gt;

&lt;p&gt;There are a lot of lessons learn but the 3 more important for me are the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Write articles requires A LOT of time&lt;/strong&gt;. If you are thinking whether create or not your own blog... my recommendation is YES! It will not be easy of course but you could learn a few things in the way. Take the opportunity and do it!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep it simple&lt;/strong&gt;: it's important to keep things as simple as possible, and to explain concepts in plain language that anyone can understand because this helps to make the content more accessible and useful to a wider audience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feedback is a treasure&lt;/strong&gt;: I always want feedback to know what I should improve or what I am doing wrong, but feedback is a treasure, is very hard to get it! However, when you have it, you have to take it very seriously. I had a few very good comments in the legacy comment system of my blog but unfortunately I changed it (the comment system) and I am starting from scratch again.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Content of the blog
&lt;/h2&gt;

&lt;h3&gt;
  
  
  About the blog and technologies used
&lt;/h3&gt;

&lt;p&gt;This is the &lt;strong&gt;architecture&lt;/strong&gt; of my blog: &lt;br&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%2Flt3ak2trssujr6hf1mlz.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%2Flt3ak2trssujr6hf1mlz.png" alt="blog architecture" width="550" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Deciding &lt;strong&gt;how to create the blog&lt;/strong&gt; took me a while, and in this article I explain how I decided on the technology behind the blog &lt;a href="https://www.playingaws.com/posts/the-technology-behind-this-blog/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/the-technology-behind-this-blog/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My first technical article about one AWS service was about &lt;strong&gt;Amplify Hosting&lt;/strong&gt;. I used it to deploy my blog (I use Jekyll as static site generator) and wanted to share the experience. This AWS service really simplifies the deployment of a website and manages the entire application lifecycle for you. Here's the article: How to deploy a website with Amplify Hosting &lt;a href="https://www.playingaws.com/posts/how-to-deploy-a-web-with-amplify-hosting/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/how-to-deploy-a-web-with-amplify-hosting/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  IaC (CDK and SAM)
&lt;/h3&gt;

&lt;p&gt;I published articles about CDK and SAM to create infrastructure and serverless applications.&lt;/p&gt;

&lt;p&gt;Personally I love CDK and I think you should try it and give it a try.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How to create infrastructure with CDK&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/how-to-create-infrastructure-with-cdk/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/how-to-create-infrastructure-with-cdk/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How to add CI/CD to my CDK project&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/how-to-add-ci-cd-to-my-cdk-project/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/how-to-add-ci-cd-to-my-cdk-project/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And if you don't know SAM (Serverless Application Model) you should check it out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How to create serverless applications with SAM&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/how-to-create-serverless-applications-with-sam/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/how-to-create-serverless-applications-with-sam/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How to add CI/CD to my SAM project&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/how-to-add-ci-cd-to-my-sam-project/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/how-to-add-ci-cd-to-my-sam-project/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, with CDK + SAM you can combine the best of both solutions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How to create serverless applications with CDK and SAM&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/how-to-create-serverless-applications-with-cdk-and-sam/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/how-to-create-serverless-applications-with-cdk-and-sam/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security
&lt;/h3&gt;

&lt;p&gt;These articles will help you think about and improve the security of your AWS accounts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Getting Started with AWS Security&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/getting-started-with-aws-security/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/getting-started-with-aws-security/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How to improve your account security&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/how-to-improve-your-account-security/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/how-to-improve-your-account-security/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon GuardDuty: Deep dive&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/aws-security-hub-deep-dive/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/aws-security-hub-deep-dive/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Security Hub: Deep dive&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/amazon-guardduty-deep-dive/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/amazon-guardduty-deep-dive/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
   Multi-account approach
&lt;/h3&gt;

&lt;p&gt;Then, I published these 2 articles about the multi-account approach. When do you need a multi-account solution? Why do you need a multi-account solution? AWS multi-account approach in detail: AWS Organizations and AWS Control Tower:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Getting started with AWS Multi-account approach&lt;/strong&gt; &lt;a href="https://www.playingaws.com/posts/multi-account-approach/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/multi-account-approach/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Control Tower Deep Dive&lt;/strong&gt; &lt;a href="https://www.playingaws.com/posts/aws-control-tower-deep-dive/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/aws-control-tower-deep-dive/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Machine Learning
&lt;/h3&gt;

&lt;p&gt;This article about machine learning is specific of AWS DeepRacer. If you are not familiar with this AWS service I recommend you to check it out. It is a fun way to learn machine learning!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DeepRacer&lt;/strong&gt; - First steps with Machine Learning: &lt;a href="https://www.playingaws.com/posts/deepracer-first-steps-with-machine-learning/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/deepracer-first-steps-with-machine-learning/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Open-source tools
&lt;/h3&gt;

&lt;p&gt;Lastly, I have posted 3 articles about open source tools that can help you with your AWS account and your AWS code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Getting started&lt;/strong&gt; with AWS open-source tools: &lt;a href="https://www.playingaws.com/posts/aws-open-source-tools/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/aws-open-source-tools/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Open source tools to &lt;strong&gt;analyze your AWS environment&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/aws-open-source-tools-environment/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/aws-open-source-tools-environment/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;How open source tools can &lt;strong&gt;help you with your code&lt;/strong&gt;: &lt;a href="https://www.playingaws.com/posts/aws-open-source-tools-code/" rel="noopener noreferrer"&gt;https://www.playingaws.com/posts/aws-open-source-tools-code/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;I will follow publishing regularly about some AWS topics. I have a lot of topics and I just need time to do it!&lt;/p&gt;

&lt;p&gt;And as I said, feedback is like a treasure and I would appreciate it very much, here or on any of my blog posts!&lt;/p&gt;

&lt;p&gt;Feel free to comment, share and enjoy. Thanks for reading to the end!&lt;/p&gt;

</description>
      <category>crypto</category>
      <category>blockchain</category>
      <category>web3</category>
      <category>offers</category>
    </item>
  </channel>
</rss>
