<?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: Shambhavi Chaukiyal</title>
    <description>The latest articles on DEV Community by Shambhavi Chaukiyal (@shambhavi_chaukiyal_c3b0d).</description>
    <link>https://dev.to/shambhavi_chaukiyal_c3b0d</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%2F2049168%2F5cede0ca-5f58-421f-aae9-30a804219f80.jpg</url>
      <title>DEV Community: Shambhavi Chaukiyal</title>
      <link>https://dev.to/shambhavi_chaukiyal_c3b0d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shambhavi_chaukiyal_c3b0d"/>
    <language>en</language>
    <item>
      <title>[Mini Project] Serverless Blog Generator Using AWS Lambda, API Gateway, S3 &amp; Amazon Bedrock</title>
      <dc:creator>Shambhavi Chaukiyal</dc:creator>
      <pubDate>Thu, 01 May 2025 21:16:01 +0000</pubDate>
      <link>https://dev.to/shambhavi_chaukiyal_c3b0d/mini-project-serverless-blog-generator-using-aws-lambda-api-gateway-s3-amazon-bedrock-13k6</link>
      <guid>https://dev.to/shambhavi_chaukiyal_c3b0d/mini-project-serverless-blog-generator-using-aws-lambda-api-gateway-s3-amazon-bedrock-13k6</guid>
      <description>&lt;p&gt;Before Starting, Consider this Options Too:&lt;br&gt;
    -For direct implementation steps, visit the GitHub repo:&lt;br&gt;
     &lt;a href="https://github.com/Shambhavichaukiyal/BlogBeacon_Stream" rel="noopener noreferrer"&gt;Serverless Blog Generator&lt;/a&gt;&lt;br&gt;
In this tutorial, we will walk through building a Serverless Blog Generator using AWS services like Lambda, API Gateway, Amazon S3, and Amazon Bedrock (or OpenAI). The goal of this project is to create a scalable and cost-effective system that generates detailed blog content from a given topic using Generative AI and stores the result in a publicly accessible location.&lt;/p&gt;

&lt;p&gt;This project is designed to be beginner-friendly and will guide you step-by-step. You’ll also get hands-on experience with AWS Bedrock, Lambda, API Gateway, and S3 – essential components in modern serverless and AI-powered architectures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;br&gt;
Before we start, ensure that you have the following prerequisites:&lt;br&gt;
&lt;strong&gt;AWS Account&lt;/strong&gt;: If you don’t already have an AWS account &lt;a href="https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&amp;amp;all-free-tier.sort-order=asc&amp;amp;awsf.Free%20Tier%20Types=*all&amp;amp;awsf.Free%20Tier%20Categories=*all" rel="noopener noreferrer"&gt;sign up&lt;/a&gt;&lt;br&gt;
(below if working with CLI)&lt;br&gt;
&lt;strong&gt;AWS CLI&lt;/strong&gt;: The AWS Command Line Interface (CLI) allows you to interact with AWS services via terminal. &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html" rel="noopener noreferrer"&gt;Install AWS CLI for Windows&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Python 3.x&lt;/strong&gt;: Our Lambda function will be written in Python. Make sure Python 3.x is installed on your system from &lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer"&gt;python.org&lt;/a&gt;.&lt;br&gt;
&lt;strong&gt;Postman&lt;/strong&gt;: For testing APIs, download and install Postman &lt;a href="https://www.postman.com/downloads/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Implementation&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Setting Up AWS Bedrock
&lt;/h2&gt;

&lt;p&gt;To get started with generating blogs, the first step is to request a model from AWS Bedrock. Bedrock provides various pre-trained models, and you can choose the model best suited for your region. In this case, although I initially considered a chat-based model like Llama, I ended up using a model available in my region for practice.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;strong&gt;AWS Bedrock Console&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;From the Bedrock Dashboard, click on &lt;strong&gt;Create New Model&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose the model that fits your use case, keeping in mind your region's availability. (You can use any model that provides text generation capabilities).&lt;/li&gt;
&lt;li&gt;Once you have selected the model, note down the &lt;strong&gt;Model ARN&lt;/strong&gt; (Amazon Resource Name), which will be used later in Lambda to make requests to the model.&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%2F65loqvfxh9uwko30pzzs.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%2F65loqvfxh9uwko30pzzs.png" alt="selecting model in AWS Bedrock" width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Prepare Lambda for Model Integration
&lt;/h2&gt;
&lt;h3&gt;
  
  
  2.1 Create a Lambda Function
&lt;/h3&gt;

&lt;p&gt;Now, we need to set up an AWS Lambda function that will interact with the Bedrock model. Here are the steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;strong&gt;AWS Lambda Console&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Create function&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Author from scratch&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;For the runtime, select the latest Python version (Python 3.12 is a good choice).&lt;/li&gt;
&lt;li&gt;Choose the necessary role permissions (You can create a new role or use an existing one with permissions to interact with AWS Bedrock).
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import boto3
import botocore.config
import json
from datetime import datetime
def blog_generate_using_bedrock(blogtopic:str)-&amp;gt;str:
    prompt=f""" &amp;lt;s&amp;gt;[INST]Human:Write a 200 words blog on he topic {blogtopic}
    Assistant:[/INST]
    """
    body={
        "prompt":prompt,
        "max_gen_len":512,
        "temperature":0.5,
        "top_p":0.9
    }
    try:
        bedrock=boto3.client("bedrock-runtime",region_name="ap-south-1",config=botocore.config.Config(read_timeout=300,retries={'max_attempts':3}))
        response=bedrock.invoke_model(body=json.dumps(body),modelId="meta.llama3-8b-instruct-v1:0")

        response_content=response.get('body').read()
        response_data=json.loads(response_content)
        print(response_data)
        blog_details=response_data['generation']
        return blog_details
    except Exception as e:
        print(f"Error generating the blog:{e}")
        return ""



def save_blog_details_s3(s3_key,s3_bucket,generate_blog):
    s3=boto3.client('s3')
    try:
        s3.put_object(Bucket = s3_bucket, Key = s3_key, Body =generate_blog )
        print("Code saved to s3")

    except Exception as e:
        print("Error when saving the code to s3")




def lambda_handler(event, context):
    # TODO implement

    event=json.loads(event['body'])
    blogtopic=event['blog_topic']
    generate_blog=blog_generate_using_bedrock(blogtopic=blogtopic)
    if generate_blog:
        curr_time=datetime.now().strftime('%H%M%S')
        s3_key=f"blog-output/{curr_time}.txt"
        s3_bucket='awsbedrockproject01'
        save_blog_details_s3(s3_key,s3_bucket,generate_blog)
    else:
        print("No blog was generated ")

    return{
        'statusCode':200,
        'body':json.dumps('Blog Generation is Completed')
    }


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

&lt;/div&gt;

&lt;h3&gt;
  
  
  2.2 Import the Latest &lt;code&gt;boto3&lt;/code&gt; Package
&lt;/h3&gt;

&lt;p&gt;Since Lambda does not include the &lt;code&gt;boto3&lt;/code&gt; package by default in the function environment, we will need to include it. You can either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Option 1:&lt;/strong&gt; Upload a ZIP file containing the latest &lt;code&gt;boto3&lt;/code&gt; package directly to Lambda.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Option 2:&lt;/strong&gt; Create a Lambda Layer for the &lt;code&gt;boto3&lt;/code&gt; library and attach it to your function. This will allow you to keep the function’s size smaller.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  How to Create and Upload the &lt;code&gt;boto3&lt;/code&gt; ZIP File
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;On your local machine, create a new directory and install the &lt;code&gt;boto3&lt;/code&gt; package there:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;mkdir &lt;/span&gt;my_lambda_package
   &lt;span class="nb"&gt;cd &lt;/span&gt;my_lambda_package
   pip &lt;span class="nb"&gt;install &lt;/span&gt;boto3 &lt;span class="nt"&gt;-t&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Compress the directory into a ZIP file:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   zip &lt;span class="nt"&gt;-r9&lt;/span&gt; boto3-layer.zip &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Go to your Lambda Console, navigate to your function, and under &lt;strong&gt;Layers&lt;/strong&gt;, click on &lt;strong&gt;Add a layer&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Upload the &lt;code&gt;boto3-layer.zip&lt;/code&gt; file.&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%2F4co4rz9rvloqdj43um5x.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%2F4co4rz9rvloqdj43um5x.png" alt="Lambda Layers section " width="800" height="282"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3: Set Up API Gateway
&lt;/h2&gt;

&lt;p&gt;Next, we will use API Gateway to expose a REST API for our Lambda function. API Gateway will handle incoming requests and route them to Lambda.&lt;/p&gt;
&lt;h3&gt;
  
  
  3.1 Create a New API
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;strong&gt;API Gateway Console&lt;/strong&gt; and click on &lt;strong&gt;Create API&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;REST API&lt;/strong&gt; and click &lt;strong&gt;Build&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;New API&lt;/strong&gt;, name it (e.g., &lt;code&gt;BlogGenAPI&lt;/code&gt;), and click &lt;strong&gt;Create API&lt;/strong&gt;.&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%2Fjdrt73ihn3psfz6vvw2j.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%2Fjdrt73ihn3psfz6vvw2j.png" alt="API Gateway Integration" width="800" height="140"&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%2Flkcfpp6tzdas9cjfoj0d.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%2Flkcfpp6tzdas9cjfoj0d.png" alt="API Gateway Stages" width="800" height="167"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4: Configure S3 Bucket for Blog Storage
&lt;/h2&gt;

&lt;p&gt;In this step, we'll set up an S3 bucket to store the generated blogs.&lt;/p&gt;
&lt;h3&gt;
  
  
  4.1 Create an S3 Bucket
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;strong&gt;S3 Console&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create bucket&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Choose a unique name for your bucket (e.g., &lt;code&gt;my-blog-storage&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&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%2Fy6l1670dm4a6tsego1dk.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%2Fy6l1670dm4a6tsego1dk.png" alt="S3 Bucket" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  4.2 Update Lambda Code for S3 Integration
&lt;/h3&gt;

&lt;p&gt;Now, we need to modify the Lambda function to save the generated blog content to the S3 bucket. Add the following steps to your Lambda function:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use the &lt;code&gt;boto3&lt;/code&gt; library to interact with S3.&lt;/li&gt;
&lt;li&gt;After generating the blog content, save it as a text file in the S3 bucket.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a simple code snippet for the Lambda function to save content to S3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;uuid&lt;/span&gt;

&lt;span class="n"&gt;s3_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;boto3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;client&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s3&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;lambda_handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Generate blog content using Bedrock model
&lt;/span&gt;    &lt;span class="n"&gt;blog_content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;generate_blog_content&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;# Define the S3 bucket and file name
&lt;/span&gt;    &lt;span class="n"&gt;bucket_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;your-bucket-name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
    &lt;span class="n"&gt;file_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;blog-&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uuid4&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;.txt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="c1"&gt;# Upload the blog content to S3
&lt;/span&gt;    &lt;span class="n"&gt;s3_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put_object&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Body&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;blog_content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Bucket&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;bucket_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;file_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;statusCode&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;body&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Blog generated successfully!&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;file&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;file_name&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_blog_content&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="c1"&gt;# Call Bedrock model to generate content (pseudo-code)
&lt;/span&gt;    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Your generated blog content goes here.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;
&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%2Fz60y7qyaqf8vjqr2vpqd.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%2Fz60y7qyaqf8vjqr2vpqd.png" alt="Using S3 Bucket" width="732" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Test the API Using ReqBin (Free Online Tool)
&lt;/h2&gt;

&lt;p&gt;How to Test:&lt;/p&gt;

&lt;p&gt;Go to &lt;a href="https://reqbin.com" rel="noopener noreferrer"&gt;Reqbin&lt;/a&gt;.&lt;br&gt;
Select method: POST.&lt;br&gt;
Enter the API endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://iplkor8qad.execute-api.ap-south-1.amazonaws.com/dev/blog_generation

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

&lt;/div&gt;



&lt;p&gt;Choose Content-Type: application/json.&lt;/p&gt;

&lt;p&gt;Add the request body:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "blog_topic": "Benefits of Rhodendron tea"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Click Send and verify the response.&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%2Fpg7jcrqpzngo0yb20qu8.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%2Fpg7jcrqpzngo0yb20qu8.png" alt="AYZ" width="774" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see:&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%2F3y873hshbtmbvjf5xv0w.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%2F3y873hshbtmbvjf5xv0w.png" alt="ABC" width="481" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can check your S3 Bucket for the blog that is generated:&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%2Foxavee9q6v6ezob4rsta.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%2Foxavee9q6v6ezob4rsta.png" alt="S3 Bucket" width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output&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%2F1qe0j7a3wp5rgqfqup9f.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%2F1qe0j7a3wp5rgqfqup9f.png" alt="Output" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture Diagram&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%2Fr8iwxcjnvhgs7q0pvkpe.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%2Fr8iwxcjnvhgs7q0pvkpe.png" alt="Architecture" width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;This blog walks you through the complete process of setting up an AI-driven blog generation system using AWS services like Bedrock, Lambda, API Gateway, and S3. By following these steps, you can easily generate and store blog content using AWS's powerful infrastructure. This is just one of many possibilities for integrating AWS into your applications, and I encourage you to explore more AWS services and capabilities.&lt;/p&gt;

&lt;p&gt;Feel free to contribute to this project and help improve it! You can find the repository &lt;a href="https://github.com/Shambhavichaukiyal/BlogBeacon_Stream" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connect with Me:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/shambhavi-chaukiyal-463705228/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Shambhavichaukiyal" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Repository:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Shambhavichaukiyal/BlogBeacon_Stream" rel="noopener noreferrer"&gt;Blog generator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading - Shambhavi Chaukiyal&lt;/p&gt;

</description>
      <category>aws</category>
      <category>gpt3</category>
      <category>bedrock</category>
      <category>apigateway</category>
    </item>
  </channel>
</rss>
