class ConditionBuilder
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.ConditionBuilder |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#ConditionBuilder |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.ConditionBuilder |
Python | aws_cdk.aws_bedrock_agentcore_alpha.ConditionBuilder |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป ConditionBuilder |
Builder for condition expressions in Cedar policies.
Conditions define when a policy statement should apply or not apply. Supports logical operators (AND, OR) and various comparison operators.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
const conditionBuilder = new bedrock_agentcore_alpha.ConditionBuilder();
Initializer
new ConditionBuilder()
Methods
| Name | Description |
|---|---|
| and() | Logical AND operator - all conditions must be true. |
| context | Access a context attribute for comparison. |
| or() | Logical OR operator - at least one condition must be true. |
| principal | Access a principal attribute for comparison. |
| resource | Access a resource attribute for comparison. |
and()
public and(): ConditionBuilder
Returns
Logical AND operator - all conditions must be true.
contextAttribute(attribute)
public contextAttribute(attribute: string): AttributeAccessor
Parameters
- attribute
stringโ - The attribute name (e.g., 'sourceIp', 'environment', 'timestamp').
Returns
Access a context attribute for comparison.
Context attributes come from the request environment. Common attributes: sourceIp, timestamp, environment, region, etc.
or()
public or(): ConditionBuilder
Returns
Logical OR operator - at least one condition must be true.
principalAttribute(attribute)
public principalAttribute(attribute: string): AttributeAccessor
Parameters
- attribute
stringโ - The attribute name (e.g., 'department', 'role', 'username').
Returns
Access a principal attribute for comparison.
Principal attributes come from the authenticated user/service making the request. Common attributes: username, role, department, groups, etc.
resourceAttribute(attribute)
public resourceAttribute(attribute: string): AttributeAccessor
Parameters
- attribute
stringโ - The attribute name (e.g., 'confidential', 'owner', 'classification').
Returns
Access a resource attribute for comparison.
Resource attributes come from the target resource being accessed. Common attributes: arn, type, tags, owner, etc.

.NET
Go
Java
Python
TypeScript (