Amazon Bedrock AgentCore Construct Library
Version 2.273.0-alpha.0
Separate package
@aws-cdk/aws-bedrock-agentcore-alpha is not part of aws-cdk-lib — install it separately:
npm install @aws-cdk/aws-bedrock-agentcore-alpha
pip install aws-cdk.aws-bedrock-agentcore-alpha
This module is experimental (alpha): its API may change in any release, without a major version bump.
The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
The Policy submodule is the only submodule that remains in alpha. All other constructs have graduated to stable in
aws-cdk-lib/aws-bedrockagentcoreand we recommend migrating to the stable versions.
| Language | Package |
|---|---|
TypeScript | @aws-cdk/aws-bedrock-agentcore-alpha |
Migration to Stable
All constructs except Policy have moved to aws-cdk-lib/aws-bedrockagentcore:
// Before
import * as agentcore from '@aws-cdk/aws-bedrock-agentcore-alpha';
# Before
import aws_cdk.aws_bedrock_agentcore_alpha as agentcore
// Before
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;
// Before
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;
// Before
import agentcore "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"
// After (for all non-Policy constructs)
import * as agentcore from 'aws-cdk-lib/aws-bedrockagentcore';
# After (for all non-Policy constructs)
import aws_cdk.aws_bedrockagentcore as agentcore
// After (for all non-Policy constructs)
import software.amazon.awscdk.services.bedrockagentcore.*;
// After (for all non-Policy constructs)
using Amazon.CDK.AWS.BedrockAgentCore;
// After (for all non-Policy constructs)
import agentcore "github.com/aws/aws-cdk-go/awscdk"
The following constructs are now in stable:
- Runtime:
Runtime,RuntimeEndpoint,AgentRuntimeArtifact,NetworkConfiguration,Observability - Gateway:
Gateway,GatewayTarget,GatewayAuthorizer,GatewayCredentialProvider,Interceptor - Tools:
BrowserCustom,CodeInterpreterCustom - Memory:
Memory,MemoryStrategy - Evaluation:
OnlineEvaluationConfig,Evaluator,EvaluatorSelector - Identity:
OAuth2CredentialProvider,ApiKeyCredentialProvider,WorkloadIdentity
What Remains in Alpha
The Policy submodule remains experimental:
PolicyEnginePolicyPolicyStatementPolicyValidationModePolicyEngineMode
Policy Engine
A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with a gateway, the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies.
For more information, see the Policy in Amazon Bedrock AgentCore documentation.
PolicyEngine Properties
| Name | Type | Required | Description |
|---|---|---|---|
policyEngineName | string | No | The name of the policy engine. Valid characters: a-z, A-Z, 0-9, _ (underscore). Must start with a letter, 1-48 characters. If not provided, a unique name will be auto-generated |
description | string | No | Optional description for the policy engine (max 4,096 characters). Default: no description |
kmsKey | IKey | No | Custom KMS key for encryption. IMPORTANT: Once set, cannot be changed (requires replacement). Must be symmetric ENCRYPT_DECRYPT key. If key becomes inaccessible, all authorization decisions will be DENIED. Default: AWS owned key |
tags | { [key: string]: string } | No | Tags for the policy engine (max 50 tags). Default: no tags |
Understanding Cedar Policies in AgentCore
Policies are constructed using Cedar language, an open source language for writing and enforcing authorization policies. Cedar policies in AgentCore follow a specific structure with three main components: Principal, Action, and Resource. Understanding how these components work together is critical for writing effective policies.
Policy Structure
Every Cedar policy has this basic structure:
permit( // or forbid
principal, // Who is making the request
action, // What operation they want to perform
resource // What Gateway/tool they want to access
)
when { // Optional conditions
// Additional constraints
};
Example Policy
permit(
principal,
action == AgentCore::Action::"ApplicationToolTarget___create_application",
resource == AgentCore::Gateway::"<gateway-arn>"
) when {
context.input.coverage_amount <= 1000000
};
Basic PolicyEngine and Policy Creation
Create a policy engine and add policies to it.
Policy Engine Mode
When associating a policy engine with a gateway, you can control the enforcement behavior using PolicyEngineMode:
PolicyEngineMode.LOG_ONLY(default) — evaluates actions and adds traces but does not enforce decisions. Use this mode for testing and validation before enabling enforcement.PolicyEngineMode.ENFORCE— actively allows or denies agent operations based on Cedar policy evaluation.
// Create a Policy engine
const policyEngine = new agentcore.PolicyEngine(this, "MyPolicyEngine", {
policyEngineName: "my_policy_engine",
description: "Policy engine for access control",
});
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-gateway",
policyEngineConfiguration: {
policyEngine: policyEngine,
mode: agentcore.PolicyEngineMode.ENFORCE, // Default is LOG_ONLY
},
});
// Add policy to policy engine
policyEngine.addPolicy("AllowAllActions", {
definition: `
permit(
principal,
action,
resource == AgentCore::Gateway::"${gateway.gatewayArn}"
);
`,
description: "Allow all actions on specific gateway (development)",
validationMode: agentcore.PolicyValidationMode.IGNORE_ALL_FINDINGS, // This will ignore all cedar warnings
});
// you can add multiple policies to the policy engine
policyEngine.addPolicy("SpecificToolPolicy", {
definition: `
permit(
principal is AgentCore::OAuthUser,
action == AgentCore::Action::"WeatherTool__get_forecast",
resource == AgentCore::Gateway::"${gateway.gatewayArn}"
);
`,
description: "Allow specific weather tool access",
validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS, // This will fail policy creation for any cedar warning
});
# Create a Policy engine
policy_engine = agentcore.PolicyEngine(self, "MyPolicyEngine",
policy_engine_name="my_policy_engine",
description="Policy engine for access control"
)
gateway = agentcore.Gateway(self, "MyGateway",
gateway_name="my-gateway",
policy_engine_configuration=agentcore.GatewayPolicyEngineConfig(
policy_engine=policy_engine,
mode=agentcore.PolicyEngineMode.ENFORCE
)
)
# Add policy to policy engine
policy_engine.add_policy("AllowAllActions",
definition=f"""
permit(
principal,
action,
resource == AgentCore::Gateway::\"{gateway.gatewayArn}\"
);
""",
description="Allow all actions on specific gateway (development)",
validation_mode=agentcore.PolicyValidationMode.IGNORE_ALL_FINDINGS
)
# you can add multiple policies to the policy engine
policy_engine.add_policy("SpecificToolPolicy",
definition=f"""
permit(
principal is AgentCore::OAuthUser,
action == AgentCore::Action::\"WeatherTool__get_forecast\",
resource == AgentCore::Gateway::\"{gateway.gatewayArn}\"
);
""",
description="Allow specific weather tool access",
validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
// Create a Policy engine
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "MyPolicyEngine")
.policyEngineName("my_policy_engine")
.description("Policy engine for access control")
.build();
Gateway gateway = Gateway.Builder.create(this, "MyGateway")
.gatewayName("my-gateway")
.policyEngineConfiguration(GatewayPolicyEngineConfig.builder()
.policyEngine(policyEngine)
.mode(PolicyEngineMode.ENFORCE)
.build())
.build();
// Add policy to policy engine
policyEngine.addPolicy("AllowAllActions", AddPolicyOptions.builder()
.definition(String.format("%n permit(%n principal,%n action,%n resource == AgentCore::Gateway::\"%s\"%n );%n ", gateway.getGatewayArn()))
.description("Allow all actions on specific gateway (development)")
.validationMode(PolicyValidationMode.IGNORE_ALL_FINDINGS)
.build());
// you can add multiple policies to the policy engine
policyEngine.addPolicy("SpecificToolPolicy", AddPolicyOptions.builder()
.definition(String.format("%n permit(%n principal is AgentCore::OAuthUser,%n action == AgentCore::Action::\"WeatherTool__get_forecast\",%n resource == AgentCore::Gateway::\"%s\"%n );%n ", gateway.getGatewayArn()))
.description("Allow specific weather tool access")
.validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
.build());
// Create a Policy engine
var policyEngine = new PolicyEngine(this, "MyPolicyEngine", new PolicyEngineProps {
PolicyEngineName = "my_policy_engine",
Description = "Policy engine for access control"
});
var gateway = new Gateway(this, "MyGateway", new GatewayProps {
GatewayName = "my-gateway",
PolicyEngineConfiguration = new GatewayPolicyEngineConfig {
PolicyEngine = policyEngine,
Mode = PolicyEngineMode.ENFORCE
}
});
// Add policy to policy engine
policyEngine.AddPolicy("AllowAllActions", new AddPolicyOptions {
Definition = $@"
permit(
principal,
action,
resource == AgentCore::Gateway::""{gateway.gatewayArn}""
);
",
Description = "Allow all actions on specific gateway (development)",
ValidationMode = PolicyValidationMode.IGNORE_ALL_FINDINGS
});
// you can add multiple policies to the policy engine
policyEngine.AddPolicy("SpecificToolPolicy", new AddPolicyOptions {
Definition = $@"
permit(
principal is AgentCore::OAuthUser,
action == AgentCore::Action::""WeatherTool__get_forecast"",
resource == AgentCore::Gateway::""{gateway.gatewayArn}""
);
",
Description = "Allow specific weather tool access",
ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
// Create a Policy engine
policyEngine := agentcore.NewPolicyEngine(this, jsii.String("MyPolicyEngine"), &PolicyEngineProps{
PolicyEngineName: jsii.String("my_policy_engine"),
Description: jsii.String("Policy engine for access control"),
})
gateway := agentcore.NewGateway(this, jsii.String("MyGateway"), &GatewayProps{
GatewayName: jsii.String("my-gateway"),
PolicyEngineConfiguration: &GatewayPolicyEngineConfig{
PolicyEngine: policyEngine,
Mode: agentcore.PolicyEngineMode_ENFORCE(),
},
})
// Add policy to policy engine
policyEngine.AddPolicy(jsii.String("AllowAllActions"), &AddPolicyOptions{
Definition: fmt.Sprintf("\n permit(\n principal,\n action,\n resource == AgentCore::Gateway::\"%v\"\n );\n ", gateway.GatewayArn),
Description: jsii.String("Allow all actions on specific gateway (development)"),
ValidationMode: agentcore.PolicyValidationMode_IGNORE_ALL_FINDINGS(),
})
// you can add multiple policies to the policy engine
policyEngine.AddPolicy(jsii.String("SpecificToolPolicy"), &AddPolicyOptions{
Definition: fmt.Sprintf("\n permit(\n principal is AgentCore::OAuthUser,\n action == AgentCore::Action::\"WeatherTool__get_forecast\",\n resource == AgentCore::Gateway::\"%v\"\n );\n ", gateway.*GatewayArn),
Description: jsii.String("Allow specific weather tool access"),
ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})
Type-Safe Policy Builder
For a more type-safe approach, use the PolicyStatement builder instead of writing raw Cedar syntax.
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-gateway",
});
const policyEngine = new agentcore.PolicyEngine(this, "MyPolicyEngine", {
policyEngineName: "my_policy_engine",
});
const allowAllPolicy = new agentcore.Policy(this, "AllowAllPolicy", {
policyEngine: policyEngine,
policyName: "allow_all",
statement: agentcore.PolicyStatement.permit()
.forAllPrincipals() // ** This will give overly permission to all principals
.onAllActions()
.onResource('AgentCore::Gateway', gateway.gatewayArn),
description: "Allow all actions on specific gateway (development only)",
validationMode: agentcore.PolicyValidationMode.IGNORE_ALL_FINDINGS,
});
// Generated Cedar:
// permit(
// principal,
// action,
// resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:region:account:gateway/gateway-id"
// );
gateway = agentcore.Gateway(self, "MyGateway",
gateway_name="my-gateway"
)
policy_engine = agentcore.PolicyEngine(self, "MyPolicyEngine",
policy_engine_name="my_policy_engine"
)
allow_all_policy = agentcore.Policy(self, "AllowAllPolicy",
policy_engine=policy_engine,
policy_name="allow_all",
statement=agentcore.PolicyStatement.permit().for_all_principals().on_all_actions().on_resource("AgentCore::Gateway", gateway.gateway_arn),
description="Allow all actions on specific gateway (development only)",
validation_mode=agentcore.PolicyValidationMode.IGNORE_ALL_FINDINGS
)
Gateway gateway = Gateway.Builder.create(this, "MyGateway")
.gatewayName("my-gateway")
.build();
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "MyPolicyEngine")
.policyEngineName("my_policy_engine")
.build();
Policy allowAllPolicy = Policy.Builder.create(this, "AllowAllPolicy")
.policyEngine(policyEngine)
.policyName("allow_all")
.statement(PolicyStatement.permit().forAllPrincipals().onAllActions().onResource("AgentCore::Gateway", gateway.getGatewayArn()))
.description("Allow all actions on specific gateway (development only)")
.validationMode(PolicyValidationMode.IGNORE_ALL_FINDINGS)
.build();
var gateway = new Gateway(this, "MyGateway", new GatewayProps {
GatewayName = "my-gateway"
});
var policyEngine = new PolicyEngine(this, "MyPolicyEngine", new PolicyEngineProps {
PolicyEngineName = "my_policy_engine"
});
var allowAllPolicy = new Policy(this, "AllowAllPolicy", new PolicyProps {
PolicyEngine = policyEngine,
PolicyName = "allow_all",
Statement = PolicyStatement.Permit().ForAllPrincipals().OnAllActions().OnResource("AgentCore::Gateway", gateway.GatewayArn),
Description = "Allow all actions on specific gateway (development only)",
ValidationMode = PolicyValidationMode.IGNORE_ALL_FINDINGS
});
gateway := agentcore.NewGateway(this, jsii.String("MyGateway"), &GatewayProps{
GatewayName: jsii.String("my-gateway"),
})
policyEngine := agentcore.NewPolicyEngine(this, jsii.String("MyPolicyEngine"), &PolicyEngineProps{
PolicyEngineName: jsii.String("my_policy_engine"),
})
allowAllPolicy := agentcore.NewPolicy(this, jsii.String("AllowAllPolicy"), &PolicyProps{
PolicyEngine: policyEngine,
PolicyName: jsii.String("allow_all"),
Statement: agentcore.PolicyStatement_Permit().ForAllPrincipals().OnAllActions().OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn),
Description: jsii.String("Allow all actions on specific gateway (development only)"),
ValidationMode: agentcore.PolicyValidationMode_IGNORE_ALL_FINDINGS(),
})
Policy with Specific Actions
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;
// Allow specific tool actions on specific gateway
// Action names follow pattern: "ToolName__operation"
policyEngine.addPolicy("SpecificToolPolicy", {
statement: agentcore.PolicyStatement.permit()
.forPrincipal('AgentCore::OAuthUser::your-client-id')
.onActions([
'AgentCore::Action::WeatherTool__get_forecast',
'AgentCore::Action::WeatherTool__get_current',
])
.onResource('AgentCore::Gateway', gateway.gatewayArn),
description: "Allow specific weather tool operations",
validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});
// Generated Cedar:
// permit(
// principal is AgentCore::OAuthUser,
// action in [
// AgentCore::Action::"WeatherTool__get_forecast",
// AgentCore::Action::"WeatherTool__get_current"
// ],
// resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:us-east-1:123:gateway/gw-123"
// );
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway
# Allow specific tool actions on specific gateway
# Action names follow pattern: "ToolName__operation"
policy_engine.add_policy("SpecificToolPolicy",
statement=agentcore.PolicyStatement.permit().for_principal("AgentCore::OAuthUser::your-client-id").on_actions(["AgentCore::Action::WeatherTool__get_forecast", "AgentCore::Action::WeatherTool__get_current"
]).on_resource("AgentCore::Gateway", gateway.gateway_arn),
description="Allow specific weather tool operations",
validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
PolicyEngine policyEngine;
Gateway gateway;
// Allow specific tool actions on specific gateway
// Action names follow pattern: "ToolName__operation"
policyEngine.addPolicy("SpecificToolPolicy", AddPolicyOptions.builder()
.statement(PolicyStatement.permit().forPrincipal("AgentCore::OAuthUser::your-client-id").onActions(List.of("AgentCore::Action::WeatherTool__get_forecast", "AgentCore::Action::WeatherTool__get_current")).onResource("AgentCore::Gateway", gateway.getGatewayArn()))
.description("Allow specific weather tool operations")
.validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
.build());
PolicyEngine policyEngine;
Gateway gateway;
// Allow specific tool actions on specific gateway
// Action names follow pattern: "ToolName__operation"
policyEngine.AddPolicy("SpecificToolPolicy", new AddPolicyOptions {
Statement = PolicyStatement.Permit().ForPrincipal("AgentCore::OAuthUser::your-client-id").OnActions(new [] { "AgentCore::Action::WeatherTool__get_forecast", "AgentCore::Action::WeatherTool__get_current" }).OnResource("AgentCore::Gateway", gateway.GatewayArn),
Description = "Allow specific weather tool operations",
ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
var policyEngine PolicyEngine
var gateway Gateway
// Allow specific tool actions on specific gateway
// Action names follow pattern: "ToolName__operation"
policyEngine.AddPolicy(jsii.String("SpecificToolPolicy"), &AddPolicyOptions{
Statement: agentcore.PolicyStatement_Permit().ForPrincipal(jsii.String("AgentCore::OAuthUser::your-client-id")).OnActions([]*string{
jsii.String("AgentCore::Action::WeatherTool__get_forecast"),
jsii.String("AgentCore::Action::WeatherTool__get_current"),
}).OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn),
Description: jsii.String("Allow specific weather tool operations"),
ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})
Policy with Conditions
Use when clauses to add advanced conditions based on principal tags (from OAuth token) or context:
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;
// Policy with when conditions using principal tags
const conditionalPolicy = new agentcore.Policy(this, "ConditionalPolicy", {
policyEngine: policyEngine,
policyName: "conditional_access",
statement: agentcore.PolicyStatement.permit()
.forPrincipal('AgentCore::OAuthUser') // Type constraint
.onAllActions()
.onResource('AgentCore::Gateway', gateway.gatewayArn) // Specific ARN
.when()
.principalAttribute('department').equalTo('Engineering')
.and()
.contextAttribute('input.priority').equalTo('high')
.done(),
description: "Allow engineers for high-priority requests",
validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});
// Generated Cedar:
// permit(
// principal is AgentCore::OAuthUser,
// action,
// resource == AgentCore::Gateway::"arn:..."
// )
// when {
// principal.department == "Engineering" && context.input.priority == "high"
// };
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway
# Policy with when conditions using principal tags
conditional_policy = agentcore.Policy(self, "ConditionalPolicy",
policy_engine=policy_engine,
policy_name="conditional_access",
statement=agentcore.PolicyStatement.permit().for_principal("AgentCore::OAuthUser").on_all_actions().on_resource("AgentCore::Gateway", gateway.gateway_arn).when().principal_attribute("department").equal_to("Engineering").and().context_attribute("input.priority").equal_to("high").done(),
description="Allow engineers for high-priority requests",
validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
PolicyEngine policyEngine;
Gateway gateway;
// Policy with when conditions using principal tags
Policy conditionalPolicy = Policy.Builder.create(this, "ConditionalPolicy")
.policyEngine(policyEngine)
.policyName("conditional_access")
.statement(PolicyStatement.permit().forPrincipal("AgentCore::OAuthUser").onAllActions().onResource("AgentCore::Gateway", gateway.gatewayArn).when().principalAttribute("department").equalTo("Engineering").and().contextAttribute("input.priority").equalTo("high").done())
.description("Allow engineers for high-priority requests")
.validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
.build();
PolicyEngine policyEngine;
Gateway gateway;
// Policy with when conditions using principal tags
var conditionalPolicy = new Policy(this, "ConditionalPolicy", new PolicyProps {
PolicyEngine = policyEngine,
PolicyName = "conditional_access",
Statement = PolicyStatement.Permit().ForPrincipal("AgentCore::OAuthUser").OnAllActions().OnResource("AgentCore::Gateway", gateway.GatewayArn).When().PrincipalAttribute("department").EqualTo("Engineering").And().ContextAttribute("input.priority").EqualTo("high").Done(),
Description = "Allow engineers for high-priority requests",
ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
var policyEngine PolicyEngine
var gateway Gateway
// Policy with when conditions using principal tags
conditionalPolicy := agentcore.NewPolicy(this, jsii.String("ConditionalPolicy"), &PolicyProps{
PolicyEngine: policyEngine,
PolicyName: jsii.String("conditional_access"),
Statement: agentcore.PolicyStatement_Permit().ForPrincipal(jsii.String("AgentCore::OAuthUser")).OnAllActions().OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn).When().PrincipalAttribute(jsii.String("department")).EqualTo(jsii.String("Engineering")).And().ContextAttribute(jsii.String("input.priority")).*EqualTo(jsii.String("high")).Done(),
Description: jsii.String("Allow engineers for high-priority requests"),
ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})
Policy with Exclusions (unless)
Use unless clauses to exclude specific conditions from a policy. The policy applies when the unless conditions are NOT met:
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;
// Allow access unless the user is suspended
const policyWithUnless = new agentcore.Policy(this, "UnlessPolicy", {
policyEngine: policyEngine,
policyName: "unless_suspended",
statement: agentcore.PolicyStatement.permit()
.forPrincipal('AgentCore::OAuthUser')
.onAllActions()
.onResource('AgentCore::Gateway', gateway.gatewayArn)
.unless()
.principalAttribute('suspended').equalTo(true)
.done(),
description: "Allow all actions unless user is suspended",
validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});
// Generated Cedar:
// permit(
// principal is AgentCore::OAuthUser,
// action,
// resource == AgentCore::Gateway::"arn:..."
// )
// unless {
// principal.suspended == true
// };
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway
# Allow access unless the user is suspended
policy_with_unless = agentcore.Policy(self, "UnlessPolicy",
policy_engine=policy_engine,
policy_name="unless_suspended",
statement=agentcore.PolicyStatement.permit().for_principal("AgentCore::OAuthUser").on_all_actions().on_resource("AgentCore::Gateway", gateway.gateway_arn).unless().principal_attribute("suspended").equal_to(True).done(),
description="Allow all actions unless user is suspended",
validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
PolicyEngine policyEngine;
Gateway gateway;
// Allow access unless the user is suspended
Policy policyWithUnless = Policy.Builder.create(this, "UnlessPolicy")
.policyEngine(policyEngine)
.policyName("unless_suspended")
.statement(PolicyStatement.permit().forPrincipal("AgentCore::OAuthUser").onAllActions().onResource("AgentCore::Gateway", gateway.gatewayArn).unless().principalAttribute("suspended").equalTo(true).done())
.description("Allow all actions unless user is suspended")
.validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
.build();
PolicyEngine policyEngine;
Gateway gateway;
// Allow access unless the user is suspended
var policyWithUnless = new Policy(this, "UnlessPolicy", new PolicyProps {
PolicyEngine = policyEngine,
PolicyName = "unless_suspended",
Statement = PolicyStatement.Permit().ForPrincipal("AgentCore::OAuthUser").OnAllActions().OnResource("AgentCore::Gateway", gateway.GatewayArn).Unless().PrincipalAttribute("suspended").EqualTo(true).Done(),
Description = "Allow all actions unless user is suspended",
ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
var policyEngine PolicyEngine
var gateway Gateway
// Allow access unless the user is suspended
policyWithUnless := agentcore.NewPolicy(this, jsii.String("UnlessPolicy"), &PolicyProps{
PolicyEngine: policyEngine,
PolicyName: jsii.String("unless_suspended"),
Statement: agentcore.PolicyStatement_Permit().ForPrincipal(jsii.String("AgentCore::OAuthUser")).OnAllActions().OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn).Unless().PrincipalAttribute(jsii.String("suspended")).EqualTo(jsii.Boolean(true)).Done(),
Description: jsii.String("Allow all actions unless user is suspended"),
ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})
You can combine when and unless clauses in the same policy:
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;
// Allow engineers unless they are on probation
policyEngine.addPolicy("CombinedConditions", {
statement: agentcore.PolicyStatement.permit()
.forPrincipal('AgentCore::OAuthUser')
.onAllActions()
.onResource('AgentCore::Gateway', gateway.gatewayArn)
.when()
.principalAttribute('department').equalTo('Engineering')
.done()
.unless()
.principalAttribute('status').equalTo('probation')
.done(),
description: "Allow engineers unless on probation",
validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway
# Allow engineers unless they are on probation
policy_engine.add_policy("CombinedConditions",
statement=agentcore.PolicyStatement.permit().for_principal("AgentCore::OAuthUser").on_all_actions().on_resource("AgentCore::Gateway", gateway.gateway_arn).when().principal_attribute("department").equal_to("Engineering").done().unless().principal_attribute("status").equal_to("probation").done(),
description="Allow engineers unless on probation",
validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
PolicyEngine policyEngine;
Gateway gateway;
// Allow engineers unless they are on probation
policyEngine.addPolicy("CombinedConditions", AddPolicyOptions.builder()
.statement(PolicyStatement.permit().forPrincipal("AgentCore::OAuthUser").onAllActions().onResource("AgentCore::Gateway", gateway.gatewayArn).when().principalAttribute("department").equalTo("Engineering").done().unless().principalAttribute("status").equalTo("probation").done())
.description("Allow engineers unless on probation")
.validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
.build());
PolicyEngine policyEngine;
Gateway gateway;
// Allow engineers unless they are on probation
policyEngine.AddPolicy("CombinedConditions", new AddPolicyOptions {
Statement = PolicyStatement.Permit().ForPrincipal("AgentCore::OAuthUser").OnAllActions().OnResource("AgentCore::Gateway", gateway.GatewayArn).When().PrincipalAttribute("department").EqualTo("Engineering").Done().Unless().PrincipalAttribute("status").EqualTo("probation").Done(),
Description = "Allow engineers unless on probation",
ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
var policyEngine PolicyEngine
var gateway Gateway
// Allow engineers unless they are on probation
policyEngine.AddPolicy(jsii.String("CombinedConditions"), &AddPolicyOptions{
Statement: agentcore.PolicyStatement_Permit().ForPrincipal(jsii.String("AgentCore::OAuthUser")).OnAllActions().OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn).When().PrincipalAttribute(jsii.String("department")).EqualTo(jsii.String("Engineering")).Done().Unless().*PrincipalAttribute(jsii.String("status")).*EqualTo(jsii.String("probation")).*Done(),
Description: jsii.String("Allow engineers unless on probation"),
ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})
Forbid (Deny) Policy
Use forbid to explicitly deny access. Forbid policies override permit policies.
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;
// Explicitly deny dangerous tool operations
policyEngine.addPolicy("DenyDangerous", {
statement: agentcore.PolicyStatement.forbid()
.forAllPrincipals()
.onAction('AgentCore::Action::DeleteTool__delete_all')
.onResource('AgentCore::Gateway', gateway.gatewayArn),
description: "Forbid delete_all operation for all users",
validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});
// Generated Cedar:
// forbid(
// principal,
// action == AgentCore::Action::"DeleteTool__delete_all",
// resource == AgentCore::Gateway::"arn:..."
// );
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway
# Explicitly deny dangerous tool operations
policy_engine.add_policy("DenyDangerous",
statement=agentcore.PolicyStatement.forbid().for_all_principals().on_action("AgentCore::Action::DeleteTool__delete_all").on_resource("AgentCore::Gateway", gateway.gateway_arn),
description="Forbid delete_all operation for all users",
validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
PolicyEngine policyEngine;
Gateway gateway;
// Explicitly deny dangerous tool operations
policyEngine.addPolicy("DenyDangerous", AddPolicyOptions.builder()
.statement(PolicyStatement.forbid().forAllPrincipals().onAction("AgentCore::Action::DeleteTool__delete_all").onResource("AgentCore::Gateway", gateway.getGatewayArn()))
.description("Forbid delete_all operation for all users")
.validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
.build());
PolicyEngine policyEngine;
Gateway gateway;
// Explicitly deny dangerous tool operations
policyEngine.AddPolicy("DenyDangerous", new AddPolicyOptions {
Statement = PolicyStatement.Forbid().ForAllPrincipals().OnAction("AgentCore::Action::DeleteTool__delete_all").OnResource("AgentCore::Gateway", gateway.GatewayArn),
Description = "Forbid delete_all operation for all users",
ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
var policyEngine PolicyEngine
var gateway Gateway
// Explicitly deny dangerous tool operations
policyEngine.AddPolicy(jsii.String("DenyDangerous"), &AddPolicyOptions{
Statement: agentcore.PolicyStatement_Forbid().ForAllPrincipals().OnAction(jsii.String("AgentCore::Action::DeleteTool__delete_all")).OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn),
Description: jsii.String("Forbid delete_all operation for all users"),
ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})
Raw Cedar for Advanced Cases
For advanced Cedar features not supported by the builder, use raw Cedar strings:
declare const policyEngine: agentcore.PolicyEngine;
// Option 1: Using definition property
const advancedPolicy = new agentcore.Policy(this, "AdvancedPolicy", {
policyEngine: policyEngine,
definition: 'permit(principal, action, resource) when { context.custom > 10 };',
description: "Advanced policy with custom Cedar logic",
});
// Option 2: Using fromCedar() with statement property
policyEngine.addPolicy("CustomPolicy", {
statement: agentcore.PolicyStatement.fromCedar(
'forbid(principal, action, resource) when { resource.confidential == true };'
),
description: "Custom policy from Cedar string",
});
# policy_engine: agentcore.PolicyEngine
# Option 1: Using definition property
advanced_policy = agentcore.Policy(self, "AdvancedPolicy",
policy_engine=policy_engine,
definition="permit(principal, action, resource) when { context.custom > 10 };",
description="Advanced policy with custom Cedar logic"
)
# Option 2: Using fromCedar() with statement property
policy_engine.add_policy("CustomPolicy",
statement=agentcore.PolicyStatement.from_cedar("forbid(principal, action, resource) when { resource.confidential == true };"),
description="Custom policy from Cedar string"
)
PolicyEngine policyEngine;
// Option 1: Using definition property
Policy advancedPolicy = Policy.Builder.create(this, "AdvancedPolicy")
.policyEngine(policyEngine)
.definition("permit(principal, action, resource) when { context.custom > 10 };")
.description("Advanced policy with custom Cedar logic")
.build();
// Option 2: Using fromCedar() with statement property
policyEngine.addPolicy("CustomPolicy", AddPolicyOptions.builder()
.statement(PolicyStatement.fromCedar("forbid(principal, action, resource) when { resource.confidential == true };"))
.description("Custom policy from Cedar string")
.build());
PolicyEngine policyEngine;
// Option 1: Using definition property
var advancedPolicy = new Policy(this, "AdvancedPolicy", new PolicyProps {
PolicyEngine = policyEngine,
Definition = "permit(principal, action, resource) when { context.custom > 10 };",
Description = "Advanced policy with custom Cedar logic"
});
// Option 2: Using fromCedar() with statement property
policyEngine.AddPolicy("CustomPolicy", new AddPolicyOptions {
Statement = PolicyStatement.FromCedar("forbid(principal, action, resource) when { resource.confidential == true };"),
Description = "Custom policy from Cedar string"
});
var policyEngine PolicyEngine
// Option 1: Using definition property
advancedPolicy := agentcore.NewPolicy(this, jsii.String("AdvancedPolicy"), &PolicyProps{
PolicyEngine: policyEngine,
Definition: jsii.String("permit(principal, action, resource) when { context.custom > 10 };"),
Description: jsii.String("Advanced policy with custom Cedar logic"),
})
// Option 2: Using fromCedar() with statement property
policyEngine.AddPolicy(jsii.String("CustomPolicy"), &AddPolicyOptions{
Statement: agentcore.PolicyStatement_FromCedar(jsii.String("forbid(principal, action, resource) when { resource.confidential == true };")),
Description: jsii.String("Custom policy from Cedar string"),
})
Note: You must specify either definition (raw Cedar string) or statement (PolicyStatement builder), but not both.
Accessing Policies on PolicyEngine
You can access the list of policies added to a PolicyEngine using policyEngine.policies.
PolicyEngine with KMS Encryption
Encrypt policy data with a custom KMS key.
// Create a custom KMS key
const policyKey = new kms.Key(this, "PolicyEngineKey", {
enableKeyRotation: true,
description: "KMS key for policy engine encryption",
});
// Create policy engine with encryption
const policyEngine = new agentcore.PolicyEngine(this, "EncryptedEngine", {
policyEngineName: "encrypted_engine",
description: "Policy engine with KMS encryption",
kmsKey: policyKey,
});
# Create a custom KMS key
policy_key = kms.Key(self, "PolicyEngineKey",
enable_key_rotation=True,
description="KMS key for policy engine encryption"
)
# Create policy engine with encryption
policy_engine = agentcore.PolicyEngine(self, "EncryptedEngine",
policy_engine_name="encrypted_engine",
description="Policy engine with KMS encryption",
kms_key=policy_key
)
// Create a custom KMS key
Key policyKey = Key.Builder.create(this, "PolicyEngineKey")
.enableKeyRotation(true)
.description("KMS key for policy engine encryption")
.build();
// Create policy engine with encryption
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "EncryptedEngine")
.policyEngineName("encrypted_engine")
.description("Policy engine with KMS encryption")
.kmsKey(policyKey)
.build();
// Create a custom KMS key
var policyKey = new Key(this, "PolicyEngineKey", new KeyProps {
EnableKeyRotation = true,
Description = "KMS key for policy engine encryption"
});
// Create policy engine with encryption
var policyEngine = new PolicyEngine(this, "EncryptedEngine", new PolicyEngineProps {
PolicyEngineName = "encrypted_engine",
Description = "Policy engine with KMS encryption",
KmsKey = policyKey
});
// Create a custom KMS key
policyKey := kms.NewKey(this, jsii.String("PolicyEngineKey"), &KeyProps{
EnableKeyRotation: jsii.Boolean(true),
Description: jsii.String("KMS key for policy engine encryption"),
})
// Create policy engine with encryption
policyEngine := agentcore.NewPolicyEngine(this, jsii.String("EncryptedEngine"), &PolicyEngineProps{
PolicyEngineName: jsii.String("encrypted_engine"),
Description: jsii.String("Policy engine with KMS encryption"),
KmsKey: policyKey,
})
Importing Existing PolicyEngine
Import an existing policy engine from its ARN:
const importedEngine = agentcore.PolicyEngine.fromPolicyEngineAttributes(
this,
"ImportedEngine",
{
policyEngineArn: "policy-engine-arn",
kmsKeyArn: "kms-arn",
}
);
// Use the imported engine
const policy = new agentcore.Policy(this, "PolicyForImportedEngine", {
policyEngine: importedEngine,
definition: "permit(principal, action, resource);",
});
imported_engine = agentcore.PolicyEngine.from_policy_engine_attributes(self, "ImportedEngine",
policy_engine_arn="policy-engine-arn",
kms_key_arn="kms-arn"
)
# Use the imported engine
policy = agentcore.Policy(self, "PolicyForImportedEngine",
policy_engine=imported_engine,
definition="permit(principal, action, resource);"
)
IPolicyEngine importedEngine = PolicyEngine.fromPolicyEngineAttributes(this, "ImportedEngine", PolicyEngineAttributes.builder()
.policyEngineArn("policy-engine-arn")
.kmsKeyArn("kms-arn")
.build());
// Use the imported engine
Policy policy = Policy.Builder.create(this, "PolicyForImportedEngine")
.policyEngine(importedEngine)
.definition("permit(principal, action, resource);")
.build();
var importedEngine = PolicyEngine.FromPolicyEngineAttributes(this, "ImportedEngine", new PolicyEngineAttributes {
PolicyEngineArn = "policy-engine-arn",
KmsKeyArn = "kms-arn"
});
// Use the imported engine
var policy = new Policy(this, "PolicyForImportedEngine", new PolicyProps {
PolicyEngine = importedEngine,
Definition = "permit(principal, action, resource);"
});
importedEngine := agentcore.PolicyEngine_FromPolicyEngineAttributes(this, jsii.String("ImportedEngine"), &PolicyEngineAttributes{
PolicyEngineArn: jsii.String("policy-engine-arn"),
KmsKeyArn: jsii.String("kms-arn"),
})
// Use the imported engine
policy := agentcore.NewPolicy(this, jsii.String("PolicyForImportedEngine"), &PolicyProps{
PolicyEngine: importedEngine,
Definition: jsii.String("permit(principal, action, resource);"),
})
Importing Existing Policy
Import an existing policy from its ARN:
const importedEngine = agentcore.PolicyEngine.fromPolicyEngineAttributes(
this,
"ImportedEngine",
{
policyEngineArn: "policy-engine/my-engine-id",
}
);
const importedPolicy = agentcore.Policy.fromPolicyAttributes(
this,
"ImportedPolicy",
{
policyArn: "my-policy-arn",
policyEngine: importedEngine,
}
);
// Grant permissions to the imported policy
const role = new iam.Role(this, "PolicyRole", {
assumedBy: new iam.ServicePrincipal("lambda.amazonaws.com"),
});
importedPolicy.grantRead(role);
imported_engine = agentcore.PolicyEngine.from_policy_engine_attributes(self, "ImportedEngine",
policy_engine_arn="policy-engine/my-engine-id"
)
imported_policy = agentcore.Policy.from_policy_attributes(self, "ImportedPolicy",
policy_arn="my-policy-arn",
policy_engine=imported_engine
)
# Grant permissions to the imported policy
role = iam.Role(self, "PolicyRole",
assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")
)
imported_policy.grant_read(role)
IPolicyEngine importedEngine = PolicyEngine.fromPolicyEngineAttributes(this, "ImportedEngine", PolicyEngineAttributes.builder()
.policyEngineArn("policy-engine/my-engine-id")
.build());
IPolicy importedPolicy = Policy.fromPolicyAttributes(this, "ImportedPolicy", PolicyAttributes.builder()
.policyArn("my-policy-arn")
.policyEngine(importedEngine)
.build());
// Grant permissions to the imported policy
Role role = Role.Builder.create(this, "PolicyRole")
.assumedBy(new ServicePrincipal("lambda.amazonaws.com"))
.build();
importedPolicy.grantRead(role);
var importedEngine = PolicyEngine.FromPolicyEngineAttributes(this, "ImportedEngine", new PolicyEngineAttributes {
PolicyEngineArn = "policy-engine/my-engine-id"
});
var importedPolicy = Policy.FromPolicyAttributes(this, "ImportedPolicy", new PolicyAttributes {
PolicyArn = "my-policy-arn",
PolicyEngine = importedEngine
});
// Grant permissions to the imported policy
var role = new Role(this, "PolicyRole", new RoleProps {
AssumedBy = new ServicePrincipal("lambda.amazonaws.com")
});
importedPolicy.GrantRead(role);
importedEngine := agentcore.PolicyEngine_FromPolicyEngineAttributes(this, jsii.String("ImportedEngine"), &PolicyEngineAttributes{
PolicyEngineArn: jsii.String("policy-engine/my-engine-id"),
})
importedPolicy := agentcore.Policy_FromPolicyAttributes(this, jsii.String("ImportedPolicy"), &PolicyAttributes{
PolicyArn: jsii.String("my-policy-arn"),
PolicyEngine: importedEngine,
})
// Grant permissions to the imported policy
role := iam.NewRole(this, jsii.String("PolicyRole"), &RoleProps{
AssumedBy: iam.NewServicePrincipal(jsii.String("lambda.amazonaws.com")),
})
importedPolicy.GrantRead(role)
PolicyEngine IAM Permissions
Grant various levels of access to policy engines:
const policyEngine = new agentcore.PolicyEngine(this, "MyEngine", {
policyEngineName: "my_engine",
});
const lambdaRole = new iam.Role(this, "LambdaRole", {
assumedBy: new iam.ServicePrincipal("lambda.amazonaws.com"),
});
// Grant read permissions
policyEngine.grantRead(lambdaRole);
// Grant evaluation permissions
policyEngine.grantEvaluate(lambdaRole);
policy_engine = agentcore.PolicyEngine(self, "MyEngine",
policy_engine_name="my_engine"
)
lambda_role = iam.Role(self, "LambdaRole",
assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")
)
# Grant read permissions
policy_engine.grant_read(lambda_role)
# Grant evaluation permissions
policy_engine.grant_evaluate(lambda_role)
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "MyEngine")
.policyEngineName("my_engine")
.build();
Role lambdaRole = Role.Builder.create(this, "LambdaRole")
.assumedBy(new ServicePrincipal("lambda.amazonaws.com"))
.build();
// Grant read permissions
policyEngine.grantRead(lambdaRole);
// Grant evaluation permissions
policyEngine.grantEvaluate(lambdaRole);
var policyEngine = new PolicyEngine(this, "MyEngine", new PolicyEngineProps {
PolicyEngineName = "my_engine"
});
var lambdaRole = new Role(this, "LambdaRole", new RoleProps {
AssumedBy = new ServicePrincipal("lambda.amazonaws.com")
});
// Grant read permissions
policyEngine.GrantRead(lambdaRole);
// Grant evaluation permissions
policyEngine.GrantEvaluate(lambdaRole);
policyEngine := agentcore.NewPolicyEngine(this, jsii.String("MyEngine"), &PolicyEngineProps{
PolicyEngineName: jsii.String("my_engine"),
})
lambdaRole := iam.NewRole(this, jsii.String("LambdaRole"), &RoleProps{
AssumedBy: iam.NewServicePrincipal(jsii.String("lambda.amazonaws.com")),
})
// Grant read permissions
policyEngine.GrantRead(lambdaRole)
// Grant evaluation permissions
policyEngine.GrantEvaluate(lambdaRole)
Using Policy with Stable Gateway
Since Gateway is now in aws-cdk-lib/aws-bedrockagentcore but Policy remains in alpha, use the L1 escape hatch to associate a policy engine with a stable gateway:
Proper L2 integration will be added in a future update.
import * as agentcore from 'aws-cdk-lib/aws-bedrockagentcore';
import * as agentcoreAlpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
// Create policy engine (alpha)
const policyEngine = new agentcoreAlpha.PolicyEngine(this, 'Engine', {
policyEngineName: 'my_engine',
});
// Create gateway (stable)
const gateway = new agentcore.Gateway(this, 'Gateway', {
gatewayName: 'my-gateway',
});
// Wire policy engine to gateway via the L1 construct
const cfnGateway = gateway.node.defaultChild as agentcore.CfnGateway;
cfnGateway.policyEngineConfiguration = {
arn: policyEngine.policyEngineArn,
mode: agentcoreAlpha.PolicyEngineMode.ENFORCE.value,
};
// Grant evaluate permissions to the gateway role
gateway.role.addToPrincipalPolicy(new iam.PolicyStatement({
actions: ['bedrock-agentcore:GetPolicyEngine'],
resources: [policyEngine.policyEngineArn],
}));
gateway.role.addToPrincipalPolicy(new iam.PolicyStatement({
actions: ['bedrock-agentcore:AuthorizeAction', 'bedrock-agentcore:PartiallyAuthorizeActions'],
resources: [policyEngine.policyEngineArn, gateway.gatewayArn],
}));
import aws_cdk.aws_bedrockagentcore as agentcore
import aws_cdk.aws_bedrock_agentcore_alpha as agentcore_alpha
# Create policy engine (alpha)
policy_engine = agentcore_alpha.PolicyEngine(self, "Engine",
policy_engine_name="my_engine"
)
# Create gateway (stable)
gateway = agentcore.Gateway(self, "Gateway",
gateway_name="my-gateway"
)
# Wire policy engine to gateway via the L1 construct
cfn_gateway = gateway.node.default_child
cfn_gateway.policy_engine_configuration = agentcore.CfnGateway.GatewayPolicyEngineConfigurationProperty(
arn=policy_engine.policy_engine_arn,
mode=agentcore_alpha.PolicyEngineMode.ENFORCE.value
)
# Grant evaluate permissions to the gateway role
gateway.role.add_to_principal_policy(iam.PolicyStatement(
actions=["bedrock-agentcore:GetPolicyEngine"],
resources=[policy_engine.policy_engine_arn]
))
gateway.role.add_to_principal_policy(iam.PolicyStatement(
actions=["bedrock-agentcore:AuthorizeAction", "bedrock-agentcore:PartiallyAuthorizeActions"],
resources=[policy_engine.policy_engine_arn, gateway.gateway_arn]
))
import software.amazon.awscdk.services.bedrockagentcore.*;
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;
// Create policy engine (alpha)
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "Engine")
.policyEngineName("my_engine")
.build();
// Create gateway (stable)
Gateway gateway = Gateway.Builder.create(this, "Gateway")
.gatewayName("my-gateway")
.build();
// Wire policy engine to gateway via the L1 construct
CfnGateway cfnGateway = (CfnGateway)gateway.getNode().getDefaultChild();
cfnGateway.getPolicyEngineConfiguration() = GatewayPolicyEngineConfigurationProperty.builder()
.arn(policyEngine.getPolicyEngineArn())
.mode(PolicyEngineMode.ENFORCE.getValue())
.build();
// Grant evaluate permissions to the gateway role
gateway.role.addToPrincipalPolicy(PolicyStatement.Builder.create()
.actions(List.of("bedrock-agentcore:GetPolicyEngine"))
.resources(List.of(policyEngine.getPolicyEngineArn()))
.build());
gateway.role.addToPrincipalPolicy(PolicyStatement.Builder.create()
.actions(List.of("bedrock-agentcore:AuthorizeAction", "bedrock-agentcore:PartiallyAuthorizeActions"))
.resources(List.of(policyEngine.getPolicyEngineArn(), gateway.getGatewayArn()))
.build());
using Amazon.CDK.AWS.BedrockAgentCore;
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;
// Create policy engine (alpha)
var policyEngine = new PolicyEngine(this, "Engine", new PolicyEngineProps {
PolicyEngineName = "my_engine"
});
// Create gateway (stable)
var gateway = new Gateway(this, "Gateway", new GatewayProps {
GatewayName = "my-gateway"
});
// Wire policy engine to gateway via the L1 construct
var cfnGateway = (CfnGateway)gateway.Node.DefaultChild;
cfnGateway.PolicyEngineConfiguration = new GatewayPolicyEngineConfigurationProperty {
Arn = policyEngine.PolicyEngineArn,
Mode = PolicyEngineMode.ENFORCE.Value
};
// Grant evaluate permissions to the gateway role
gateway.Role.AddToPrincipalPolicy(new PolicyStatement(new PolicyStatementProps {
Actions = new [] { "bedrock-agentcore:GetPolicyEngine" },
Resources = new [] { policyEngine.PolicyEngineArn }
}));
gateway.Role.AddToPrincipalPolicy(new PolicyStatement(new PolicyStatementProps {
Actions = new [] { "bedrock-agentcore:AuthorizeAction", "bedrock-agentcore:PartiallyAuthorizeActions" },
Resources = new [] { policyEngine.PolicyEngineArn, gateway.GatewayArn }
}));
import agentcore "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"
// Create policy engine (alpha)
policyEngine := agentcoreAlpha.NewPolicyEngine(this, jsii.String("Engine"), &PolicyEngineProps{
PolicyEngineName: jsii.String("my_engine"),
})
// Create gateway (stable)
gateway := agentcore.NewGateway(this, jsii.String("Gateway"), &GatewayProps{
GatewayName: jsii.String("my-gateway"),
})
// Wire policy engine to gateway via the L1 construct
cfnGateway := gateway.Node.defaultChild.(CfnGateway)
cfnGateway.policyEngineConfiguration = &GatewayPolicyEngineConfigurationProperty{
Arn: policyEngine.PolicyEngineArn,
Mode: agentcoreAlpha.PolicyEngineMode_ENFORCE().Value,
}
// Grant evaluate permissions to the gateway role
gateway.Role.AddToPrincipalPolicy(iam.NewPolicyStatement(&PolicyStatementProps{
Actions: []*string{
jsii.String("bedrock-agentcore:GetPolicyEngine"),
},
Resources: []*string{
policyEngine.*PolicyEngineArn,
},
}))
gateway.Role.AddToPrincipalPolicy(iam.NewPolicyStatement(&PolicyStatementProps{
Actions: []*string{
jsii.String("bedrock-agentcore:AuthorizeAction"),
jsii.String("bedrock-agentcore:PartiallyAuthorizeActions"),
},
Resources: []*string{
policyEngine.*PolicyEngineArn,
gateway.GatewayArn,
},
}))
Types
| Name | Kind | Summary |
|---|---|---|
ApiKeyCredentialProvider | Construct (L2) | L2 construct for AWS::BedrockAgentCore::ApiKeyCredentialProvider. |
BrowserCustom | Construct (L2) | Browser resource for AWS Bedrock Agent Core. |
BrowserCustomBase | Construct (L2) | Abstract base class for a Browser. |
CodeInterpreterCustom | Construct (L2) | Custom code interpreter resource for AWS Bedrock Agent Core. |
CodeInterpreterCustomBase | Construct (L2) | Abstract base class for a Code Interpreter. |
Evaluator | Construct (L2) | A custom evaluator for Amazon Bedrock AgentCore. |
EvaluatorBase | Construct (L2) | Abstract base class for Evaluator. |
Gateway | Construct (L2) | Gateway resource for AWS Bedrock Agent Core. |
GatewayBase | Construct (L2) | Base class for Gateway constructs. |
GatewayTarget | Construct (L2) | Defines tools that your gateway will host. |
GatewayTargetBase | Construct (L2) | Base class for gateway target implementations. |
Memory | Construct (L2) | Long-term memory store for extracted insights like user preferences, semantic facts and summaries. |
MemoryBase | Construct (L2) | Abstract base class for a Memory. |
OAuth2CredentialProvider | Construct (L2) | L2 construct for AWS::BedrockAgentCore::OAuth2CredentialProvider. |
OnlineEvaluationBase | Construct (L2) | Abstract base class for OnlineEvaluationConfig. |
OnlineEvaluationConfig | Construct (L2) | Online evaluation configuration for Amazon Bedrock AgentCore. |
Policy | Construct (L2) | Individual Cedar policy defining what agents can access. |
PolicyBase | Construct (L2) | Abstract base class for a Policy. |
PolicyEngine | Construct (L2) | Container that manages Cedar authorization policies associated with gateways. |
PolicyEngineBase | Construct (L2) | Abstract base class for a PolicyEngine. |
Runtime | Construct (L2) | Bedrock Agent Core Runtime Enables running containerized agents with specific network configurations, security settings, and runtime artifacts. |
RuntimeBase | Construct (L2) | Base class for Agent Runtime. |
RuntimeEndpoint | Construct (L2) | Bedrock Agent Core Runtime Endpoint Provides a stable endpoint for invoking agent runtimes with versioning support. |
RuntimeEndpointBase | Construct (L2) | Base class for Runtime Endpoint. |
WorkloadIdentity | Construct (L2) | L2 construct for AWS::BedrockAgentCore::WorkloadIdentity. |
AddApiGatewayTargetOptions | Struct | Options for adding an API Gateway target to a gateway. |
AddEndpointOptions | Struct | Options for adding an endpoint to the runtime. |
AddLambdaTargetOptions | Struct | Options for adding a Lambda target to a gateway. |
AddMcpServerTargetOptions | Struct | Options for adding an MCP Server target to a gateway. |
AddOpenApiTargetOptions | Struct | Options for adding an OpenAPI target to a gateway. |
AddPolicyOptions | Struct | Options for adding a policy via PolicyEngine.addPolicy(). |
AddSmithyTargetOptions | Struct | Options for adding a Smithy target to a gateway. |
AgentCoreRuntime | Enum | Bedrock AgentCore runtime environment for code execution Allowed values: PYTHON_3_10 | PYTHON_3_11 | PYTHON_3_12 | PYTHON_3_13 | PYTHON_3_14 | NODE_22. |
AgentRuntimeArtifact | Class | Abstract base class for agent runtime artifacts. |
AgentRuntimeAttributes | Struct | Attributes for importing an existing Agent Runtime. |
ApiGatewayHttpMethod | Enum | HTTP methods supported by API Gateway. |
ApiGatewayTargetConfiguration | Class | Configuration for API Gateway-based MCP targets. |
ApiGatewayTargetConfigurationProps | Struct | Properties for creating an API Gateway target configuration. |
ApiGatewayToolConfiguration | Struct | Configuration for API Gateway tools. |
ApiGatewayToolFilter | Struct | Configuration for filtering API Gateway tools. |
ApiGatewayToolOverride | Struct | Configuration for overriding API Gateway tool metadata. |
ApiKeyAdditionalConfiguration | Struct | API Key additional configuration. |
ApiKeyCredentialLocation | Class | API Key location within the request. |
ApiKeyCredentialProviderAttributes | Struct | Attributes for importing an existing API key credential provider. |
ApiKeyCredentialProviderIdentityPerms | Class | IAM actions for AgentCore API key credential providers (Token Vault). |
ApiKeyCredentialProviderProps | Struct | API key credential provider ARNs for gateway outbound auth (Token Vault identity). |
ApiKeyCredentialProviderResourceProps | Struct | Properties for a new {@link ApiKeyCredentialProvider} (Token Vault resource). |
ApiSchema | Class | Represents the concept of an API Schema for a Gateway Target. |
AssetApiSchema | Class | API Schema from a local asset. |
AssetToolSchema | Class | Tool Schema from a local asset. |
AtlassianOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingAtlassian}. |
AttributeAccessor | Class | Accessor for building type-safe attribute comparisons. |
BrowserCustomAttributes | Struct | Attributes for specifying an imported Browser Custom. |
BrowserCustomProps | Struct | Properties for creating a Browser resource. |
BrowserNetworkConfiguration | Class | Network configuration for the Browser tool. |
BrowserSigning | Enum | Browser signing. |
BuiltinEvaluator | Class | Built-in evaluators provided by Amazon Bedrock AgentCore. |
CategoricalRatingOption | Struct | A categorical rating scale option for custom evaluators. |
CloudWatchLogsDataSourceConfig | Struct | Configuration for CloudWatch Logs data source. |
CodeAssetOptions | Struct | Options for configuring an S3 code asset from local files for agent runtime artifact. |
CodeBasedOptions | Struct | Options for configuring a code-based custom evaluator using a Lambda function. |
CodeInterpreterCustomAttributes | Struct | Attributes for specifying an imported Code Interpreter Custom. |
CodeInterpreterCustomProps | Struct | Properties for creating a CodeInterpreter resource. |
CodeInterpreterNetworkConfiguration | Class | Network configuration for the Code Interpreter tool. |
CognitoAuthorizerProps | Struct | Properties for configuring a Cognito authorizer. |
ConditionalAttributeAccessor | Class | Accessor for building type-safe attribute comparisons within conditional statements. |
ConditionalPolicyStatement | Class | Wrapper class for conditionally building policy statements. |
ConditionBuilder | Class | Builder for condition expressions in Cedar policies. |
CredentialProviderType | Enum | Credential provider types supported by gateway target. |
CustomClaimOperator | Enum | Custom claim match operator. |
CustomJwtAuthorizer | Class | Custom JWT authorizer configuration implementation. |
CustomJwtConfiguration | Struct | Custom JWT authorizer configuration. |
CustomOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingCustom}. |
DataSourceConfig | Class | Configuration for the data source used in online evaluation. |
DataSourceConfigBindResult | Struct | The result of binding a DataSourceConfig. |
DropboxOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingDropbox}. |
EpisodicReflectionConfiguration | Struct | Configuration for episodic memory reflection. |
EvaluationLevel | Class | The level at which a custom evaluator assesses agent performance. |
EvaluatorAttributes | Struct | Attributes for importing an existing Evaluator. |
EvaluatorConfig | Class | Configuration for a custom evaluator. |
EvaluatorInferenceConfig | Struct | Inference configuration for a custom LLM-as-a-Judge evaluator. |
EvaluatorProps | Struct | Properties for creating an Evaluator. |
EvaluatorRatingScale | Class | Represents a rating scale for custom LLM-as-a-Judge evaluators. |
EvaluatorReference | Class | Represents a reference to an evaluator for online evaluation. |
EvaluatorReferenceBindResult | Struct | The result of binding an EvaluatorReference. |
ExecutionStatus | Class | The execution status of an online evaluation configuration. |
FacebookOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingFacebook}. |
FilterConfig | Struct | Filter configuration for online evaluation. |
FilterOperator | Class | Filter operators for online evaluation filtering. |
FilterValue | Class | A typed filter value for online evaluation filtering. |
FromApiKeyIdentityOptions | Struct | Optional gateway settings when binding an {@link IApiKeyCredentialProvider} to a target. |
FromOauthIdentityOptions | Struct | OAuth scopes (and optional custom parameters) when binding an {@link IOAuth2CredentialProvider} to a gateway target. |
GatewayApiKeyIdentityBinding | Struct | Provider and secret ARNs for wiring a Token Vault API key identity into a gateway target. |
GatewayAttributes | Struct | Attributes for importing an existing Gateway. |
GatewayAuthorizer | Class | Factory class for creating Gateway Authorizers. |
GatewayAuthorizerType | Enum | Gateway authorizer type. |
GatewayCredentialProvider | Class | Factory class for creating different Gateway Credential Providers. |
GatewayCustomClaim | Class | Represents a custom claim validation configuration for Gateway JWT authorizers. |
GatewayExceptionLevel | Enum | Exception levels for gateway. |
GatewayOAuth2IdentityBinding | Struct | Provider ARN, secret ARN, and OAuth scopes for wiring a Token Vault OAuth2 identity into a gateway target. |
GatewayPolicyEngineConfig | Struct | Configuration for associating a policy engine with a gateway. |
GatewayProps | Struct | Properties for defining a Gateway. |
GatewayProtocol | Class | Factory class for instantiating Gateway Protocols. |
GatewayTargetApiGatewayProps | Struct | Properties for creating an API Gateway-based Gateway Target. |
GatewayTargetAttributes | Struct | Attributes for importing an existing Gateway Target. |
GatewayTargetCommonProps | Struct | Common properties for all Gateway Target types. |
GatewayTargetLambdaProps | Struct | Properties for creating a Lambda-based Gateway Target Convenience interface for the most common use case. |
GatewayTargetMcpServerProps | Struct | Properties for creating an MCP Server-based Gateway Target. |
GatewayTargetOpenApiProps | Struct | Properties for creating an OpenAPI-based Gateway Target. |
GatewayTargetProps | Struct | Properties for creating a Gateway Target resource. |
GatewayTargetProtocolType | Enum | Protocol types supported by gateway targets. |
GatewayTargetSmithyProps | Struct | Properties for creating a Smithy-based Gateway Target. |
GithubOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingGithub}. |
GoogleOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingGoogle}. |
HubspotOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingHubspot}. |
IamAuthorizer | Class | AWS IAM authorizer configuration implementation. |
IApiKeyCredentialProvider | Interface | An API key credential provider registered in AgentCore Token Vault. |
IBedrockAgentRuntime | Interface | Interface for Agent Runtime resources. |
IBrowserCustom | Interface | Interface for Browser resources. |
ICodeInterpreterCustom | Interface | Interface for CodeInterpreterCustom resources. |
ICredentialProviderConfig | Interface | Abstract interface for gateway credential provider configuration. |
IEvaluator | Interface | Interface for Evaluator resources. |
IGateway | Interface | Interface for Gateway resources. |
IGatewayAuthorizerConfig | Interface | Abstract interface for gateway authorizer configuration. |
IGatewayProtocolConfig | Interface | Abstract interface for gateway protocol configuration. |
IGatewayTarget | Interface | Interface for GatewayTarget resources. |
IInterceptor | Interface | Represents an interceptor that can be bound to a Gateway. |
IMcpGatewayTarget | Interface | Interface for MCP gateway targets. |
IMemory | Interface | Interface for Memory resources. |
IMemoryStrategy | Interface | Interface for Memory strategies. |
IncludedOauth2TenantCredentialProviderProps | Struct | Props for IncludedOauth2ProviderConfig IdPs whose outbound documentation requires issuer, authorizationEndpoint, and/or tokenEndpoint (for example Okta, Auth0, Amazon Cognito, OneLogin, PingOne, CyberArk, FusionAuth). |
IncludedOauth2TenantEndpoints | Struct | Optional tenant OAuth endpoints for IdPs that use CloudFormation IncludedOauth2ProviderConfig with issuer and/or endpoints per the IdP’s outbound documentation. |
InlineApiSchema | Class | Class to define an API Schema from an inline string. |
InlineToolSchema | Class | Class to define a Tool Schema from an inline string. |
InterceptionPoint | Enum | The interception point where the interceptor will be invoked. |
InterceptorBindConfig | Struct | Configuration returned from binding an interceptor to a Gateway. |
InterceptorOptions | Struct | Options for configuring an interceptor. |
InvocationConfiguration | Struct | Invocation configuration for self managed memory strategy. |
IOAuth2CredentialProvider | Interface | An OAuth2 credential provider registered in AgentCore Token Vault. |
IOnlineEvaluationConfig | Interface | Interface for OnlineEvaluationConfig resources. |
IPolicy | Interface | Minimal reference interface for Policy resources. |
IPolicyEngine | Interface | Contains all properties and methods for both created and imported policy engines. |
IRuntimeEndpoint | Interface | Interface for Runtime Endpoint resources. |
ITargetConfiguration | Interface | Base interface for target configurations. |
IWorkloadIdentity | Interface | A workload identity for Amazon Bedrock AgentCore. |
LambdaInterceptor | Class | A Lambda-based interceptor for Gateway. |
LambdaTargetConfiguration | Class | Configuration for Lambda-based MCP targets. |
LifecycleConfiguration | Struct | LifecycleConfiguration lets you manage the lifecycle of runtime sessions and resources in AgentCore Runtime. |
LinkedinOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingLinkedin}. |
LlmAsAJudgeOptions | Struct | Options for configuring an LLM-as-a-Judge custom evaluator. |
LoggingConfig | Struct | Configuration for logging with log type and destination. |
LoggingDestination | Class | Represents a logging destination for AgentCore Runtime. |
LogType | Class | Log types for AgentCore Runtime observability. |
ManagedMemoryStrategy | Class | Managed memory strategy that handles both built-in and override configurations. |
ManagedStrategyProps | Struct | Configuration parameters for a memory strategy that can override existing built-in default prompts/models. |
McpConfiguration | Struct | MCP protocol configuration The configuration for the Model Context Protocol (MCP). |
McpGatewaySearchType | Enum | Search types supported by MCP gateway. |
McpProtocolConfiguration | Class | MCP (Model Context Protocol) configuration implementation. |
MCPProtocolVersion | Enum | MCP protocol versions. |
McpServerTargetConfiguration | Class | Configuration for MCP Server-based targets. |
McpTargetConfiguration | Class | Abstract base class for MCP target configurations Provides common functionality for all MCP target types. |
McpTargetType | Enum | MCP target types. |
MemoryAttributes | Struct | Attributes for specifying an imported Memory. |
MemoryProps | Struct | Properties for creating a Memory resource. |
MemoryStrategy | Class | Factory class for creating memory strategies If you need long-term memory for context recall across sessions, you can setup memory extraction strategies to extract the relevant memory from the raw events. |
MemoryStrategyCommonProps | Struct | Configuration parameters common for any memory strategy. |
MemoryStrategyType | Enum | Long-term memory extraction strategy types. |
MetadataConfiguration | Struct | Configuration for passing metadata (headers and query parameters) to the API Gateway target. |
MicrosoftOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingMicrosoft}. |
NetworkConfiguration | Class | Abstract base class for network configuration. |
NoAuthAuthorizer | Class | No authorization configuration implementation. |
NotionOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingNotion}. |
NumericalRatingOption | Struct | A numerical rating scale option for custom evaluators. |
OAuth2AuthorizationServerMetadata | Struct | Static OAuth2 authorization server metadata for custom credential providers. |
OAuth2ClientCredentials | Struct | OAuth2 client identifier and secret registered with the identity provider (all vendors). |
OAuth2CredentialProviderAttributes | Struct | Attributes for importing an existing OAuth2 credential provider. |
OAuth2CredentialProviderBaseProps | Struct | Shared properties for OAuth2 credential providers created via {@link OAuth2CredentialProvider} factory methods. |
OAuth2CredentialProviderFactoryBaseProps | Struct | Naming, tags, and client credentials shared by every {@link OAuth2CredentialProvider} factory. |
OAuth2CredentialProviderIdentityPerms | Class | IAM actions for AgentCore OAuth2 credential providers (Token Vault). |
OAuth2CredentialProviderProps | Struct | Low-level properties when you need full control (prefer {@link OAuth2CredentialProvider.usingSlack} and other factories). |
OAuth2CredentialProviderVendor | Enum | Built-in OAuth2 vendors supported by AWS::BedrockAgentCore::OAuth2CredentialProvider. |
OAuthConfiguration | Struct | OAuth configuration. |
OnlineEvaluationBaseProps | Struct | Base properties for creating an OnlineEvaluationConfig. |
OnlineEvaluationConfigAttributes | Struct | Attributes for importing an existing OnlineEvaluationConfig. |
OnlineEvaluationConfigProps | Struct | Properties for creating an OnlineEvaluationConfig. |
OpenApiTargetConfiguration | Class | Configuration for OpenAPI-based MCP targets. |
OverrideConfig | Struct | Configuration for overriding model and prompt template. |
PolicyAttributes | Struct | Attributes for importing an existing Policy. |
PolicyEngineAttributes | Struct | Attributes for importing an existing PolicyEngine. |
PolicyEngineMode | Class | The enforcement mode for a policy engine associated with a gateway. |
PolicyEngineProps | Struct | Properties for creating a PolicyEngine resource. |
PolicyProps | Struct | Properties for creating a Policy resource. |
PolicyStatement | Class | Type-safe builder for creating Cedar authorization policy statements. |
PolicyValidationMode | Class | Validation mode for Cedar policy definitions. |
ProtocolType | Enum | Protocol configuration for Agent Runtime. |
RecordingConfig | Struct | Recording configuration for browser. |
RedditOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingReddit}. |
RequestHeaderConfiguration | Struct | Configuration for HTTP request headers that will be passed through to the runtime. |
RuntimeAuthorizerConfiguration | Class | Abstract base class for runtime authorizer configurations. |
RuntimeCustomClaim | Class | Represents a custom claim validation configuration for Runtime JWT authorizers. |
RuntimeEndpointAttributes | Struct | Attributes for importing an existing Runtime Endpoint. |
RuntimeEndpointProps | Struct | Properties for creating a Bedrock Agent Core Runtime Endpoint resource. |
RuntimeNetworkConfiguration | Class | Network configuration for the Runtime. |
RuntimeProps | Struct | Properties for creating a Bedrock Agent Core Runtime resource. |
S3ApiSchema | Class | Class to define an API Schema from an S3 object. |
S3ToolSchema | Class | Class to define a Tool Schema from an S3 object. |
SalesforceOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingSalesforce}. |
SchemaDefinition | Struct | Schema definition for tool input/output. |
SchemaDefinitionType | Enum | Schema definition types. |
SelfManagedMemoryStrategy | Class | Use AgentCore memory for event storage with custom triggers. |
SelfManagedStrategyProps | Struct | Configuration parameters for a self managed memory strategy existing built-in default prompts/models. |
SlackOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingSlack}. |
SmithyTargetConfiguration | Class | Configuration for Smithy-based MCP targets. |
SpotifyOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingSpotify}. |
TargetConfigurationConfig | Struct | Configuration returned by binding a target configuration. |
ToolDefinition | Struct | Tool definition for inline payload. |
ToolSchema | Class | Defines the schema for tools available to a gateway target. |
TriggerConditions | Struct | Trigger conditions for self managed memory strategy When first condition is met, batched payloads are sent to specified S3 bucket. |
TwitchOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingTwitch}. |
VpcConfigProps | Struct | VPC configuration properties. |
WorkloadIdentityAttributes | Struct | Attributes for importing an existing workload identity. |
WorkloadIdentityPerms | Class | IAM actions for AgentCore workload identities. |
WorkloadIdentityProps | Struct | Properties for a new {@link WorkloadIdentity}. |
XOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingX}. |
YandexOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingYandex}. |
ZoomOAuth2CredentialProviderProps | Struct | Props for {@link OAuth2CredentialProvider.usingZoom}. |
TypeScript