Skip to content

apigw-rest-stepfunctions-express-sync-bedrock-sam: Migrate from Cohere Command R to Amazon Nova 2 Lite#2864

Merged
julianwood merged 7 commits intoaws-samples:mainfrom
kakakakakku:apigw-rest-stepfunctions-express-sync-bedrock-sam
Apr 24, 2026
Merged

apigw-rest-stepfunctions-express-sync-bedrock-sam: Migrate from Cohere Command R to Amazon Nova 2 Lite#2864
julianwood merged 7 commits intoaws-samples:mainfrom
kakakakakku:apigw-rest-stepfunctions-express-sync-bedrock-sam

Conversation

@kakakakakku
Copy link
Copy Markdown
Contributor

@kakakakakku kakakakakku commented Nov 24, 2025

Issue #, if available:
N/A

Description of changes:
Hi😀 Thanks for the useful patterns!

I noticed that cohere.command-text-v14 can no longer be used. When actually deployed, the following error occurs:

This model version has reached the end of its life. Please refer to the AWS documentation for more details. (Service: BedrockRuntime, Status Code: 404, Request ID: cf44cd36-ec38-47ca-a75b-128cb45d2024) (SDK Attempt Count: 1)

Therefore, I updated the model to use Cohere Command R instead.

Note

As of March 2026, Cohere text generation models (including Command R) are no longer available on Amazon Bedrock. After discussing with the maintainer @biswanathmukherjee, this PR has been updated to migrate the pattern to Amazon Nova 2 Lite so it remains functional.

Check (legacy)

$ curl -s -H "Content-type: application/json" -X POST -d '{"prompt_one": "Write a 500 word blog post on The Beatles"}' https://o2l9vt5uyi.execute-api.us-east-1.amazonaws.com/dev | jq .
{
  "prompt_one": "Write a 500 word blog post on The Beatles",
  "result_one": {
    "result_one": "The Beatles are an iconic English rock band that rose to fame in the 1960s, and their music still resonates with fans around the world decades later. Formed in Liverpool in 1960, the band originally consisted of John Lennon, Paul McCartney, George Harrison, Ringo Starr, and Stuart Sutcliffe. The Beatles' music and influence continue to be a staple of the music industry, and their cultural impact remains unparalleled. \n\nThe band's journey to international stardom began in the clubs of Liverpool and Hamburg, where they honed their signature sound and developed their unique image. With Lennon as the enigmatic frontman and McCartney as the talented songwriter, The Beatles quickly rose through the ranks of the music industry. Their early albums, like \"Please Please Me\" and \"With the Beatles,\" showcased their talent and attracted a dedicated fan base.\n\nThe Beatles' musical genius was unmatched, and their innovative songwriting and experimental recording techniques revolutionized popular music. They incorporated new ideas, such as studio manipulation and electronic elements, to create a sound that was fresh and exciting. Their songs, such as \"Eleanor Rigby\" and \"Yellow Submarine,\" captured the imagination of fans and reflected the social changes of the time. The band also explored philosophical and literary influences in their music, adding a layer of depth to their lyrics.\n\nBut the band's impact extends far beyond their musical prowess. Their animated film \"Yellow Submarine\" captured the hearts of fans of all ages, and their iconic album covers, designed by artists like Stuart Sutcliffe and Peter Blake, became cultural touchstones. The Beatles also played a pivotal role in promoting racial equality in popular culture. During a time of widespread racial prejudice, the band stood against bigotry and supported the rights of everyone to enjoy their music.\n\nThe Beatles' global impact was felt across many countries, with the band members themselves becoming international celebrities. Their legendary concerts, including the historic performances at the Cavern Club in Liverpool and Shea Stadium in New York, attracted frenzied fans and cemented their status as icons. The Beatles' influence on the fashion and cultural revolutions of the 1960s was also significant, with their stylish outfits and iconic hairstyles setting trends that defined a generation.\n\nIn the late 1960s, the band members began to pursue solo projects, and the Beatles eventually parted ways in 1970. Despite the band's dissolution, their music continues to captivate new generations of fans. Their catalog of music remains a testament to their extraordinary talent, and their legacy continues to be celebrated in numerous ways. Beatles tribute bands, documentaries, and projects such as the Cirque du Soleil show \"Love\" keep the spirit of the band alive.\n\nThe Beatles' induction into the Rock and Roll Hall of Fame in 1988, along with numerous Grammy Awards and a prestigious Brit Award, stands as a testament to their enduring influence on popular music. Their songs are evergreen, regularly topping playlists across the world, and their legacy as one of the most iconic bands in history remains unwavering. \n\nDecades after their formation, The Beatles are still beloved, proving that their music and impact are truly timeless. Their extraordinary journey from the clubs of Liverpool to international stardom remains a fascinating tale, and their contribution to the fabric of music and culture will forever be cherished."
  },
  "chat_history": {
    "chat_history": [
      {
        "role": "USER",
        "message": "Write a 500 word blog post on The Beatles"
      },
      {
        "role": "CHATBOT",
        "message": "The Beatles are an iconic English rock band that rose to fame in the 1960s, and their music still resonates with fans around the world decades later. Formed in Liverpool in 1960, the band originally consisted of John Lennon, Paul McCartney, George Harrison, Ringo Starr, and Stuart Sutcliffe. The Beatles' music and influence continue to be a staple of the music industry, and their cultural impact remains unparalleled. \n\nThe band's journey to international stardom began in the clubs of Liverpool and Hamburg, where they honed their signature sound and developed their unique image. With Lennon as the enigmatic frontman and McCartney as the talented songwriter, The Beatles quickly rose through the ranks of the music industry. Their early albums, like \"Please Please Me\" and \"With the Beatles,\" showcased their talent and attracted a dedicated fan base.\n\nThe Beatles' musical genius was unmatched, and their innovative songwriting and experimental recording techniques revolutionized popular music. They incorporated new ideas, such as studio manipulation and electronic elements, to create a sound that was fresh and exciting. Their songs, such as \"Eleanor Rigby\" and \"Yellow Submarine,\" captured the imagination of fans and reflected the social changes of the time. The band also explored philosophical and literary influences in their music, adding a layer of depth to their lyrics.\n\nBut the band's impact extends far beyond their musical prowess. Their animated film \"Yellow Submarine\" captured the hearts of fans of all ages, and their iconic album covers, designed by artists like Stuart Sutcliffe and Peter Blake, became cultural touchstones. The Beatles also played a pivotal role in promoting racial equality in popular culture. During a time of widespread racial prejudice, the band stood against bigotry and supported the rights of everyone to enjoy their music.\n\nThe Beatles' global impact was felt across many countries, with the band members themselves becoming international celebrities. Their legendary concerts, including the historic performances at the Cavern Club in Liverpool and Shea Stadium in New York, attracted frenzied fans and cemented their status as icons. The Beatles' influence on the fashion and cultural revolutions of the 1960s was also significant, with their stylish outfits and iconic hairstyles setting trends that defined a generation.\n\nIn the late 1960s, the band members began to pursue solo projects, and the Beatles eventually parted ways in 1970. Despite the band's dissolution, their music continues to captivate new generations of fans. Their catalog of music remains a testament to their extraordinary talent, and their legacy continues to be celebrated in numerous ways. Beatles tribute bands, documentaries, and projects such as the Cirque du Soleil show \"Love\" keep the spirit of the band alive.\n\nThe Beatles' induction into the Rock and Roll Hall of Fame in 1988, along with numerous Grammy Awards and a prestigious Brit Award, stands as a testament to their enduring influence on popular music. Their songs are evergreen, regularly topping playlists across the world, and their legacy as one of the most iconic bands in history remains unwavering. \n\nDecades after their formation, The Beatles are still beloved, proving that their music and impact are truly timeless. Their extraordinary journey from the clubs of Liverpool to international stardom remains a fascinating tale, and their contribution to the fabric of music and culture will forever be cherished."
      }
    ]
  },
  "result_two": {
    "result_two": "In the bustling city of Liverpool, a young man named John Lennon hummed a melody as he strolled down the lively streets. It was a crisp autumn afternoon, and the city seemed to buzz with an invisible energy that matched the rhythm in his head. John's eyes sparkled with a hint of mischief as he entered the lively Cavern Club, a place that had become a second home to him and his friends.\n\nInside the club, the air was thick with smoke and the thrilling sounds of rhythm and blues. John made his way downstairs, the familiar aroma of sweat and beer filling his nostrils. As he sat down at the piano, his eyes scanned the crowd, searching for familiar faces. The place was packed, with enthusiasts hanging on to every note played on the stage. \n\nSuddenly, John's gaze landed on a tall young man with a lean build and a bright smile. The fellow, named Paul McCartney, stood listening intently to the music with an enthusiasm that matched John's own passion. John nodded in his direction, and Paul's eyes widened in recognition. A subtle grin spread across his face, and he made his way toward the stage.\n\nJohn introduced Paul to George Harrison, who was sitting nearby, lost in his own musical thoughts. The three struck up a conversation, their eyes sparkling with a shared love of music. Before long, they were joined by a shy yet talented drummer named Ringo Starr. The club seemed to become more vibrant as the young men discussed their dreams and a possible musical collaboration.\n\nAs the evening progressed, the four found themselves drawn to each other's company, each recognizing a kindred spirit in the others' eyes. They decided to meet again, this time at George's house, where they could jam together and explore the melodies that danced in their heads.\n\nThat meeting marked the beginning of a remarkable journey. The four musicians poured their hearts into their passion, crafting songs that spoke to the souls of young people everywhere. They named themselves \"The Beatles,\" a quirky and catchy title that seemed to embody their unique spirit.\n\nThe Beatles' sound grew and evolved, capturing the essence of a generation. Their melodies became anthems, resonating with fans across the globe. From the vibrant clubs of Liverpool to the iconic arenas of London, The Beatles captivated audiences with their mesmerizing performances and unforgettable songs.\n\nTheir rise to fame was astronomical, with hordes of dedicated fans screaming their names and singing along to their music. The world witnessed the birth of a phenomenon, as The Beatles' influence extended far beyond the realm of music. They became a symbol of hope and peace, their messages of unity resonating deeply with a generation seeking change.\n\nAs the years passed, the Beatles continued to leave an indelible mark on the world. Their legacy became a testament to the power of music, inspiring future generations of artists and fans alike. The four friends from Liverpool had no idea that their chance meeting would change the course of music history, but change it they did, forever etching their names in the annals of pop culture. \n\nAnd so, the tale of The Beatles grew, a story of friendship, talent, and timeless music that continues to inspire and delight audiences around the world. Their journey remains a reminder that magical things can happen when fate brings friends together."
  }
}

Check

$ curl -s -H "Content-type: application/json" -X POST -d '{"prompt_one": "Write a 500 word blog post on The Beatles"}' https://fxj3q2iox6.execute-api.us-east-1.amazonaws.com/dev | jq .
{
  "prompt_one": "Write a 500 word blog post on The Beatles",
  "result_one": {
    "result_one": "### The Timeless Legacy of The Beatles\n\nFew bands in the history of music have left an indelible mark as profound as **The Beatles**. Emerging from the lively music scene of Liverpool, England, in the early 1960s, John Lennon, Paul McCartney, George Harrison, and Ringo Starr revolutionized rock and roll, shaping the sound and culture of generations to come. Their influence extends far beyond music, touching fashion, social norms, and artistic expression worldwide.\n\n#### The Early Days and Rise to Fame\n\nThe Beatles’ journey began in the gritty port city of Liverpool, where the members grew up immersed in a rich tapestry of musical influences, from skiffle and rock and roll to classical and Indian music. The band’s early days were marked by relentless performances at local clubs, most famously at The Cavern Club, where they honed their craft and developed a loyal following. Their big break came in 1961 when they were invited to play in Hamburg, Germany, where they gained international exposure and further refined their performance skills.\n\nBy 1962, The Beatles were signed by Brian Epstein, a savvy manager who helped shape their image and secured them a recording contract with EMI’s Parlophone label. Their first single, “Love Me Do,” released later that year, climbed the UK charts, signaling the start of a meteoric rise. Soon after, their energetic performances and catchy melodies earned them a spot on the newly emerging pop culture phenomenon: television. The Beatles’ appearance on the Ed Sullivan Show in 1964 was watched by an estimated 73 million viewers — the largest television audience up to that point — cementing their status as global superstars.\n\n#### Musical Evolution and Innovation\n\nWhat set The Beatles apart from their contemporaries was their relentless desire to innovate. Rather than resting on their success, the band continuously pushed musical boundaries. From the upbeat, guitar-driven sound of their early hits like “I Saw Her Standing There” and “She Loves You,” they soon began incorporating elements of classical music, folk, Indian instrumentation, and even experimental studio techniques.\n\nAlbums like *Rubber Soul* (1965) and *Revolver* (1966) marked a clear departure from traditional pop structures. Songs such as “Norwegian Wood” introduced sitars, while “Eleanor Rigby” showcased intricate orchestration. Their 1967 magnum opus, *Sgt. Pepper’s Lonely Hearts Club Band*, is often hailed as one of the greatest albums of all time. With its sophisticated production, conceptual unity, and genre-defying tracks like “Lucy in the Sky with Diamonds” and “A Day in the Life,” the album redefined what a pop record could be.\n\nThe Beatles’ later work, including *The White Album* and *Abbey Road*, demonstrated their growing individual ambitions and musical diversity. Though tensions began to surface as the members pursued personal interests, their collaborative spirit never fully waned. Even their breakup in 1970 did not diminish their collective legacy.\n\n#### Cultural Impact and Enduring Influence\n\nBeyond their music, The Beatles were cultural pioneers. Their fashion — from mop-top haircuts to Sgt. Pepper’s psychedelic uniforms — influenced youth culture worldwide. Their outspoken views on peace, civil rights, and spirituality resonated during a turbulent era of social change. Songs like “All You Need Is Love” became anthems of the 1960s counterculture movement, broadcast to millions during the first-ever global satellite link-up, *Our World*.\n\nEven decades after their breakup, The Beatles’ music continues to inspire artists across genres — from rock and pop to hip-hop and electronic music. Their innovative studio techniques laid the groundwork for modern music production, and their songwriting remains a benchmark for melody, lyricism, and emotional depth.\n\nIn essence, The Beatles were more than just a band; they were a cultural force that redefined music, art, and society. Their legacy endures not only in the timeless quality of their songs but also in the spirit of creativity, innovation, and unity that they embodied."
  },
  "conversation": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "Write a 500 word blog post on The Beatles"
          }
        ]
      },
      {
        "role": "assistant",
        "content": [
          {
            "text": "### The Timeless Legacy of The Beatles\n\nFew bands in the history of music have left an indelible mark as profound as **The Beatles**. Emerging from the lively music scene of Liverpool, England, in the early 1960s, John Lennon, Paul McCartney, George Harrison, and Ringo Starr revolutionized rock and roll, shaping the sound and culture of generations to come. Their influence extends far beyond music, touching fashion, social norms, and artistic expression worldwide.\n\n#### The Early Days and Rise to Fame\n\nThe Beatles’ journey began in the gritty port city of Liverpool, where the members grew up immersed in a rich tapestry of musical influences, from skiffle and rock and roll to classical and Indian music. The band’s early days were marked by relentless performances at local clubs, most famously at The Cavern Club, where they honed their craft and developed a loyal following. Their big break came in 1961 when they were invited to play in Hamburg, Germany, where they gained international exposure and further refined their performance skills.\n\nBy 1962, The Beatles were signed by Brian Epstein, a savvy manager who helped shape their image and secured them a recording contract with EMI’s Parlophone label. Their first single, “Love Me Do,” released later that year, climbed the UK charts, signaling the start of a meteoric rise. Soon after, their energetic performances and catchy melodies earned them a spot on the newly emerging pop culture phenomenon: television. The Beatles’ appearance on the Ed Sullivan Show in 1964 was watched by an estimated 73 million viewers — the largest television audience up to that point — cementing their status as global superstars.\n\n#### Musical Evolution and Innovation\n\nWhat set The Beatles apart from their contemporaries was their relentless desire to innovate. Rather than resting on their success, the band continuously pushed musical boundaries. From the upbeat, guitar-driven sound of their early hits like “I Saw Her Standing There” and “She Loves You,” they soon began incorporating elements of classical music, folk, Indian instrumentation, and even experimental studio techniques.\n\nAlbums like *Rubber Soul* (1965) and *Revolver* (1966) marked a clear departure from traditional pop structures. Songs such as “Norwegian Wood” introduced sitars, while “Eleanor Rigby” showcased intricate orchestration. Their 1967 magnum opus, *Sgt. Pepper’s Lonely Hearts Club Band*, is often hailed as one of the greatest albums of all time. With its sophisticated production, conceptual unity, and genre-defying tracks like “Lucy in the Sky with Diamonds” and “A Day in the Life,” the album redefined what a pop record could be.\n\nThe Beatles’ later work, including *The White Album* and *Abbey Road*, demonstrated their growing individual ambitions and musical diversity. Though tensions began to surface as the members pursued personal interests, their collaborative spirit never fully waned. Even their breakup in 1970 did not diminish their collective legacy.\n\n#### Cultural Impact and Enduring Influence\n\nBeyond their music, The Beatles were cultural pioneers. Their fashion — from mop-top haircuts to Sgt. Pepper’s psychedelic uniforms — influenced youth culture worldwide. Their outspoken views on peace, civil rights, and spirituality resonated during a turbulent era of social change. Songs like “All You Need Is Love” became anthems of the 1960s counterculture movement, broadcast to millions during the first-ever global satellite link-up, *Our World*.\n\nEven decades after their breakup, The Beatles’ music continues to inspire artists across genres — from rock and pop to hip-hop and electronic music. Their innovative studio techniques laid the groundwork for modern music production, and their songwriting remains a benchmark for melody, lyricism, and emotional depth.\n\nIn essence, The Beatles were more than just a band; they were a cultural force that redefined music, art, and society. Their legacy endures not only in the timeless quality of their songs but also in the spirit of creativity, innovation, and unity that they embodied."
          }
        ]
      },
      {
        "role": "user",
        "content": [
          {
            "text": "Now write a short story based on the above."
          }
        ]
      }
    ]
  },
  "result_two": {
    "result_two": "### The Time Traveler’s Ticket\n\nIn the quiet town of Liverpool, hidden beneath an old record shop named “Mersey Beats,” was a mysterious door that only opened on full moons. No one knew what lay behind it—until Ella, a passionate music historian with a penchant for the unusual, stumbled upon it one rainy evening.\n\nElla had spent years studying The Beatles, fascinated by their rapid rise to fame and their groundbreaking music. She owned every album, read every biography, and even learned to play “Hey Jude” on the guitar. But something always felt missing, as if she were just a step away from understanding the magic that transformed four lads from Liverpool into global icons.\n\nThat night, drawn by an inexplicable urge, Ella pushed against the old wooden door. It creaked open, revealing a small, dimly lit room filled with vintage instruments, faded posters, and a single, glowing ticket stub labeled “Abbey Road Studio – 1966.”\n\nHer heart raced. Was this a trick? A dream? Before she could second-guess herself, the room shimmered, and she felt a strange pull—like being caught in a whirlwind. In an instant, she was no longer in the record shop but standing in front of a familiar, grand building with a sign that read “Abbey Road Studios.”\n\nConfused but exhilarated, Ella peered through the glass doors and saw… The Beatles.\n\nThere they were—John, Paul, George, and Ringo—moving about the studio with a sense of focused energy. She watched as they rehearsed a new song, their laughter and playful banter filling the air. John strummed a guitar while Paul tapped a rhythm on a piano. George experimented with a sitar, and Ringo tapped his feet, clearly enjoying the moment.\n\nElla couldn’t believe her luck. She had read about this era—*Revolver* was being recorded, and the band was pushing musical boundaries like never before. She had always wondered what it would be like to witness their creativity firsthand.\n\nAs she watched, John noticed her. Startled, he whispered to Paul, who smiled and nodded. To Ella’s amazement, they motioned for her to come in. She hesitated, feeling like an intruder, but something compelled her to step forward.\n\n“Hi,” John said with a grin. “You look like you might know a chord or two.”\n\nElla, stunned into coherence, managed to stammer, “I—I’m a huge fan. I’ve studied your music for years.”\n\nPaul’s eyes lit up. “Really? That’s brilliant! We’re always looking for fresh ideas.”\n\nFor the next few hours, Ella found herself immersed in the creative energy of the band. They played snippets of new songs, asked for her opinions, and even let her try a few chords on an old piano. At one point, George handed her an instrument she had never seen before—a small, exotic-sounding box.\n\n“What is this?” she asked.\n\n“It’s a sitar,” George explained. “We’re trying to bring in more Eastern sounds. What do you think?”\n\nElla tentatively strummed a few notes. The sound was unlike anything she had heard—a blend of richness and melody that made the band smile with approval.\n\n“You’ve got a natural touch,” Paul said. “We should record that.”\n\nAs the evening wore on, Ella felt as though she had stepped into a dream. The Beatles treated her not like a stranger, but like a long-lost collaborator. They shared stories, laughed, and even played a few impromptu tunes. Ella sang along to “Yesterday,” her voice surprisingly steady, earning claps and encouragement from the band.\n\nBut as the night deepened, a sense of sadness crept in. This couldn’t last forever. She was a time traveler—whether by magic or coincidence, she didn’t know—but she knew she couldn’t stay.\n\nBefore she could say goodbye, the room around her began to shimmer once more. The Beatles looked at her with knowing eyes, as if they understood what was happening.\n\n“Thank you,” Ella whispered, tears welling up. “This was the most incredible night of my life.”\n\nJohn smiled. “Music brings everyone together. Keep listening, keep learning—and keep sharing.”\n\nWith that, the world around her dissolved into light. In an instant, she was back in the record shop, the door now closed and lifeless. But in her pocket, she felt the warm, folded ticket stub—still glowing faintly.\n\nElla stepped out into the moonlit street, her mind buzzing with memories of the night she had spent with The Beatles. She knew she would carry this experience with her forever, not just as a fan, but as someone who had touched the very essence of creativity, innovation, and unity that defined the band’s timeless legacy."
  }
}

Thank you😀


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

"role": "CHATBOT",
"message.$": "$.result_one.result_one"
}
]
Copy link
Copy Markdown
Contributor Author

@kakakakakku kakakakakku Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I used chat_history format instead of ChatML format like Human: and Assistant:.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request and response schema of Amazon Nova 2 is here.
https://docs.aws.amazon.com/nova/latest/nova2-userguide/request-response-schema.html

"ResultPath": "$.result_one",
"ResultSelector": {
"result_one.$": "$.Body.generations[0].text"
"result_one.$": "$.Body.text"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@biswanathmukherjee
Copy link
Copy Markdown
Contributor

This is a REST API. So please change it to REST API wherever it is mentioned as HTTP API.

@biswanathmukherjee
Copy link
Copy Markdown
Contributor

The test execution failed in the Step Function with error: "Access denied. This Model is marked by provider as Legacy "

Copy link
Copy Markdown
Contributor

@biswanathmukherjee biswanathmukherjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the suggested changes.

- "logs:DescribeResourcePolicies"
- "logs:DescribeLogGroups"
Resource: "*"
Resource: "*"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be made more restrictive than "*"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

CreateLogStream and PutLogEvents support resource-level permissions, so they could be scoped to a specific log group. However, the remaining actions do not support resource-level permissions and require Resource: "*".
https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazoncloudwatchlogs.html

We could split these into separate statements, but the Step Functions logging documentation uses the same pattern with a single Resource: "*" for all CloudWatch Logs actions. I'd prefer to keep it consistent with the official example.
https://docs.aws.amazon.com/step-functions/latest/dg/cw-logs.html

@@ -95,4 +94,4 @@ After runnning the above command, API Gateway will invoke the State machine and
----
Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2024 --> 2026

"Resource": "arn:aws:states:::bedrock:invokeModel",
"Parameters": {
"ModelId": "cohere.command-text-v14",
"ModelId": "cohere.command-r-v1:0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update the readme file with this model id

@kakakakakku kakakakakku force-pushed the apigw-rest-stepfunctions-express-sync-bedrock-sam branch from 8924bd1 to 514cb2e Compare March 21, 2026 06:28
@kakakakakku
Copy link
Copy Markdown
Contributor Author

@biswanathmukherjee

The test execution failed in the Step Function with error: "Access denied. This Model is marked by provider as Legacy "

When I fixed this pattern and submitted the pull request in November 2025, Cohere Command R was still working. However, it appears that Command R and Command R+ are now marked as Legacy on Amazon Bedrock.

In my account (us-east-1), the only remaining active Cohere models are Embed and Rerank. There are no active Cohere text generation models available (see screenshot below).

image

This means this pattern is currently unusable for new deployments. Could you advise on the direction as a maintainer. Should we retire this pattern, or update it to use a non-Cohere model?

Personally, I believe this pattern is still valuable regardless of the model provider. It should work the same way with other models such as Claude Sonnet or Amazon Nova. Happy to help with the migration😀

Thank you!

@biswanathmukherjee
Copy link
Copy Markdown
Contributor

@biswanathmukherjee

The test execution failed in the Step Function with error: "Access denied. This Model is marked by provider as Legacy "

When I fixed this pattern and submitted the pull request in November 2025, Cohere Command R was still working. However, it appears that Command R and Command R+ are now marked as Legacy on Amazon Bedrock.

In my account (us-east-1), the only remaining active Cohere models are Embed and Rerank. There are no active Cohere text generation models available (see screenshot below).

image This means this pattern is currently unusable for new deployments. Could you advise on the direction as a maintainer. Should we retire this pattern, or update it to use a non-Cohere model?

Personally, I believe this pattern is still valuable regardless of the model provider. It should work the same way with other models such as Claude Sonnet or Amazon Nova. Happy to help with the migration😀

Thank you!

Hi @kakakakakku,
Agree that the pattern is useful. Can you please update it with latest Nova model?

@kakakakakku kakakakakku changed the title apigw-rest-stepfunctions-express-sync-bedrock-sam: Update ModelId to Cohere Command R apigw-rest-stepfunctions-express-sync-bedrock-sam: Migrate from Cohere Command R to Amazon Nova 2 Lite Mar 23, 2026
"role": "CHATBOT",
"message.$": "$.result_one.result_one"
}
]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request and response schema of Amazon Nova 2 is here.
https://docs.aws.amazon.com/nova/latest/nova2-userguide/request-response-schema.html

* [Git Installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [AWS Serverless Application Model](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) (AWS SAM) installed
* [NOTE! Manage Access to Amazon Bedrock Foundation Models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html) at the time of writing, this example uses Amazon Bedrock foundation model cohere.command-text-v14
* This example uses Amazon Bedrock foundation model amazon.nova-2-lite-v1:0
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kakakakakku
Copy link
Copy Markdown
Contributor Author

@biswanathmukherjee
Done👍 I've migrated the pattern from Cohere Command R to Amazon Nova 2 Lite.
Could you take a look?

Agree that the pattern is useful. Can you please update it with latest Nova model?

Thank you so much!

@biswanathmukherjee
Copy link
Copy Markdown
Contributor

Thanks @kakakakakku for your contribution. The pattern is approved from my side. DA will review and merge it soon!

@kakakakakku
Copy link
Copy Markdown
Contributor Author

Thanks!

@julianwood julianwood merged commit a4314e6 into aws-samples:main Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants