Post

Generating blog summaries with AWS Bedrock

Generating blog summaries with AWS Bedrock

Generating blog summaries

I am lazy, I don’t want to write a summary of what I’ve just written about. I need to find a solution that can quickly and automatically generate summaries of my blog posts. After attending re:Invent 2024, I have been innspired to look into more practical applications of generative AI.

What is AWS Bedrock?

AWS Bedrock is a fully managed service that allows developers to build and scale generative AI applications using foundation models from various AI providers like Anthropic, Meta and Amazon

The idea

  • Automatically generate summaries bedrock
    • Generate 3-5 sentences based onn the blog post
  • Inject summaries back into the blog post
  • Fully automate this in a CI/CD pipeline
  • Make it cost-effective (or as close to it as overengineering allows)

Automatically generate blog post summaries by the use of AWS Bedrock. I’m planning to use the newly realeased AWS Nova foundation model for this purpose. The generation needs to be automated, I will use Lambda to integrate My CodePipeline has the following stages: Source, Build, Test, Deploy, Invalidate CloudFront Cache. Jekyll should build with the summary file, so the Summary stage should be before Build.

Architecture

I am hosting a small cost efficient and simple blog, now let’s overcomplicate it.

The website consists of:

  • Private S3 bucket hosting the Jekyll content
  • CloudFront authenticating with OAC to the S3 bucket
    • CloudFront functions redirecting to index.html, that’s a whole different story
  • Web Application Firewall
  • CodePipeline and CodeBuild for CI/CD
    • Source
    • Summary Generation (New)
    • Build
    • Test
    • Deploy
    • Invalidate cache

Architecture

Summary Generation

  • Request access to Bedrock FM
  • Create Lambda
  • Integrate with CDK
  • Test

Implementation

Results

Future improvements

  • The summaries are not persistent in GitHub, they only exist in the S3 bucket after deployment
    • Would be cool to push back to git, but as of now that will trigger a new pipeline run and cause an infinite loop
This post is licensed under CC BY 4.0 by the author.