<?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: aswin raj</title>
    <description>The latest articles on DEV Community by aswin raj (@aswin_raj_d40fb50e584e2b7).</description>
    <link>https://dev.to/aswin_raj_d40fb50e584e2b7</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%2F2748616%2F8fb9444b-0d27-40a6-9bed-fb2953b36e27.jpeg</url>
      <title>DEV Community: aswin raj</title>
      <link>https://dev.to/aswin_raj_d40fb50e584e2b7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aswin_raj_d40fb50e584e2b7"/>
    <language>en</language>
    <item>
      <title>Build a Serverless Web Application using Generative AI</title>
      <dc:creator>aswin raj</dc:creator>
      <pubDate>Tue, 25 Feb 2025 04:50:07 +0000</pubDate>
      <link>https://dev.to/aswin_raj_d40fb50e584e2b7/build-a-serverless-web-application-using-generative-ai-219h</link>
      <guid>https://dev.to/aswin_raj_d40fb50e584e2b7/build-a-serverless-web-application-using-generative-ai-219h</guid>
      <description>&lt;p&gt;We are going to use AWS Amplify to build a serverless web application powered by Generative AI using Amazon Bedrock and the Claude 3 Sonnet foundation. Where user can enter a list of ingredients, and the application will generate delicious recipes based on the input ingredients. The application includes an HTML-based user interface for ingredient submission and a backend web app to request AI generated recipes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;APPLICATION ARCHITECTURE&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%2Fmm5b9wbyel8hu3xk2flm.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%2Fmm5b9wbyel8hu3xk2flm.jpg" alt="Image description" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMPLEMENTATION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;STEP 1: Create a new React application or you can use Vite to create a React application.&lt;/p&gt;

&lt;p&gt;To create it you these command.&lt;br&gt;
npm create vite@latest ai-recipe-generator -- --template react-ts -y&lt;br&gt;
cd ai-recipe-generator&lt;br&gt;
npm install&lt;br&gt;
npm run dev&lt;/p&gt;

&lt;p&gt;STEP 2: Initialize a GitHub repository name it as &lt;strong&gt;ai-recipe-generator&lt;/strong&gt; and make the repository as public. Then push of the application to the repository(ai-recipe-generator) by using these commands.&lt;/p&gt;

&lt;p&gt;git init&lt;br&gt;
git add .&lt;br&gt;
git commit -m "first commit"&lt;br&gt;
git remote add origin &lt;a href="mailto:git@github.com"&gt;git@github.com&lt;/a&gt;:/ai-recipe-generator.git&lt;br&gt;
git branch -M main&lt;br&gt;
git push -u origin main&lt;/p&gt;

&lt;p&gt;STEP 3: Install the Amplify packages, go to the terminal and the run the command.&lt;br&gt;
npm create amplify@latest -y&lt;/p&gt;

&lt;p&gt;After installing amplify package push the changes to the GitHub repository by using &lt;br&gt;
git add .&lt;br&gt;
git commit -m 'installing amplify'&lt;br&gt;
git push origin main&lt;/p&gt;

&lt;p&gt;STEP 5: Deploy your app with AWS Amplify.&lt;/p&gt;

&lt;p&gt;Go to AWS Amplify in the AWS console and press the create app in the top right corner.&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%2Fvlz2oi37ni2ir3l2vffa.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%2Fvlz2oi37ni2ir3l2vffa.png" alt="Image description" width="800" height="104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select GitHub and click Next.&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%2Fovr1njel55z64hkxgir1.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%2Fovr1njel55z64hkxgir1.png" alt="Image description" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, choose the repository and main branch you created earlier. Then select Next.&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%2Fgplknzopglqs0uzwwcg9.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%2Fgplknzopglqs0uzwwcg9.png" alt="Image description" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Leave the default build settings, and select Next.&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%2Fukuvx88a3uxi0q9fyeij.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%2Fukuvx88a3uxi0q9fyeij.png" alt="Image description" width="800" height="995"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Review the inputs selected, and choose Save and deploy.&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%2Fvhs235bg2l37t5kkgnpe.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%2Fvhs235bg2l37t5kkgnpe.png" alt="Image description" width="800" height="877"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AWS Amplify will now build your source code and deploy your app at https://...amplifyapp.com, and on every git push your deployment instance will update. It may take up to 5 minutes to deploy your app.&lt;br&gt;
Once the build completes, select the Visit deployed URL button to see your web app up and running live. &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%2Fhnwhxpmpmw9urk6532td.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%2Fhnwhxpmpmw9urk6532td.png" alt="Image description" width="800" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;STEP 6: Setup your Amplifu Auth&lt;br&gt;
On your local machine, navigate to the ai-generated-recipes/amplify/auth/resource.ts file and update it with the following code. Then, save the file.&lt;/p&gt;

&lt;p&gt;import { defineAuth } from "@aws-amplify/backend";&lt;br&gt;
export const auth = defineAuth({&lt;br&gt;
  loginWith: {&lt;br&gt;
    email: {&lt;br&gt;
      verificationEmailStyle: "CODE",&lt;br&gt;
      verificationEmailSubject: "Welcome to the AI-Powered Recipe Generator!",&lt;br&gt;
      verificationEmailBody: (createCode) =&amp;gt;&lt;br&gt;
        &lt;code&gt;Use this code to confirm your account: ${createCode()}&lt;/code&gt;,&lt;br&gt;
    },&lt;br&gt;
  },&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;STEP 7: Setup the Amazon Bedrock Model Access&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sign in to the AWS Management console in a new browser window, and open the AWS Amazon Bedrock console at  &lt;a href="https://console.aws.amazon.com/bedrock/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/bedrock/&lt;/a&gt;. Verify that you are in the N. Virginia us-east-1 region, and choose Get started.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the Foundation models section, choose the Claude model.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scroll down to the Claude models section, and choose the Claude 3 Sonnet tab, and select Request model access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the Base models section, for Claude 3 Sonnet, choose Available to request, and select Request model access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the Edit model access page, choose Next.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the Review and Submit page, choose Submit.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;STEP 7: Create a Lambda function for handling requests.&lt;br&gt;
On your local machine, navigate to the ai-recipe-generator/amplify/data folder, and create a file named bedrock.js. &lt;br&gt;
Then, update the file with the following code:&lt;/p&gt;

&lt;p&gt;export function request(ctx) {&lt;br&gt;
    const { ingredients = [] } = ctx.args;&lt;br&gt;
    const prompt = &lt;code&gt;Suggest a recipe idea using these ingredients: ${ingredients.join(", ")}.&lt;/code&gt;;&lt;br&gt;
    return {&lt;br&gt;
      resourcePath: &lt;code&gt;/model/anthropic.claude-3-sonnet-20240229-v1:0/invoke&lt;/code&gt;,&lt;br&gt;
      method: "POST",&lt;br&gt;
      params: {&lt;br&gt;
        headers: {&lt;br&gt;
          "Content-Type": "application/json",&lt;br&gt;
        },&lt;br&gt;
        body: JSON.stringify({&lt;br&gt;
          anthropic_version: "bedrock-2023-05-31",&lt;br&gt;
          max_tokens: 1000,&lt;br&gt;
          messages: [&lt;br&gt;
            {&lt;br&gt;
              role: "user",&lt;br&gt;
              content: [&lt;br&gt;
                {&lt;br&gt;
                  type: "text",&lt;br&gt;
                  text: &lt;code&gt;\n\nHuman: ${prompt}\n\nAssistant:&lt;/code&gt;,&lt;br&gt;
                },&lt;br&gt;
              ],&lt;br&gt;
            },&lt;br&gt;
          ],&lt;br&gt;
        }),&lt;br&gt;
      },&lt;br&gt;
    };&lt;br&gt;
  }&lt;br&gt;
  export function response(ctx) {&lt;br&gt;
    const parsedBody = JSON.parse(ctx.result.body);&lt;br&gt;
    const res = {&lt;br&gt;
      body: parsedBody.content[0].text,&lt;br&gt;
    };&lt;br&gt;
    return res;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;STEP 8: Add Amazon Bedrock as a data source.&lt;br&gt;
Update the amplify/backend.ts file with the following code. Then, save the file.&lt;/p&gt;

&lt;p&gt;import { defineBackend } from "@aws-amplify/backend";&lt;br&gt;
import { data } from "./data/resource";&lt;br&gt;
import { PolicyStatement } from "aws-cdk-lib/aws-iam";&lt;br&gt;
 import { auth } from "./auth/resource";&lt;br&gt;
 const backend = defineBackend({&lt;br&gt;
   auth,&lt;br&gt;
   data,&lt;br&gt;
 });&lt;br&gt;
 const bedrockDataSource = &lt;br&gt;
 backend.data.resources.graphqlApi.addHttpDataSource(&lt;br&gt;
  "bedrockDS",&lt;br&gt;
  "&lt;a href="https://bedrock-runtime.us-east-1.amazonaws.com" rel="noopener noreferrer"&gt;https://bedrock-runtime.us-east-1.amazonaws.com&lt;/a&gt;",&lt;br&gt;
   {&lt;br&gt;
     authorizationConfig: {&lt;br&gt;
       signingRegion: "us-east-1",&lt;br&gt;
       signingServiceName: "bedrock",&lt;br&gt;
     },&lt;br&gt;
   }&lt;br&gt;
 );&lt;br&gt;
 bedrockDataSource.grantPrincipal.addToPrincipalPolicy(&lt;br&gt;
   new PolicyStatement({&lt;br&gt;
     resources: [&lt;br&gt;
       "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3- sonnet-20240229-v1:0",&lt;br&gt;
     ],&lt;br&gt;
     actions: ["bedrock:InvokeModel"],&lt;br&gt;&lt;br&gt;
   })&lt;br&gt;
 );&lt;/p&gt;

&lt;p&gt;STEP 9: Setup Amplify Data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On your local machine, navigate to the ai-recipe-generator/amplify/data/resource.ts file, and update it with the following code. Then, save the file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;import { type ClientSchema, a, defineData } from "@aws-amplify/backend";&lt;/p&gt;

&lt;p&gt;const schema = a.schema({&lt;br&gt;
  BedrockResponse: a.customType({&lt;br&gt;
    body: a.string(),&lt;br&gt;
    error: a.string(),&lt;br&gt;
  }),&lt;/p&gt;

&lt;p&gt;askBedrock: a&lt;br&gt;
    .query()&lt;br&gt;
    .arguments({ ingredients: a.string().array() })&lt;br&gt;
    .returns(a.ref("BedrockResponse"))&lt;br&gt;
    .authorization((allow) =&amp;gt; [allow.authenticated()])&lt;br&gt;
    .handler(&lt;br&gt;
      a.handler.custom({ entry: "./bedrock.js", dataSource: "bedrockDS" })&lt;br&gt;
    ),&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;export type Schema = ClientSchema;&lt;/p&gt;

&lt;p&gt;export const data = defineData({&lt;br&gt;
  schema,&lt;br&gt;
  authorizationModes: {&lt;br&gt;
    defaultAuthorizationMode: "apiKey",&lt;br&gt;
    apiKeyAuthorizationMode: {&lt;br&gt;
      expiresInDays: 30,&lt;br&gt;
    },&lt;br&gt;
  },&lt;br&gt;
});&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a new terminal window, navigate to your apps project folder (ai-recipe-generator), and run the following command to deploy cloud resources into an isolated development space so you can iterate fast.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;npx ampx sandbox&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once the cloud sandbox has been fully deployed, your terminal will display a confirmation message and the amplify_outputs.json file will be generated and added to your project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;STEP 10: Install the Amplify libraries&lt;br&gt;
Open a new terminal window, navigate to your projects root folder (ai-recipe-generator), and run the following command to install the libraries.&lt;/p&gt;

&lt;p&gt;npm install aws-amplify @aws-amplify/ui-react&lt;/p&gt;

&lt;p&gt;STEP 11: Style the App UI.&lt;br&gt;
On your local machine, navigate to the ai-recipe-generator/src/index.css file, and update it with the following code to center the App UI. Then, save the file.&lt;/p&gt;

&lt;p&gt;:root {&lt;br&gt;
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;&lt;br&gt;
  line-height: 1.5;&lt;br&gt;
  font-weight: 400;&lt;/p&gt;

&lt;p&gt;color: rgba(255, 255, 255, 0.87);&lt;/p&gt;

&lt;p&gt;font-synthesis: none;&lt;br&gt;
  text-rendering: optimizeLegibility;&lt;br&gt;
  -webkit-font-smoothing: antialiased;&lt;br&gt;
  -moz-osx-font-smoothing: grayscale;&lt;/p&gt;

&lt;p&gt;max-width: 1280px;&lt;br&gt;
  margin: 0 auto;&lt;br&gt;
  padding: 2rem;&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;.card {&lt;br&gt;
  padding: 2em;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;.read-the-docs {&lt;br&gt;
  color: #888;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;.box:nth-child(3n + 1) {&lt;br&gt;
  grid-column: 1;&lt;br&gt;
}&lt;br&gt;
.box:nth-child(3n + 2) {&lt;br&gt;
  grid-column: 2;&lt;br&gt;
}&lt;br&gt;
.box:nth-child(3n + 3) {&lt;br&gt;
  grid-column: 3;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Update the src/App.css file with the following code to style the ingredients form. Then, save the file.&lt;/p&gt;

&lt;p&gt;.app-container {&lt;br&gt;
  margin: 0 auto;&lt;br&gt;
  padding: 20px;&lt;br&gt;
  text-align: center;&lt;br&gt;
}&lt;br&gt;
.header-container {&lt;br&gt;
  padding-bottom: 2.5rem;&lt;br&gt;
  margin:  auto;&lt;br&gt;
  text-align: center;&lt;br&gt;
  align-items: center;&lt;br&gt;
  max-width: 48rem;&lt;/p&gt;

&lt;p&gt;}&lt;br&gt;
.main-header {&lt;br&gt;
  font-size: 2.25rem;&lt;br&gt;
  font-weight: bold;&lt;br&gt;
  color: #1a202c;&lt;br&gt;
}&lt;br&gt;
.main-header .highlight {&lt;br&gt;
  color: #2563eb;&lt;br&gt;
}&lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/media"&gt;@media&lt;/a&gt; (min-width: 640px) {&lt;br&gt;
  .main-header {&lt;br&gt;
    font-size: 3.75rem;&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;STEP 12: Implement the UI.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On your local machine, navigate to the ai-recipe-generator/src/main.tsx file, and update it with the following code. Then, save the file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;import React from "react";&lt;br&gt;
import ReactDOM from "react-dom/client";&lt;br&gt;
import App from "./App.jsx";&lt;br&gt;
import "./index.css";&lt;br&gt;
import { Authenticator } from "@aws-amplify/ui-react";&lt;br&gt;
ReactDOM.createRoot(document.getElementById("root")!).render(&lt;br&gt;
  React.StrictMode&lt;br&gt;
    Authenticator&lt;br&gt;
      App &lt;br&gt;
    /Authenticator&lt;br&gt;
  /React.StrictMode&lt;br&gt;
);&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the ai-recipe-generator/src/App.tsx file, and update it with the following code. Then, save the file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;import { FormEvent, useState } from "react";&lt;br&gt;
import { Loader, Placeholder } from "@aws-amplify/ui-react";&lt;br&gt;
import "./App.css";&lt;br&gt;
import { Amplify } from "aws-amplify";&lt;br&gt;
import { Schema } from "../amplify/data/resource";&lt;br&gt;
import { generateClient } from "aws-amplify/data";&lt;br&gt;
import outputs from "../amplify_outputs.json";&lt;/p&gt;

&lt;p&gt;import "@aws-amplify/ui-react/styles.css";&lt;/p&gt;

&lt;p&gt;Amplify.configure(outputs);&lt;/p&gt;

&lt;p&gt;const amplifyClient = generateClient({&lt;br&gt;
  authMode: "userPool",&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;function App() {&lt;br&gt;
  const [result, setResult] = useState("");&lt;br&gt;
  const [loading, setLoading] = useState(false);&lt;/p&gt;

&lt;p&gt;const onSubmit = async (event: FormEvent) =&amp;gt; {&lt;br&gt;
    event.preventDefault();&lt;br&gt;
    setLoading(true);&lt;br&gt;
try {&lt;br&gt;
const formData = new FormData(event.currentTarget);&lt;br&gt;
const { data, errors } = await amplifyClient.queries.askBedrock({&lt;br&gt;
ingredients: [formData.get("ingredients")?.toString() || ""],&lt;br&gt;
  });&lt;br&gt;
      if (!errors) {&lt;br&gt;
        setResult(data?.body || "No data returned");&lt;br&gt;
      } else {&lt;br&gt;
        console.log(errors);&lt;br&gt;
      }&lt;br&gt;
    } catch (e) {&lt;br&gt;
      alert(&lt;code&gt;An error occurred: ${e}&lt;/code&gt;);&lt;br&gt;
    } finally {&lt;br&gt;
      setLoading(false);&lt;br&gt;
    }&lt;br&gt;
  };&lt;br&gt;
  return (&lt;br&gt;
  div className="app-container"&lt;br&gt;
 div className="header-container"&lt;br&gt;
 h1 className="main-header"&lt;br&gt;
 Meet Your Personal&lt;br&gt;
   br&lt;br&gt;
          span className="highlight"&amp;gt;Recipe AI
        h1&lt;br&gt;
        p className="description"&lt;br&gt;
          Simply type a few ingredients using the format ingredient1,&lt;br&gt;
          ingredient2, etc., and Recipe AI will generate an all-new recipe on&lt;br&gt;
          demand...&lt;br&gt;
        /p&lt;br&gt;
      div&lt;br&gt;
      form onSubmit={onSubmit} className="form-container"&lt;br&gt;
        div className="search-container"&lt;br&gt;
          input&lt;br&gt;
            type="text"&lt;br&gt;
            className="wide-input"&lt;br&gt;
            id="ingredients"&lt;br&gt;
            name="ingredients"&lt;br&gt;
            placeholder="Ingredient1, Ingredient2, Ingredient3,...etc"&lt;br&gt;
       &lt;br&gt;
       Generate&lt;br&gt;
      button&lt;br&gt;
      form&lt;br&gt;
      div className="result-container"&lt;br&gt;
     {loading ? (&lt;br&gt;
      div className="loader-container"&lt;br&gt;
        Loading...&lt;br&gt;
       Loader size="large"&lt;br&gt;
       Placeholder size="large" &lt;br&gt;
        Placeholder size="large" &lt;br&gt;
        Placeholder size="large" &lt;br&gt;
      div&lt;br&gt;
    ) : (&lt;br&gt;
     result &amp;amp;&amp;amp; &lt;/p&gt;
&lt;p&gt;{result}&lt;/p&gt;
&lt;br&gt;
    )}&lt;br&gt;
);&lt;br&gt;
}

&lt;p&gt;export default App;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a new terminal window, navigate to your projects root directory (ai-recipe-generator), and run the following command to launch the app:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;npm run dev&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Select the Local host link to open the Vite + React application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose the Create Account tab, and use the authentication flow to create a new user by entering your email address and a password. Then, choose Create Account.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You will get a verification code sent to your email. Enter the verification code to log in to the app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When signed in, you can start inputting ingredients and generating recipes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the open terminal window, run the following command to push the changes to GitHub:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git add .&lt;br&gt;
git commit -m 'connect to bedrock'&lt;br&gt;
git push origin main&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sign in to the AWS Management console in a new browser window, and open the AWS Amplify console at &lt;a href="https://console.aws.amazon.com/amplify/apps" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/amplify/apps&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS Amplify automatically builds your source code and deployed your app at https://...amplifyapp.com, and on every git push your deployment instance will update. Select the Visit deployed URL button to see your web app up and running live.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;STEP 12: Clean up all resources.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>aws</category>
    </item>
    <item>
      <title>Introduction and Creation of 3-Tier Architecture by using AWS</title>
      <dc:creator>aswin raj</dc:creator>
      <pubDate>Fri, 24 Jan 2025 05:26:08 +0000</pubDate>
      <link>https://dev.to/aswin_raj_d40fb50e584e2b7/introduction-to-create-3-tier-architecture-by-using-aws-2i0</link>
      <guid>https://dev.to/aswin_raj_d40fb50e584e2b7/introduction-to-create-3-tier-architecture-by-using-aws-2i0</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%2F20g19nvzmkl4q1dde5go.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%2F20g19nvzmkl4q1dde5go.png" alt="Image description" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In modern cloud computing, building a robust and scalable architecture is key to ensuring seamless performance for web applications. The image above represents a classic 3-Tier Architecture on AWS, designed to deliver high availability, security, and fault tolerance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components that are used:&lt;/strong&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Purpose: Facilitates communication between the internet and resources within the Virtual Private Cloud (VPC).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Functionality:Allows public-facing components (e.g., web servers) to receive and send traffic from/to the internet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Acts as an entry point for incoming traffic and an exit point for outgoing traffic.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Elastic Load Balancer (ELB):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Purpose: Distributes incoming traffic across multiple Amazon EC2 instances in the web tier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Types Used Here: Application Load Balancer or Classic Load Balancer (based on the traffic type).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Functionality:Enhances application availability and fault tolerance by balancing load across multiple instances in different Availability Zones (AZs).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automatically adjusts to traffic changes and ensures no single instance is overloaded.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Amazon EC2 Instances:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Purpose: Provide compute power for running applications in both the web tier and the app tier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Functionality:Web Tier: Hosts web servers that handle HTTP/HTTPS traffic and serve user-facing content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;App Tier: Processes application logic securely, isolated from the public internet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deployment: In the Web Tier, instances are deployed in public subnets for internet-facing access.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the App Tier, instances are deployed in private subnets for security and internal communication.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Amazon Aurora:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Managed relational database engine designed for high performance and scalability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Primary DB: Handles write operations and provides a highly secure environment for storing application data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Read Replica: Optimizes performance by offloading read-heavy workloads, ensuring scalability and reduced latency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automatic failover and self-healing capabilities enhance reliability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Subnets:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Public Subnet:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Contains the resources in the Web Tier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Associated with the Internet Gateway for direct internet access.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Private Subnet:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Hosts resources in the App Tier and Database Tier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Isolated from direct internet access, ensuring data and application logic are secure.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Virtual Private Cloud (VPC):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Provides an isolated and secure network environment for resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Functionality:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Allows segmentation of tiers (Web, App, Database) into subnets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ensures communication between resources is secure and tightly controlled.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. Availability Zones (AZs):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Purpose: Geographically distinct data centers that ensure high availability and fault tolerance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Resources are distributed across two AZs, minimizing downtime in case of hardware failures or natural disasters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Architecture Flow&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Internet Gateway receives traffic from the internet.&lt;/li&gt;
&lt;li&gt;Traffic is directed to the Elastic Load Balancer (ELB), which distributes requests to Amazon EC2 instances in the Web Tier.&lt;/li&gt;
&lt;li&gt;Web Tier EC2 instances forward application logic processing to the App Tier EC2 instances hosted in private subnets.&lt;/li&gt;
&lt;li&gt;The App Tier interacts with the Database Tier (Amazon Aurora) for data storage and retrieval.&lt;/li&gt;
&lt;li&gt;Aurora Read Replica handles read-heavy workloads to improve scalability and reduce latency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Implementation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to the github and download the aws-three-tier-architecture-workshop code from that.&lt;/p&gt;

&lt;p&gt;After downloading go to the AWS console and create a S3 bucket.&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%2Fpz67ampj2kvw46vb58sc.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%2Fpz67ampj2kvw46vb58sc.png" alt="Image description" width="800" height="142"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then create a IAM role by giving the policies,&lt;/p&gt;

&lt;p&gt;AmazonS3ReadOnlyAccess&lt;br&gt;
AmazonSSMManagedInstanceCore&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%2Fyadswa9suxxnfoxammoz.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%2Fyadswa9suxxnfoxammoz.png" alt="Image description" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating IAM role go to the VPC and create one.&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%2Fhw5mh2ctruetuk92lmj2.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%2Fhw5mh2ctruetuk92lmj2.png" alt="Image description" width="800" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then create 6 subnets, 3 subnets for availability zone 1, and 3 subnets for availability zone 2.&lt;/p&gt;

&lt;p&gt;Both availability zones have one public subnet and two private subnets.&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%2Fh6e6pbvj1ahky7k23srv.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%2Fh6e6pbvj1ahky7k23srv.png" alt="Image description" width="800" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create Internet Gateway&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%2F2t46ic2nmyet59hcmy3y.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%2F2t46ic2nmyet59hcmy3y.png" alt="Image description" width="800" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create two NAT Gateway because there are two Availability zones and connect both NAT Gateway with the public subnets.&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%2Fzhj19cxd2k6ty30rn5py.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%2Fzhj19cxd2k6ty30rn5py.png" alt="Image description" width="800" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating NAT Gateway create public Route Tables and connect it with the internet gateway.&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%2F6ryhsn9m6hhmpsvohxlk.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%2F6ryhsn9m6hhmpsvohxlk.png" alt="Image description" width="800" height="335"&gt;&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%2Fl2ny233c45krj9kvllx7.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%2Fl2ny233c45krj9kvllx7.png" alt="Image description" width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After connecting the internet gateway with the route table for the AZs1 then connect the public subnet with the route table.&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%2F0dfnzcqyh0is8nm3aese.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%2F0dfnzcqyh0is8nm3aese.png" alt="Image description" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then  again create a route table for the private subnets for the AZs1&lt;br&gt;
and connect both the internet gateway and the private subnet.&lt;/p&gt;

&lt;p&gt;After completing that go to the security group and create six security groups &lt;/p&gt;

</description>
      <category>3tier</category>
      <category>aws</category>
      <category>cloud</category>
    </item>
    <item>
      <title>EC2 + S3 + IAM</title>
      <dc:creator>aswin raj</dc:creator>
      <pubDate>Thu, 23 Jan 2025 10:52:58 +0000</pubDate>
      <link>https://dev.to/aswin_raj_d40fb50e584e2b7/ec2-s3-iam-3nen</link>
      <guid>https://dev.to/aswin_raj_d40fb50e584e2b7/ec2-s3-iam-3nen</guid>
      <description>&lt;p&gt;Step 1: Launch a EC2 instance in your console.&lt;/p&gt;

&lt;p&gt;Click Launch instance.&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%2Fr5z87m1qevyb8llelsk1.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%2Fr5z87m1qevyb8llelsk1.png" alt="Image description" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Give a instance name to your instance.&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%2Fgp5cw43a8ibm0d6jnusm.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%2Fgp5cw43a8ibm0d6jnusm.png" alt="Image description" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: Select t2.micro instance type.&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%2Fbvl7087h1y12kh1vx3yk.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%2Fbvl7087h1y12kh1vx3yk.png" alt="Image description" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4: Create a new key pair for your instance.&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%2F7mbhc6os0xjo6n5e9xlf.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%2F7mbhc6os0xjo6n5e9xlf.png" alt="Image description" width="753" height="714"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Launch instance.&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%2Fr0ife8kbo1tpx40pf8em.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%2Fr0ife8kbo1tpx40pf8em.png" alt="Image description" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4: After creating your instance click your instance and go to the security and change your inbound rules for your instance.&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%2Fhqiawftmm79ebev2hpbo.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%2Fhqiawftmm79ebev2hpbo.png" alt="Image description" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Change the custom ip to my ip address.&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%2Fyb35rb7xtb0hmmdc0wnr.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%2Fyb35rb7xtb0hmmdc0wnr.png" alt="Image description" width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And click save rules.&lt;/p&gt;

&lt;p&gt;Step 5: Go to the putty app, if you are not downloaded then download 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%2F8yr7hv6sinpca0rr1umd.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%2F8yr7hv6sinpca0rr1umd.png" alt="Image description" width="587" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your key pair is .ppm file then change it to private key with the help of puttygen.&lt;br&gt;
After converting it go to the putty and enter the host ip address. And then go to the "SSH" which is in the category then click "Auth" in that click "Credentials". In that enter your private key file for authentication. And then click open.&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%2Fp4ig1erpbnjh98mpmaba.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%2Fp4ig1erpbnjh98mpmaba.png" alt="Image description" width="588" height="530"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 6: Your Terminal gets opened in that just create a file and add some contents in it. &lt;/p&gt;

&lt;p&gt;Command to create a file&lt;/p&gt;

&lt;p&gt;&lt;em&gt;cat &amp;lt; "file_name.txt"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To view the content in the file &lt;/p&gt;

&lt;p&gt;&lt;em&gt;cat "file_name.txt"&lt;/em&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%2F5xgzmfpzbbxzkenfeta0.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%2F5xgzmfpzbbxzkenfeta0.png" alt="Image description" width="653" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 7: Go to the AWS console and then go to the IAM-&amp;gt;Roles. Create a role with "S3fullAccess" policy.&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%2F0phinylsm2r13pk2c9jo.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%2F0phinylsm2r13pk2c9jo.png" alt="Image description" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 8: Go to EC2 instance and click actions and then click security and go the modify IAM role and change the IAM role.&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%2Fspnjss1f8hz04o1wx69a.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%2Fspnjss1f8hz04o1wx69a.png" alt="Image description" width="800" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 7: Go to the terminal, we need to put the created file in the AWS S3 so enter the command &lt;/p&gt;

&lt;p&gt;&lt;em&gt;aws s3 cp "file_name.txt s3://"bucket_name"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If there is no bucket in the S3 then create it by using the command.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;aws s3 mb s3://"bucket_name"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After creating it upload the created file in the bucket by using the command.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;aws s3 cp "file_name.txt s3://"bucket_name"&lt;/em&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%2F2acx8hvwpnjxcxl8p2c3.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%2F2acx8hvwpnjxcxl8p2c3.png" alt="Image description" width="800" height="151"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After uploading the files go check your AWS console to verify 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%2F94s4a61ylzmyxlvcw92u.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%2F94s4a61ylzmyxlvcw92u.png" alt="Image description" width="800" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Completing every steps delete or terminate everything that you have created(EC2, S3, IAM).&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%2Fwt9jgfaldwiscma0is6h.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%2Fwt9jgfaldwiscma0is6h.png" alt="Image description" width="800" height="123"&gt;&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%2Fnzol1mxbfrvbst0jg938.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%2Fnzol1mxbfrvbst0jg938.png" alt="Image description" width="800" height="205"&gt;&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%2Fxwy8r46mp1phkqsb378u.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%2Fxwy8r46mp1phkqsb378u.png" alt="Image description" width="800" height="150"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>s3</category>
      <category>iam</category>
    </item>
    <item>
      <title>Hosting a Static Website by using S3 and CloudFront</title>
      <dc:creator>aswin raj</dc:creator>
      <pubDate>Thu, 23 Jan 2025 09:04:24 +0000</pubDate>
      <link>https://dev.to/aswin_raj_d40fb50e584e2b7/hosting-a-static-website-by-using-s3-and-cloudfront-4j57</link>
      <guid>https://dev.to/aswin_raj_d40fb50e584e2b7/hosting-a-static-website-by-using-s3-and-cloudfront-4j57</guid>
      <description>&lt;p&gt;Steps to Host Static Website and deploying a react file in it.&lt;/p&gt;

&lt;p&gt;Step 1: Download the node.js from the official website. If it is preinstalled check that if it is there or not.&lt;/p&gt;

&lt;p&gt;Commands to check:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;node -v&lt;/em&gt;&lt;br&gt;
&lt;em&gt;npm -v&lt;/em&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%2Fqthhop8u4bdulxc9ar6r.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%2Fqthhop8u4bdulxc9ar6r.png" alt="Image description" width="724" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 2: Create a React file using the command "npm create vite@latest".&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%2Fc4cdpgrwckf6x28dal46.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%2Fc4cdpgrwckf6x28dal46.png" alt="Image description" width="713" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: After creating the file run the commmad &lt;/p&gt;

&lt;p&gt;&lt;em&gt;cd "file_name"&lt;/em&gt;&lt;br&gt;
&lt;em&gt;npm install _&lt;br&gt;
_npm run dev&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After running these code there will be a url run that in the local machine.You will get the output&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%2F3h6jwqqa12pz3pc3wxz1.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%2F3h6jwqqa12pz3pc3wxz1.png" alt="Image description" width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4: Create a S3 Bucket in the AWS &lt;br&gt;
Step 4.1: Go to S3&lt;br&gt;
Step 4.2: Click Create Bucket&lt;br&gt;
Step 4.3: Give a unique name to your bucket and block public access settings for the bucket and enable the bucket versioning &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%2Fsnkgnk1h0bt9o3yaokbp.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%2Fsnkgnk1h0bt9o3yaokbp.png" alt="Image description" width="800" height="201"&gt;&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%2Fm6t5isqupbo7tuloi6wi.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%2Fm6t5isqupbo7tuloi6wi.png" alt="Image description" width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4.4: Create a policy for your bucket &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%2Fdp1iithpo8pk9xyp5ldq.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%2Fdp1iithpo8pk9xyp5ldq.png" alt="Image description" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4.5: Add the files and the folders in the bucket&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%2Fmzuhwlc9o5rhckttq4qb.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%2Fmzuhwlc9o5rhckttq4qb.png" alt="Image description" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 5: Go to the CloudFront and create a distribution and place the origin.&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%2F1jq8vhl8stoj8fqunij7.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%2F1jq8vhl8stoj8fqunij7.png" alt="Image description" width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 6: Copy the domain name and run it you will get the web application which you 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%2Fq7tusjlsjqovmxu56gu7.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%2Fq7tusjlsjqovmxu56gu7.png" alt="Image description" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Link: &lt;a href="http://714022202009-aswin.s3-website.ap-south-1.amazonaws.com" rel="noopener noreferrer"&gt;http://714022202009-aswin.s3-website.ap-south-1.amazonaws.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Distribution Domain Name: &lt;a href="https://d3fwz77yejliam.cloudfront.net" rel="noopener noreferrer"&gt;https://d3fwz77yejliam.cloudfront.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After completing everything delete both the S3 and the cloudfront&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%2Fuwe3jnr4d8s34ub1xduz.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%2Fuwe3jnr4d8s34ub1xduz.png" alt="Image description" width="800" height="404"&gt;&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%2Fnriygcxjlajaokkncyp4.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%2Fnriygcxjlajaokkncyp4.png" alt="Image description" width="800" height="404"&gt;&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%2F9kjvlodkyr3wii3xy8mr.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%2F9kjvlodkyr3wii3xy8mr.png" alt="Image description" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>s3</category>
      <category>cloudfront</category>
    </item>
    <item>
      <title>Amazon CloudFormation</title>
      <dc:creator>aswin raj</dc:creator>
      <pubDate>Wed, 22 Jan 2025 17:32:01 +0000</pubDate>
      <link>https://dev.to/aswin_raj_d40fb50e584e2b7/amazon-cloudformation-120d</link>
      <guid>https://dev.to/aswin_raj_d40fb50e584e2b7/amazon-cloudformation-120d</guid>
      <description>&lt;p&gt;1.&lt;strong&gt;Service Overview:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Amazon CloudFormation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logo:&lt;/strong&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%2Fmf823u4nbtxvjkzg42jx.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%2Fmf823u4nbtxvjkzg42jx.png" alt="Image description" width="420" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-Line Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Automate and Manage AWS Infrastructure with Code.&lt;/p&gt;

&lt;p&gt;2.&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Infrastructure as Code (IaC): Use JSON or YAML templates to define and provision AWS resources automatically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automation: CloudFormation can automate the provisioning of application resources, allowing users to build and rebuild applications without manual actions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stack Management: Organize resources as a single unit (stack) for creation, updates, and deletions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Technical Specifications:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Template Format: JSON and YAML.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Resource Coverage: Over 200 AWS services supported, including EC2, RDS, S3, and Lambda.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.&lt;strong&gt;Use Cases:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-Life Applications:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Web Application Deployment: Automate provisioning of web servers, databases, and load balancers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Multi-Region Disaster Recovery: Simplify replication of critical infrastructure across AWS regions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DevOps Automation: Integrate with CI/CD pipelines for continuous deployment.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.&lt;strong&gt;Pricing Model:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pricing Overview:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon CloudFormation is a free service. You only pay for the AWS resources created or modified using your CloudFormation templates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Examples of Costs:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;EC2 instances, storage volumes, and RDS databases are billed based on their respective usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.&lt;strong&gt;Comparison with Similar Services:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AWS CloudFormation is an Infrastructure as Code (IaC) service that manages AWS resources. Similar services include Terraform, Azure Resource Manager (ARM), and Ansible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Terraform:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terraform supports multi-cloud environments, including AWS, Azure, and Google Cloud.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terraform has a user-friendly syntax that uses HashiCorp Configuration Language (HCL) or JSON.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Azure Resource Manager (ARM):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Purpose: ARM templates manage infrastructure as code for Azure, similar to CloudFormation templates for AWS.&lt;br&gt;
Format: ARM templates use JSON format.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ansible:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuration drift:&lt;/strong&gt;            &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ansible can identify and fix configuration drift in infrastructure resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Playbooks:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Users can run Ansible playbooks regularly to ensure the required infrastructure state is maintained.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6.&lt;strong&gt;Benefits and Challenges:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Automates infrastructure provisioning and reduces manual errors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deep integration with AWS services ensures consistent and optimized resource creation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Drift detection ensures operational stability by identifying mismatches in deployed resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No additional cost for using the service.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Limitations or Challenges:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Steeper learning curve for writing JSON/YAML templates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Limited portability to non-AWS platforms compared to tools like Terraform.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;7.&lt;strong&gt;Real World or Case Study:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Case Study: Coca-Cola&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Coca-Cola uses Amazon CloudFormation to deploy and manage telemetry systems for its global vending machines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Impact:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Automated deployment reduced manual setup times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalable infrastructure ensured rapid expansion to new regions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>cloudformation</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
