guardrails
Creates, updates, deletes or gets a guardrail
resource or lists guardrails
in a region
Overview
Name | guardrails |
Type | Resource |
Description | Definition of AWS::Bedrock::Guardrail Resource Type |
Id | aws.bedrock.guardrails |
Fields
Name | Datatype | Description |
---|---|---|
blocked_input_messaging | string | Messaging for when violations are detected in text |
blocked_outputs_messaging | string | Messaging for when violations are detected in text |
content_policy_config | object | Content policy config for a guardrail. |
created_at | string | Time Stamp |
description | string | Description of the guardrail or its version |
failure_recommendations | array | List of failure recommendations |
guardrail_arn | string | Arn representation for the guardrail |
guardrail_id | string | Unique id for the guardrail |
kms_key_arn | string | The KMS key with which the guardrail was encrypted at rest |
name | string | Name of the guardrail |
sensitive_information_policy_config | object | Sensitive information policy config for a guardrail. |
status | string | Status of the guardrail |
status_reasons | array | List of status reasons |
tags | array | List of Tags |
topic_policy_config | object | Topic policy config for a guardrail. |
updated_at | string | Time Stamp |
version | string | Guardrail version |
word_policy_config | object | Word policy config for a guardrail. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, BlockedInputMessaging, BlockedOutputsMessaging, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.bedrock.guardrails (
BlockedInputMessaging,
BlockedOutputsMessaging,
Name,
region
)
SELECT
'{{ BlockedInputMessaging }}',
'{{ BlockedOutputsMessaging }}',
'{{ Name }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.bedrock.guardrails (
BlockedInputMessaging,
BlockedOutputsMessaging,
ContentPolicyConfig,
Description,
KmsKeyArn,
Name,
SensitiveInformationPolicyConfig,
Tags,
TopicPolicyConfig,
WordPolicyConfig,
region
)
SELECT
'{{ BlockedInputMessaging }}',
'{{ BlockedOutputsMessaging }}',
'{{ ContentPolicyConfig }}',
'{{ Description }}',
'{{ KmsKeyArn }}',
'{{ Name }}',
'{{ SensitiveInformationPolicyConfig }}',
'{{ Tags }}',
'{{ TopicPolicyConfig }}',
'{{ WordPolicyConfig }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: guardrail
props:
- name: BlockedInputMessaging
value: '{{ BlockedInputMessaging }}'
- name: BlockedOutputsMessaging
value: '{{ BlockedOutputsMessaging }}'
- name: ContentPolicyConfig
value:
FiltersConfig:
- Type: '{{ Type }}'
InputStrength: '{{ InputStrength }}'
OutputStrength: null
- name: Description
value: '{{ Description }}'
- name: KmsKeyArn
value: '{{ KmsKeyArn }}'
- name: Name
value: '{{ Name }}'
- name: SensitiveInformationPolicyConfig
value:
PiiEntitiesConfig:
- Type: '{{ Type }}'
Action: '{{ Action }}'
RegexesConfig:
- Name: '{{ Name }}'
Description: '{{ Description }}'
Pattern: '{{ Pattern }}'
Action: null
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: TopicPolicyConfig
value:
TopicsConfig:
- Name: '{{ Name }}'
Definition: '{{ Definition }}'
Examples:
- '{{ Examples[0] }}'
Type: '{{ Type }}'
- name: WordPolicyConfig
value:
WordsConfig:
- Text: '{{ Text }}'
ManagedWordListsConfig:
- Type: '{{ Type }}'
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