Files
floci/docs/services/bedrock.md
T
Priamo Germosen 5b4bc0e44e feat(iam): read Bedrock from the generated tables, its routes vendored (#9169)
Bedrock leaves ResourceArnBuilder's own branch and the registry's three resource-policy rules: its
requests are matched on their botocore routes and checked on the resources the request-resources table
reads. regen_rest_routes.py vendors the bedrock, bedrock-agent and bedrock-runtime models, all signed
for the bedrock scope; bedrock-agent's are needed because its PutResourcePolicy carries resourceArn in
its path where bedrock's carries it in its body, a member the two clients locate apart.
regen_iam_request_resources.py reads bedrock instead of leaving it to the builder, so a guardrail
request is checked on the guardrail its path names and a resource-policy request on the ARN it carries.
The generator's reader of an ARN pattern's type words also reads one whose account is optional, so the
tag actions are checked on the guardrail or application inference profile ARN they carry, and
regen_iam_tag_on_create.py reads bedrock, so a create carrying tags also needs bedrock:TagResource.

BedrockStoredResourceArns gives IAM the tags Bedrock holds on a guardrail or an application inference
profile, for aws:ResourceTag, read in place and matched on the whole ARN; a guardrail's untag now
replaces its tag map rather than editing it, so a reader never sees half of one, and both models keep
their tags volatile.
2026-11-22 00:01:33 -04:00

13 KiB

Amazon Bedrock (control plane)

Protocol: REST-JSON Endpoint: http://localhost:4566/guardrails, /foundation-models, /inference-profiles (SigV4 service bedrock)

This page covers the Bedrock control plane. Model invocation is a separate service that shares the same signing name: see Bedrock Runtime.

Supported Actions

Action Description
CreateGuardrail Create a guardrail; returns the DRAFT version, READY immediately
GetGuardrail Read a guardrail by id or ARN, at DRAFT or a numbered guardrailVersion
UpdateGuardrail Replace the DRAFT configuration
CreateGuardrailVersion Snapshot the DRAFT under the next numerical version
DeleteGuardrail Delete one numerical version, or the guardrail and all its versions
ListGuardrails List every guardrail's DRAFT, or every version of one guardrail
ListFoundationModels List the catalog's foundation models served in the calling Region, filtered by provider and output modality
GetFoundationModel Read one foundation model by id or ARN
ListInferenceProfiles List system-defined and created application profiles, with type, maxResults and nextToken
GetInferenceProfile Read a system-defined or application profile by id or ARN, including its model destinations
CreateInferenceProfile Create an application profile from a regional foundation model or system-defined profile
DeleteInferenceProfile Delete an application profile by id or ARN
PutResourcePolicy Attach a resource-based policy to a guardrail or a guardrail profile (POST /resource-policy)
GetResourcePolicy Read the resource-based policy of a guardrail or a guardrail profile
DeleteResourcePolicy Remove the resource-based policy of a guardrail or a guardrail profile
TagResource Tag a guardrail or application inference profile (POST /tagResource)
UntagResource Remove tags from a guardrail or application inference profile (POST /untagResource)
ListTagsForResource List a guardrail's or application inference profile's tags (POST /listTagsForResource)

Guardrails are versioned. The working copy is DRAFT, and GetGuardrail without a guardrailVersion query parameter returns it. CreateGuardrailVersion copies the current DRAFT to 1, 2 and so on. Those snapshots are immutable, because UpdateGuardrail only ever writes DRAFT.

GuardrailStatus is READY from the first read, so aws_bedrock_guardrail's status poll completes without a transition. Policy blocks are submitted as the *Config shapes (topicPolicyConfig, contentPolicyConfig and the rest) and read back under their unsuffixed names (topicPolicy.topics, contentPolicy.filters), matching the AWS model.

ListGuardrails returns one DRAFT summary per guardrail. Passing guardrailIdentifier returns every version of that one guardrail instead. Both forms honour maxResults and nextToken.

DeleteGuardrail takes a GuardrailNumericalVersion, so a version query parameter of DRAFT is rejected with ValidationException. Omit the parameter to delete the guardrail and all of its versions.

Both an id (abc123def456) and a full ARN are accepted wherever the API takes a guardrailIdentifier or a resourceARN.

For guardrails, the three tag actions require a full ARN to match the stored ARN exactly, including partition, service, Region, account, and resource type. An ARN that only shares the guardrail ID returns ResourceNotFoundException (HTTP 404) without changing tags. The existing bare-ID form remains accepted.

kmsKeyId on CreateGuardrail and UpdateGuardrail is a KmsKeyId: a key id, a key ARN, an alias name or an alias ARN. kmsKeyArn on the read shapes is a KmsKeyArn, which is only ever the full key ARN, so every accepted form is resolved through KMS to that one shape. A key that does not exist, is disabled, or is pending deletion is rejected with ValidationException.

The AWS model's length constraints are enforced: name is 1 to 50 characters matching [0-9a-zA-Z-_]+, description is 1 to 200, and blockedInputMessaging and blockedOutputsMessaging are 1 to 500 each. A value outside those bounds is rejected with ValidationException.

The model's tag limits are enforced as well. A TagList holds at most 200 items on one request, and a longer array is rejected with ValidationException. A guardrail holds at most 50 tags, counted over the tags already on it together with the tags in the current request, so CreateGuardrail and TagResource both raise TooManyTagsException once the resulting total would pass 50. Replacing the value of a tag key the guardrail already carries does not add to that total.

A resource-based policy is attached to a guardrail or a system-defined guardrail profile by its full ARN. The policy is held to the restricted language the Bedrock user guide documents, and anything else is rejected with ValidationException: it is one JSON object of 1 to 20480 characters with nothing after it, every statement is an Allow on the ARN the policy is attached to, its actions are bedrock:ApplyGuardrail and bedrock:GetGuardrail (only bedrock:ApplyGuardrail on a guardrail profile), and its principal is either the account root ({"AWS": "arn:aws:iam::<account>:root"} and no other principal) or * under a StringEquals condition on aws:PrincipalOrgID. The only conditions accepted are that one and ForAnyValue:StringLike on aws:PrincipalOrgPaths, each with a string or an array of strings. The policy is stored as given; it is not evaluated against callers.

A guardrail's policy lives on the guardrail. GetResourcePolicy on a guardrail with no policy returns a response without resourcePolicy, and deleting the guardrail deletes its policy. An ARN that names no guardrail of the caller's account and Region returns ResourceNotFoundException. A guardrail profile has one ARN per destination Region, and its policy is stored under the Region whose endpoint received PutResourcePolicy, as AWS stores it, so the same profile ARN can hold a different policy in each calling Region. GetResourcePolicy on a profile ARN that holds no policy in the calling Region returns the empty policy {}. A profile ARN of another account or partition returns ResourceNotFoundException; whether the profile's Region is a destination of the calling Region is not checked.

With IAM enforcement on, every Bedrock and Bedrock Runtime request is authorized as the action AWS's Service Reference gives its operation, on the resources its request names, read from the generated tables like other services' requests: GetGuardrail on the guardrail its path names, PutResourcePolicy, GetResourcePolicy and DeleteResourcePolicy on the ARN the request names, and TagResource, UntagResource and ListTagsForResource on the guardrail or application inference profile ARN they carry. A CreateGuardrail or CreateInferenceProfile carrying tags also needs bedrock:TagResource, with aws:RequestTag and aws:TagKeys taken from those tags. The tables do not read the model an InvokeModel or InvokeModelWithResponseStream request names, so those two are checked on the account's marketplace/model-endpoint/all-access resource, the one type of their actions that names no model.

Guardrails are listed by the Resource Groups Tagging API (resource type bedrock:guardrail) and Resource Explorer with their own tags, and TagResources / UntagResources there change those tags, as TagResource and UntagResource do.

Foundation models and inference profiles

ListFoundationModels and GetFoundationModel read a fixed catalog, bedrock/model-catalog.yaml. System-defined inference profiles come from the same seed, while application inference profiles are created and stored by the Bedrock control plane. The catalog is a seed rather than a mirror of AWS: a few real models (Amazon Nova Micro and Nova Lite, Titan Text Embeddings V2, Llama 3.1 8B Instruct and Claude Sonnet 4.5) with the modalities, streaming support, lifecycle status and Regional availability their model cards publish, and their US and EU system-defined inference profiles.

The answers depend on the calling Region, as on AWS:

  • A model is listed when its card shows it served in that Region, or when one of its inference profiles can be called from it. GetFoundationModel answers a catalog model the Region does not serve, an unknown model id, and an ARN that does not name a foundation model in the calling Region and partition with ValidationException, as AWS does.
  • byOutputModality accepts SPEECH and VIDEO as well as the published TEXT, IMAGE and EMBEDDING, as AWS does. No catalog model produces speech or video, so those filters return an empty list.
  • A system-defined inference profile is listed only in its source Regions. Its models are the foundation models in the destination Regions the card gives for the calling Region, so us.amazon.nova-lite-v1:0 called from us-west-1 routes to four Regions and from us-east-1 to three. GetInferenceProfile on a profile the Region cannot use returns ResourceNotFoundException.
  • inferenceTypesSupported includes ON_DEMAND where the model is served in the Region itself, and INFERENCE_PROFILE where a seeded system-defined profile can be called from the Region. A model reachable only through a profile reports INFERENCE_PROFILE without ON_DEMAND, so byInferenceType=ON_DEMAND leaves those out.
  • modelArn is arn:<partition>:bedrock:<region>::foundation-model/<modelId>, and the system-defined inferenceProfileArn carries the calling Region and account. GetInferenceProfile answers an ARN of another service or without an account with ValidationException, one of another account with AccessDeniedException, and one of another Region, partition or resource type with ResourceNotFoundException.
  • The error codes and statuses follow AWS; the message text is Floci's own.

CreateInferenceProfile accepts modelSource.copyFrom with a foundation-model ARN served in the calling Region, or a system-defined inference-profile ARN available to the calling Region and account. It creates a stored APPLICATION profile whose GetInferenceProfile result includes its id, ARN, name, description, models and timestamps. ListInferenceProfiles includes these profiles alongside the system-defined catalog; type=APPLICATION selects only the created profiles. An application profile can be deleted by id or ARN and tagged through the Bedrock tag actions. Copying an application profile is not supported.

Deviations: models that are not in the catalog are not listed, provisioned throughput is never reported, and customizationsSupported is always empty, so byCustomizationType and byInferenceType=PROVISIONED return no models. ListInferenceProfiles pages up to 1000 profiles; maxResults outside 1 to 1000 is rejected with ValidationException.

Not implemented

The rest of the Bedrock control plane is absent rather than stubbed, because emulating it faithfully would require behaviour Floci has no way to model:

  • Custom model, model customization, model import and distillation jobs. These depend on real training runs.
  • Model evaluation and evaluation jobs. These depend on real inference.
  • Provisioned throughput and prompt routers. These describe real capacity reservations and routing.
  • Model invocation logging, batch inference and async invoke. These are data-plane operations backed by real model execution.

Configuration

Variable Default Description
FLOCI_SERVICES_BEDROCK_ENABLED true Enable or disable the service

Examples

export AWS_ENDPOINT_URL=http://localhost:4566

aws bedrock create-guardrail \
  --name my-guardrail \
  --blocked-input-messaging "Blocked." \
  --blocked-outputs-messaging "Blocked." \
  --content-policy-config '{"filtersConfig":[{"type":"HATE","inputStrength":"HIGH","outputStrength":"HIGH"}]}'

aws bedrock get-guardrail --guardrail-identifier abc123def456

aws bedrock create-guardrail-version --guardrail-identifier abc123def456

aws bedrock list-guardrails

aws bedrock tag-resource \
  --resource-arn arn:aws:bedrock:us-east-1:000000000000:guardrail/abc123def456 \
  --tags key=team,value=ai

aws bedrock put-resource-policy \
  --resource-arn arn:aws:bedrock:us-east-1:000000000000:guardrail/abc123def456 \
  --resource-policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::000000000000:root"},"Action":["bedrock:ApplyGuardrail","bedrock:GetGuardrail"],"Resource":"arn:aws:bedrock:us-east-1:000000000000:guardrail/abc123def456"}]}'

aws bedrock get-resource-policy \
  --resource-arn arn:aws:bedrock:us-east-1:000000000000:guardrail/abc123def456

aws bedrock delete-guardrail --guardrail-identifier abc123def456

aws bedrock list-foundation-models --by-output-modality EMBEDDING

aws bedrock list-inference-profiles --type-equals SYSTEM_DEFINED

aws bedrock get-inference-profile --inference-profile-identifier us.amazon.nova-lite-v1:0