Commit 34b43aa
authored
feat(bedrock-agentcore-alpha): add observability configuration for Runtime (#36689)
### Issue # (if applicable)
Closes #36596
### Reason for this change
Add observability support (logging and tracing) for Amazon Bedrock AgentCore Runtime. This enables users to:
- Send X-Ray traces for agent runtime invocations
- Deliver application logs and usage logs to CloudWatch Logs, S3, or Kinesis Data Firehose
This is essential for monitoring, debugging, and auditing AgentCore Runtime workloads in production environments.
### Description of changes
Added observability configuration options to `Runtime` construct:
**New Properties:**
- `tracingEnabled`: Enable X-Ray tracing delivery for the runtime
- `loggingConfigs`: Array of logging configurations specifying log type and destination
**New Classes:**
- `LoggingDestination`: Abstract class with factory methods for creating log destinations
- `LoggingDestination.cloudWatchLogs(logGroup)` - Send logs to CloudWatch Logs
- `LoggingDestination.s3(bucket)` - Send logs to S3
- `LoggingDestination.firehose(stream)` - Send logs to Kinesis Data Firehose
**New Enums:**
- `LogType`: `APPLICATION_LOGS` and `USAGE_LOGS`
### Describe any new or updated permissions being added
The following IAM permissions are automatically configured:
| Destination | Permissions | Principal |
|-------------|-------------|-----------|
| CloudWatch Logs | `logs:CreateLogStream`, `logs:PutLogEvents` | `delivery.logs.amazonaws.com` |
| S3 | `s3:PutObject` | `delivery.logs.amazonaws.com` |
| X-Ray | `xray:PutTraceSegments` | `delivery.logs.amazonaws.com` |
| Firehose | Uses service-linked role via `LogDeliveryEnabled` tag | N/A |
All policies include conditions restricting access by `aws:SourceAccount` and `aws:SourceArn`.
### Description of how you validated changes
Add unit tests and integ tests.
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*1 parent 95696b4 commit 34b43aa
19 files changed
Lines changed: 3447 additions & 1 deletion
File tree
- packages/@aws-cdk/aws-bedrock-agentcore-alpha
- lib
- runtime
- rosetta
- test/agentcore/runtime
- integ.runtime-observability.js.snapshot
- asset.44e9c4d7a5d3fd2d677e1a7e416b2b56f6b0104bd5eff9cac5557b4c65a9dc61
- asset.f06c9f54828243752afd2df4e39ab9d2987b5ccf44e6bdc05621c18d5488f240
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
811 | 857 | | |
812 | 858 | | |
813 | 859 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
0 commit comments