Mattermost Agents with Amazon Bedrock

Mattermost Agents can call Amazon Bedrock from a self-hosted server on EC2 without stored access keys when the instance profile and model access are set up in order. This page covers the supported configuration path, the IAM and model ID decisions, and where teams usually lose time.

On this page

How Mattermost Agents reaches Amazon Bedrock without stored keys

The platform team runs self-hosted Mattermost on EC2 and wants Mattermost Agents to call Amazon Bedrock models without placing long-lived access keys in the server configuration. The approach that fits this goal is to attach an IAM role to the EC2 instance profile and let the Agents Bedrock provider obtain temporary credentials from the instance metadata service through the AWS SDK credential chain. The server configuration then names a region and a model, and no static access key ID or secret is written to the Mattermost config file, environment or database. The key decision is whether the instance role is the only credential source the server will ever use, because an access key left in the environment would take precedence over the role and quietly reintroduce the stored secret you were trying to remove.

Before writing any configuration, the team should confirm three things in the current Mattermost Agents documentation: which Bedrock-related fields the provider exposes, how it resolves credentials when none are set explicitly, and whether it expects a region field separate from the model identifier. Field names, supported options and default behavior change between plugin releases, so this page does not list them. The AWS Bedrock documentation then determines what the role must allow, including the Bedrock runtime actions for the models you choose and the scope of the resource ARNs. Check both sources against the Mattermost server version you actually run, since the Agents plugin is preinstalled and its settings are tied to that release line. Record the chosen values in your change ticket so the reviewer can compare them with the running configuration.

Plan for the operational side of role-based access as well. Instance roles rotate automatically, but a role that is too broad lets any process on the host call any permitted model, so scope the policy to the specific model and region pairs your bots use. Confirm with your security team how the instance metadata service is restricted, because a container or plugin process that can reach it inherits the same permissions. Finally, test from the server itself with the model you plan to enable, then verify that the Agents settings page reports a working connection before users depend on it.

What you need in place before the Bedrock connection works

Six items have to be in place before Mattermost Agents can reach Amazon Bedrock from EC2. Each one is a separate owner and a separate failure point, so confirm them in order before you change any Agents settings.

Mattermost server version and plan

Confirm that your Mattermost server version and plan include the Agents plugin and the Bedrock provider, and that the license requirement for this setup is met. The plugin ships preinstalled, but the features you need depend on the plan you hold. Check the current release and support dates on the server releases page for the version you intend to run, and confirm plan entitlements with Mattermost before you design around them.

Server releases page

EC2 instance and instance profile

Run the Mattermost server on an EC2 instance that has an instance profile attached, so the application obtains temporary credentials from the instance metadata service instead of stored access keys. The role behind the profile should allow only the Bedrock invocation actions your bots need. Confirm the instance metadata settings with your AWS team, since the profile only works if the server can reach that metadata endpoint.

AWS account with Bedrock enabled

Bedrock must be enabled in the AWS account and in the region you choose, and the region should match where the instance runs and where your data may be processed. Model availability differs by region, so confirm which models are offered where you deploy. Check service quotas for the models and inference profiles you plan to use before rollout, because a quota shortfall shows up as failed requests rather than a clear setup error.

PostgreSQL and a supported server

Mattermost runs as a single Linux binary with PostgreSQL as its database, and the Agents plugin depends on that database being in a supported state. Confirm the PostgreSQL version and extensions against the server deployment planning guide for your release before you enable the plugin. An unsupported database version is a common reason the plugin fails to start cleanly, so verify it first.

Deployment planning guide

Outbound access to the regional Bedrock endpoint

The instance must reach the Bedrock runtime endpoint for your region over HTTPS. If your network uses an egress proxy, firewall allowlist or VPC endpoint, the Mattermost hostname allowlist and outbound proxy settings must match it. Test connectivity from the instance itself, not from your workstation, because security group and route table rules apply to the server only.

Owner for model access requests

Name one person who owns model access requests in the AWS account, including any one-time use case form that the model provider requires before access is granted. Approval can take time and is outside Mattermost's control, so start it before the deployment date. This owner should also track which bots use which model IDs and inference profiles, so that a later change does not break a working bot.

How a user request travels from Mattermost to Bedrock

The request starts when a user posts in a Mattermost channel and the Agents plugin on the EC2 instance picks it up. When the plugin needs a model, the Mattermost server asks the instance metadata service for temporary credentials tied to the instance's IAM role, then sends a signed HTTPS call to the regional Bedrock runtime endpoint. The model response returns to the server and is posted back to the channel. Check that the plugin configuration holds no static keys and that the instance role is the only credential source.

The only outbound path to Bedrock uses temporary role credentials.

Configuring the Bedrock connection in the right order

This sequence connects Mattermost Agents to Amazon Bedrock from an EC2 host using an instance profile, so no long-lived access keys are stored in the server. Each step ends with a check, so a failure is caught before the next change is made.

  1. Confirm the Mattermost version and Agents plugin state

    The platform administrator confirms the Mattermost server version and the license tier that covers the Agents plugin, then checks in the System Console that the preinstalled Agents plugin is present and enabled. Confirm the exact menu path and the plan requirement for AI features in the Mattermost documentation for your version before changing anything, because the plugin settings differ between releases. The step is done when the plugin appears as enabled and the server version matches the one you plan to run in production.

  2. Create the IAM role and attach it to the instance

    The cloud administrator creates an IAM role that grants Bedrock invoke permissions only for the models your approved use case needs, and attaches that role to the EC2 instance through an instance profile. Scope the policy to specific model or inference profile resource ARNs rather than all of Bedrock, and confirm the exact action names in the current AWS documentation. The step is done when the instance can call the AWS identity API and reports the expected role ARN, without any access key file present on the host.

  3. Request model access in the Bedrock console

    An account administrator opens the Amazon Bedrock console in the chosen region and requests access to each model the agents will use. For Anthropic models, complete the use case form that Bedrock presents, and confirm with AWS whether approval is immediate or pending for your account. Access is granted per model and per account, so repeat this for every model you plan to configure. The step is done when each model shows an access status that allows invocation in that region.

  4. Set the region and model identifiers in the LLM service

    The Mattermost administrator opens the Agents LLM service settings, selects the Bedrock option, and enters the AWS region along with the model ID or cross-region inference profile ID. Use the exact identifier shown in the Bedrock console for your region, since a base model ID and an inference profile ID are not interchangeable in every configuration. Leave any static credential fields empty so the instance profile supplies the credentials. The step is done when the settings save without a validation error.

  5. Restart or reload as the documentation requires

    The administrator applies the change using the restart or plugin reload method that the Mattermost documentation for your version specifies for Agents settings. Confirm the required action with the vendor docs first, since some plugin configuration changes take effect without a server restart and others do not. The step is done when the plugin reports as running after the change, with no startup errors in the server log.

  6. Test the bot and confirm the Bedrock call in logs

    A user with access to a test channel sends a short prompt to the default Agents bot, and the administrator watches the server log for the entry that records the successful model call. A reply in the channel alone is not enough, because it can come from a cached or fallback path, so check the log line or CloudWatch metric that confirms the request reached Bedrock. Record the region, model identifier and role used, so the configuration can be reproduced and reviewed. The step is done when the test prompt returns a response and the log confirms a successful Bedrock invocation under the instance role.

Choosing between a base model ID and a cross-region inference profile ID

Use a base model ID when the Mattermost server and the Bedrock model you need are both available in the same AWS Region, and your security or compliance team needs inference to stay in that Region. The request goes from the server to one regional Bedrock endpoint, which makes the data path simpler to document and review.

  • IAM scope: The instance profile needs invoke permissions on the foundation model resource for that Region only. Confirm the exact action names and resource formats in AWS documentation before you write the policy.
  • Network egress: Traffic to Bedrock stays on the regional endpoint. If the instance has no general internet route, plan a Bedrock VPC endpoint in the same Region and confirm it is available there.
  • Model availability: Not every model is offered in every Region, so check the Region's model catalog before you commit to this path.
  • Quota exposure: Throughput quotas apply per Region, so the capacity for this path is bounded by one Region. Ask your AWS account team or check the Service Quotas console for current values.

Confirm that the model ID configured in Mattermost matches a model your account can access in that Region, and that a test call from the instance succeeds with the instance profile attached.

Mapping bots, roles, models and regions in the configuration

This table shows how each Mattermost Agents setting links to an AWS object and who should own it. Read it top to bottom to trace one request from a bot to its model, role, grant and region. Rows marked for confirmation depend on Agents plugin or Bedrock details to check in the current vendor documentation before you finalize the configuration.

Mattermost objectAWS objectWhat it controlsWho owns it
Agents LLM service entryAmazon Bedrock as the provider, using the instance roleSelects Bedrock as the backend and sets its region. Confirm the provider options in the Agents docs.Mattermost administrator
Each bot accountNone directly, linked through the service entryBinds one bot to one model and its permissions. Confirm whether per-bot settings exist in your plugin version.Mattermost administrator with an AI platform owner
Model setting per botBedrock model ID or inference profile IDSets which model answers that bot. The value must match an entry your account can invoke.AI platform owner
EC2 instance profileIAM instance profile attached to the Mattermost hostSupplies temporary credentials so no access keys are stored in Mattermost configuration.Cloud platform team
IAM role permissionsIAM role behind the instance profile, with Bedrock invoke actionsLimits which models and inference profiles the host can call. Confirm the exact actions the plugin requires.Cloud or security team
Bedrock model accessModel access grant in the Bedrock console for the accountEnables each model before invocation. This is separate from IAM permissions. Confirm the current access steps, including any Anthropic use case form.AWS account administrator
Region settingAWS region of the Bedrock endpointDetermines where inference runs and which models are offered. Confirm regional model availability.Cloud platform team with data residency sign-off
Cross-region inference profile IDBedrock cross-region inference profileRoutes requests to other regions. The ID must match the configuration, and IAM must cover the profile and its target regions. Confirm the target regions.Cloud platform team

Keeping credentials out of the Mattermost configuration

Mattermost Agents needs permission to call Bedrock, and the simplest place to put that permission is a static access key in the System Console. The cards below keep credentials out of that configuration by relying on the EC2 instance role, then limit what that role can do, who can change it, and how its use is recorded and reviewed.

Attach an instance profile instead of keys

Attach an IAM role to the EC2 instance through an instance profile, and leave the access key fields empty in the Agents settings. The Mattermost server then obtains temporary credentials from the instance metadata service. Confirm with your team that no AWS_ACCESS_KEY_ID or similar variable exists in the server environment, in config.json, or in shell history on the host. Keys stored in the database are readable by anyone with database access, so the absence of keys is the control you are checking for.

Mattermost SSO docs

Scope the IAM policy to Bedrock

Write the role's permission policy to allow only the Bedrock invocation actions and the specific model or inference profile resources your bots call. Take the exact action names and resource ARN formats from the AWS IAM and Amazon Bedrock documentation, not from memory or from third-party examples. Avoid wildcard resources across all of Bedrock, since an agent misconfiguration then becomes a broader cloud permission. Review the policy each time you add a model.

Restrict who edits Agents settings

Anyone who can change the Agents configuration in the System Console can point the bot at a different endpoint, change the model, or alter the allowlisted hosts. Limit System Console access for these settings to a named group of administrators, and confirm that regular system admins without a need for AI configuration cannot change them. Record who holds this access, since a change to the model ID or endpoint is a change to where your data is sent.

Control outbound network paths

Bedrock calls leave the EC2 instance over the network, so the security group's outbound rules and any forward proxy define the only route the server can take. Allow egress to the Bedrock regional endpoint for the Region you chose, and block other destinations that the Agents configuration does not need. If you route traffic through an outbound proxy, confirm that the proxy settings in Mattermost match the proxy's rules so requests do not fail silently or bypass inspection.

Log and review Bedrock invocations

Turn on AWS CloudTrail for the account and confirm that Bedrock API activity is captured for the Region in use. Review which role made each invocation, from which instance, and at what volume, and alert on calls from unexpected principals. Bedrock invocation logging, if you enable it, can record prompts and responses, which may contain channel content. Decide with your privacy and compliance owners whether that content should be stored, where, and for how long.

Deployment planning docs

Review role policies through change control

Treat the instance role's trust policy and permission policies as production configuration. Store them in version control or a tracked infrastructure definition, require a review before changes, and compare the deployed policy against the approved version on a regular schedule. A role that gains a new permission during an unrelated fix is one of the most common ways AI access widens without anyone deciding it should. Ask your AWS team how they detect policy drift in your account.

Where the Anthropic use case form fits in the rollout

Some Anthropic models on Amazon Bedrock require the AWS account to complete a use case form before access is granted, so this step belongs at the start of the schedule, not at the point where someone first tries to invoke a model. Assign a named owner to it before the build begins. That person should be able to answer the form's questions about the intended use of the models, and should have authority to submit it and follow up with AWS. Confirm the current form requirement, its exact wording, which Anthropic models it applies to, and the approval timeline in the AWS console and the Bedrock documentation, because these details change and the approval time is set by AWS, not by DeployOpen or Mattermost.

A delay at this step blocks every later test. The Mattermost Agents configuration, the IAM instance profile check, the model access checks and the cross-region inference profile tests all depend on the Bedrock model being callable from the EC2 instance. Until the form is approved, a test that appears to fail may simply reflect missing model access, which can send the team chasing permissions, endpoint settings or plugin configuration that are actually correct. Ask the account owner to confirm the approval status in the console before anyone opens a troubleshooting ticket.

Build the form into the project plan as an external dependency with its own status. Record the submission date, the person who submitted it, the response received and the models approved. Ask the team that owns the AWS account whether any other accounts, organizational policies or service control policies could also restrict model access, since approval in one account does not guarantee that a second environment, such as a staging account, can call the same models. Plan the rollout so that non-Anthropic model tests or infrastructure work can proceed while the form is pending.

Why Bedrock calls fail after the setup looks complete

This table maps the failures teams usually hit after Mattermost Agents is pointed at Amazon Bedrock, with the likely cause and the check that confirms each fix. Work down the symptoms in the order they appear during a test call, because an early failure such as a missing instance profile hides the later ones. Most failures in this setup trace back to region, model access, or the plan that enables the provider.

SymptomLikely causeFix and the check that confirms it
AccessDeniedException when the agent sends its first requestModel access was not granted for the selected model in the Bedrock console, or the request was sent in a region where that model is not enabledRequest or confirm access to the exact model in the region the EC2 instance calls. Confirm by sending one test invoke from the instance with the AWS CLI before retrying from Mattermost.
ValidationException or model not found, even though the model appears in the consoleThe model ID or cross-region inference profile ID does not match the region in the endpoint configuration, or a bare model ID was used where a profile ID is requiredCopy the inference profile ID for the target region exactly as listed in Bedrock and set it in the Agents provider settings. Confirm with a list call for inference profiles in that region.
Connection timeout or DNS failure to the Bedrock runtime endpointThe instance subnet has no route to the regional Bedrock endpoint, a security group or network ACL blocks outbound HTTPS, or a proxy is missing from the outbound settingsTest HTTPS from the instance to the regional runtime hostname, then check route tables, egress rules and proxy variables. Confirm the hostname resolves and returns a response before changing Mattermost settings.
AccessDenied or no credentials found, despite the Mattermost configuration looking correctThe IAM instance profile is not attached to the EC2 instance, or the Mattermost service started before the profile was attached and is still reading old credentialsCheck the instance metadata for an attached role, then restart the Mattermost service. Confirm with the caller identity command on the instance, which should show the expected role.
AccessDenied on invoke, while the role exists and is attachedThe role lacks bedrock:InvokeModel or the streaming permission for the model or inference profile resource, or the policy names a different region or model ARNCompare the role policy with the exact model and profile ARNs used in the request. Confirm with the IAM policy simulator for the invoke actions against the same resource ARNs.
ThrottlingException or a quota error during busy periodsThe account has a per-model or per-region request quota that is lower than peak agent traffic, or several bots share one quotaReview the Bedrock service quotas for the model in that region, then request an increase or spread bots across approved profiles. Confirm with the CloudWatch metrics for throttled invocations over a test window.
Agents option for Bedrock is missing or the provider cannot be selectedThe Mattermost license or plan does not include the Agents capability for this provider, or the plugin version predates Bedrock supportCheck the plan on the license page and confirm the plugin version in the System Console. Ask Mattermost sales to confirm which provider options the license includes before rebuilding the environment.
Responses succeed in a test call but fail for some botsBots are configured with different model IDs or profile IDs, and one of them points at a model or region without accessReview each bot's provider settings against the access list for that region. Confirm by running one test prompt per bot and recording which profile ID each one used.

What buyers ask before running Agents on Bedrock

What drives the cost of running Mattermost Agents on Amazon Bedrock?

The cost comes from four places: internal hours spent on the AWS account, IAM roles, networking and model access; the Mattermost license; and Bedrock usage charges. Your team or a partner is paid for the setup work, while Mattermost and AWS bill separately for their parts. Setup is one-time, but model usage, license renewals and any ongoing support recur. Costs rise with the number of AI-enabled channels, the models you enable, the network design you need (for example, private connectivity from EC2), and how many reviews your security team requires. Ask any quote to list each item separately, with the vendor that bills it, and state which parts are one-time and which recur.

How long does a Bedrock setup for Mattermost Agents take?

The duration depends on how much of the environment already exists and how many approvals stand between you and a working bot. The main variables are whether the AWS account and VPC are ready, whether model access is already granted in the target region, how long your security review takes, and whether the Mattermost server is already running with the Agents plugin enabled. Model access requests and the Anthropic use case form are controlled by AWS and Anthropic, so their processing time is outside the build schedule. Ask for a written timeline that separates your approval steps from the build steps and names the dependencies that could delay each one.

Can our platform team set up Agents on Bedrock without a partner?

Yes, a platform team with AWS and Mattermost administration experience can do this in-house, and the steps are documented by both vendors. The work is mostly configuration: an IAM role attached to the EC2 instance profile, Bedrock model access, the correct cross-region inference profile IDs, and the Agents plugin settings. The harder parts are usually the network path, the Mattermost license check, and the evidence your security reviewers will ask for. A partner adds value when your team lacks Bedrock or IAM experience, has no time in the next release cycle, or needs an independent review of the permissions before launch. Compare the internal hours against a fixed-scope quote before deciding.

What do we need from our AWS, Mattermost and security teams?

Each group provides a different input, and the project stalls if any one is missing:

  • The AWS account owner provides the target account and region, confirms Bedrock model access, and approves the IAM role and network changes.
  • The Mattermost admin provides access to the System Console, the server version and plan, and a maintenance window for the plugin settings.
  • The security reviewer approves the permission scope, the data handling for prompts and responses, and the logging you want kept for audit.

Ask DeployOpen or any other provider to name these owners in the written scope, along with the decision each one must make and the date by which it must be made.

Is a key-based setup ever needed for Bedrock access?

A key-based setup is sometimes needed, for example when the Mattermost server runs outside AWS, when it sits in a data center without an instance profile, or when a temporary test runs on a host you cannot attach a role to. Static access keys are easier to start with but must be stored, rotated and revoked by your team, and a leaked key grants access until someone disables it. An instance profile on EC2 supplies short-lived credentials automatically and removes the key from configuration files. Where a key is unavoidable, scope it to the minimum Bedrock actions, keep it in a secrets manager, and document the rotation schedule in the approval record.

How do we request a fixed-scope quote for this work?

Send the provider a written description of the target environment and the outcome you need, then ask for a quote that lists the work as separate deliverables. Include the AWS account and region, whether the Mattermost server is self-hosted on EC2, the number of bots or channels in scope, your model choices, your network requirements, and the review steps your organization requires. Ask the provider to state what is excluded, such as Mattermost and AWS license or usage charges, Anthropic use case approval, and ongoing model spend. Request acceptance criteria for each deliverable and the terms for changes to scope.

How DeployOpen scopes and delivers this integration

DeployOpen approaches Mattermost Agents with Amazon Bedrock as a fixed-scope implementation inside your own AWS accounts. We agree the scope, deliverables and timeline in writing before work starts, then build and document the setup so your security and platform teams can review it.

How we scope

  • Confirm the AWS accounts, regions and EC2 hosts that will run the Mattermost server and the Agents plugin
  • Map which Bedrock models your organization has access to and who must submit the Anthropic use case form
  • Agree the IAM instance profile design, the cross-region inference profile IDs and the Mattermost license tier in writing

How we build

  • Configure the EC2 instance profile so the Agents plugin reaches Bedrock without long-lived access keys
  • Set the Bedrock region, model and inference profile settings for each agent bot and test each one end to end
  • Test prompt handling, bot permissions, network egress and logging, and document the results with fixes and retests

How we hand over

  • Deliver a written runbook covering IAM policies, model access steps, region settings and how to rotate or review permissions
  • Walk your engineers through the configuration so they can explain each control to auditors and security reviewers
  • Provide the evidence your compliance team needs for review, without issuing audit reports or certifications

How we support

  • Offer ongoing support, upgrades and continuous testing for the Bedrock integration as a retainer
  • Retest the setup after Mattermost server upgrades, plugin updates or changes to Bedrock model availability
  • Keep configuration and documentation current so your team can operate the integration without us

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.