Skip to main content

guardrails

Creates, updates, deletes or gets a guardrail resource or lists guardrails in a region

Overview

Nameguardrails
TypeResource
DescriptionDefinition of AWS::Bedrock::Guardrail Resource Type
Idaws.bedrock.guardrails

Fields

NameDatatypeDescription
blocked_input_messagingstringMessaging for when violations are detected in text
blocked_outputs_messagingstringMessaging for when violations are detected in text
content_policy_configobjectContent policy config for a guardrail.
created_atstringTime Stamp
descriptionstringDescription of the guardrail or its version
failure_recommendationsarrayList of failure recommendations
guardrail_arnstringArn representation for the guardrail
guardrail_idstringUnique id for the guardrail
kms_key_arnstringThe KMS key with which the guardrail was encrypted at rest
namestringName of the guardrail
sensitive_information_policy_configobjectSensitive information policy config for a guardrail.
statusstringStatus of the guardrail
status_reasonsarrayList of status reasons
tagsarrayList of Tags
topic_policy_configobjectTopic policy config for a guardrail.
updated_atstringTime Stamp
versionstringGuardrail version
word_policy_configobjectWord policy config for a guardrail.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTName, BlockedInputMessaging, BlockedOutputsMessaging, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all guardrails in a region.

SELECT
region,
blocked_input_messaging,
blocked_outputs_messaging,
content_policy_config,
created_at,
description,
failure_recommendations,
guardrail_arn,
guardrail_id,
kms_key_arn,
name,
sensitive_information_policy_config,
status,
status_reasons,
tags,
topic_policy_config,
updated_at,
version,
word_policy_config
FROM aws.bedrock.guardrails
WHERE region = 'us-east-1';

Gets all properties from an individual guardrail.

SELECT
region,
blocked_input_messaging,
blocked_outputs_messaging,
content_policy_config,
created_at,
description,
failure_recommendations,
guardrail_arn,
guardrail_id,
kms_key_arn,
name,
sensitive_information_policy_config,
status,
status_reasons,
tags,
topic_policy_config,
updated_at,
version,
word_policy_config
FROM aws.bedrock.guardrails
WHERE region = 'us-east-1' AND data__Identifier = '<GuardrailArn>';

INSERT example

Use the following StackQL query and manifest file to create a new guardrail resource, using stack-deploy.

/*+ create */
INSERT INTO aws.bedrock.guardrails (
BlockedInputMessaging,
BlockedOutputsMessaging,
Name,
region
)
SELECT
'{{ BlockedInputMessaging }}',
'{{ BlockedOutputsMessaging }}',
'{{ Name }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.bedrock.guardrails
WHERE data__Identifier = '<GuardrailArn>'
AND region = 'us-east-1';

Permissions

To operate on the guardrails resource, the following permissions are required:

Create

bedrock:CreateGuardrail,
bedrock:GetGuardrail,
kms:DescribeKey,
kms:CreateGrant,
kms:GenerateDataKey,
kms:Decrypt,
bedrock:TagResource,
bedrock:ListTagsForResource

Read

bedrock:GetGuardrail,
kms:Decrypt,
bedrock:ListTagsForResource

Update

bedrock:UpdateGuardrail,
bedrock:GetGuardrail,
bedrock:ListTagsForResource,
bedrock:TagResource,
bedrock:UntagResource,
kms:DescribeKey,
kms:CreateGrant,
kms:GenerateDataKey,
kms:Decrypt

Delete

bedrock:DeleteGuardrail,
bedrock:GetGuardrail,
kms:Decrypt,
kms:RetireGrant

List

bedrock:ListGuardrails