Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bedrock): inference profiles permissions #994

Merged
merged 3 commits into from
Feb 27, 2025

Conversation

aws-rafams
Copy link
Contributor

Fixes #991 (build run pending)

Usage (TS):

const modelId = 'anthropic.claude-3-7-sonnet-20250219-v1:0';
const model = BedrockFoundationModel.fromCdkFoundationModelId(
    { modelId: modelId },
    {
      supportsAgents: true,
      supportsCrossRegion: true,
    }
  );

  const inferenceProfile = CrossRegionInferenceProfile.fromConfig({
    geoRegion: CrossRegionInferenceProfileRegion.US,
    model: model,
  });

  new Agent(this, 'Agent', {
    name: 'test-agent-claude37',
    instruction: "You're a nice agent saying Konnichiwa in Hiragana at the start of every interaction",
    description: 'Agent description.',
    foundationModel: inferenceProfile,
    shouldPrepareAgent: true,
  });

The new policy:

Screenshot 2025-02-27 at 11 19 15

No invocation errors:

Screenshot 2025-02-27 at 11 18 49

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

Copy link
Collaborator

@krokoko krokoko left a comment

Choose a reason for hiding this comment

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

LGTM, fixed the build should be green soon

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.91%. Comparing base (c813d89) to head (1f69bdb).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ference-profiles/cross-region-inference-profile.ts 0.00% 1 Missing ⚠️
src/cdk-lib/bedrock/models.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #994   +/-   ##
=======================================
  Coverage   93.91%   93.91%           
=======================================
  Files          62       62           
  Lines       18018    18023    +5     
  Branches      570      570           
=======================================
+ Hits        16921    16926    +5     
  Misses       1097     1097           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

mergify bot commented Feb 27, 2025

This pull request has been removed from the queue for the following reason: pull request dequeued.

Pull request #994 has been dequeued. The pull request could not be merged. This could be related to an activated branch protection or ruleset rule that prevents us from merging. (details: You're not authorized to push to this branch. Visit https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches for more information.)

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

@krokoko krokoko merged commit e32fa20 into main Feb 27, 2025
18 of 21 checks passed
@krokoko krokoko deleted the 991-bedrock-enabling-claude-sonnet-37-bug-w-permissions branch February 27, 2025 21:48
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.

bedrock: Enabling Claude Sonnet 3.7; bug w/ permissions
4 participants