Use Amazon Bedrock with Pulumi Agents
Run Pulumi Agents against models in your AWS account. Your account needs access to the models or inference profiles you want to use in the selected region. Pulumi assumes an IAM role using workload identity, so you can connect Bedrock without storing an AWS access key.
Connect Amazon Bedrock
Organizations on the legacy Business Critical edition also have access to this feature. To connect the provider, you need permission to manage your organization's integrations, such as the Admin role.
- In Pulumi Cloud, open your organization's Agent Settings.
- Select Model provider, then Add model provider.
- Enter a unique Name using lowercase letters, numbers, and hyphens. Choose a name you can recognize when configuring an agent. The name is permanent, and Pulumi reserves
pulumi. - Under Provider, select Amazon Bedrock.
Copy the Issuer, Subject, and Audience shown in the Pulumi form. The subject identifies your organization as pulumi:agents:pulumi.organization.id:<organization-id>, and the audience is aws:agents:<organization-id>. Use the values from your form in the trust policy below.
Create the IAM role
In the IAM console, add an OpenID Connect identity provider. Use the Issuer as the provider URL and the Audience as the audience.
Create an IAM role for that identity provider with a trust policy that requires the Audience and the Subject:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Federated": "arn:aws:iam::<account-id>:oidc-provider/api.pulumi.com/oidc" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "api.pulumi.com/oidc:aud": "aws:agents:<organization-id>", "api.pulumi.com/oidc:sub": "pulumi:agents:pulumi.organization.id:<organization-id>" } } } ] }Give the role permission to invoke the models you use. Include
project/defaultif this role serves OpenAI Responses requests. If the role serves only Anthropic Messages or OpenAI Chat Completions, you can omit that resource.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream" ], "Resource": [ "arn:aws:bedrock:*::foundation-model/*", "arn:aws:bedrock:*:*:inference-profile/*", "arn:aws:bedrock:*:*:project/default" ] } ] }Narrow the resources to the models and regions your agents use.
Choose the region and models
Return to the Pulumi form and complete these fields.
- API format: Anthropic Messages for Claude models, or OpenAI Chat Completions or OpenAI Responses for models Bedrock serves over those APIs.
- AWS region: The region Pulumi calls Bedrock in, such as
us-west-2. GovCloud and China regions are not supported. - IAM role ARN: The role Pulumi assumes, such as
arn:aws:iam::123456789012:role/PulumiAgentBedrock. - Default model: A Bedrock model ID or inference profile ID that your region serves, such as
us.anthropic.claude-sonnet-4-5-20250929-v1:0. - Fast model (recommended): The ID of a smaller, faster model.
With OpenAI Responses, you can also set Thinking for the provider.
Test and use the provider
Select Save. Pulumi sends a test request to each configured model and shows any errors. If a request fails, correct the settings and save again.
To use the connection for one agent, open the agent's configuration, select the provider by name under Model, and save the agent. Start a new task to use that selection.
To use the connection for new tasks that follow the organization default, check whether it is already the default. If needed, select Set as default in Agent Settings. See how Pulumi chooses the default provider.