Amazon Bedrock API provider

From MoodleDocs


New feature
in Moodle 5.2!

The Moodle integration with Amazon Bedrock provides access to AI actions such as generate text, summarise text and explain text.

Amazon Bedrock gives Moodle access to a range of foundation models from providers including Anthropic (Claude), Amazon (Titan and Nova), and Meta (Llama). Data stays within your organisation's configured AWS region, supporting data sovereignty and compliance requirements.

Requirements

You need:

  • An active AWS account with access to Amazon Bedrock
  • Amazon Bedrock enabled in your chosen AWS region (see Getting started with Amazon Bedrock)
  • An IAM user with the appropriate Bedrock permissions, and the corresponding Amazon API key credential and Amazon API secret credential

Amazon Bedrock provider instance set-up

To create a provider instance:

  1. Go to Site administration > General > AI providers.
  2. Click 'Create a new provider instance' and select 'Amazon Bedrock provider'.
  3. Enter a name, your Amazon API key credential and Amazon API secret credential.
  4. If required, set a site-wide rate limit and/or a user rate limit.
  5. Click 'Create instance'.
Creating an Amazon Bedrock provider instance, showing the Amazon API key credential and Amazon API secret credential fields.

To configure the Amazon Bedrock provider instance:

  1. Go to Site administration > General > AI providers.
  2. Click the settings link for the Amazon Bedrock provider instance.
  3. Enable/disable actions as required.

For each action, you can select the AI model, AWS region, and customise the model's behaviour via the settings link.

Generate text action settings for Amazon Bedrock, showing AI model, region, and parameter fields.

To enable the Amazon Bedrock provider instance:

  1. Go to Site administration > General > AI providers.
  2. Click the toggle to enable the instance.

Important considerations

  • Data residency: All requests are processed within the AWS region selected for each action. This makes Amazon Bedrock well suited for institutions with strict data sovereignty or compliance requirements.
  • Model access: You must request access to individual foundation models in the AWS Bedrock console before they can be used. Access is granted per region.
  • Costs: Amazon Bedrock is billed on a pay-per-use basis. Review the Amazon Bedrock pricing page for the latest rates.
  • IAM permissions: The IAM user must have the appropriate Amazon Bedrock permissions. Follow the principle of least privilege and restrict access to only the models and regions required.