ConditionalPolicyStatement
- class aws_cdk.aws_bedrock_agentcore_alpha.ConditionalPolicyStatement(policy_statement, condition_builder)
Bases:
object(experimental) Wrapper class for conditionally building policy statements.
This class allows chaining condition methods and returning to the parent PolicyStatement when done. It proxies condition building methods from ConditionBuilder.
- Stability:
experimental
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha # condition_builder: bedrock_agentcore_alpha.ConditionBuilder # policy_statement: bedrock_agentcore_alpha.PolicyStatement conditional_policy_statement = bedrock_agentcore_alpha.ConditionalPolicyStatement(policy_statement, condition_builder)
- Parameters:
policy_statement (
PolicyStatement)condition_builder (
ConditionBuilder)
- Stability:
experimental
Methods
- and_()
(experimental) Logical AND operator - all conditions must be true.
- Stability:
experimental
- Return type:
- context_attribute(attribute)
(experimental) Access a context attribute for comparison.
- Parameters:
attribute (
str) –The attribute name (e.g., ‘sourceIp’, ‘environment’, ‘timestamp’).
- Stability:
experimental
- Return type:
- done()
(experimental) Complete condition building and return to the PolicyStatement.
Use this to finish building when/unless conditions and continue configuring the policy statement.
- Stability:
experimental
- Return type:
- or_()
(experimental) Logical OR operator - at least one condition must be true.
- Stability:
experimental
- Return type:
- principal_attribute(attribute)
(experimental) Access a principal attribute for comparison.
- Parameters:
attribute (
str) –The attribute name (e.g., ‘department’, ‘role’, ‘username’).
- Stability:
experimental
- Return type:
- resource_attribute(attribute)
(experimental) Access a resource attribute for comparison.
- Parameters:
attribute (
str) –The attribute name (e.g., ‘confidential’, ‘owner’, ‘classification’).
- Stability:
experimental
- Return type:
- unless()
(experimental) Alias for done() to support fluent unless() chaining.
- Stability:
experimental
- Return type: