aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.7k stars 3.93k forks source link

(bedrock): Missing Bedrock Invocation Logging #31478

Open isunli opened 2 months ago

isunli commented 2 months ago

Describe the feature

What to make sure if this settings will be added to the CDK Constructs: https://docs.aws.amazon.com/bedrock/latest/userguide/model-invocation-logging.html

Use Case

Enable bedrock logging to S3 from CDK

Proposed Solution

Have a construct to setup loggings

Other Information

No response

Acknowledgements

CDK version used

2.156.0

Environment details (OS name and version, etc.)

amazon linux 2

pahud commented 2 months ago

Proposed Solution Have a construct to setup loggings

Hi @isunli can you share more about your proposed implementation including some sample API so we would know more about it?

isunli commented 2 months ago

Yes, I am looking for this API: PutModelInvocationLoggingConfiguration, I want to create this configuration with may infrastructure code.

pahud commented 2 months ago

@isunli

Can you elaborate a little bit on:

  1. What L1 or L2 resource are you planing to contribute? Is it an existing or new construct in aws-cdk-lib?
  2. What would be the user experience look like with this support?

Thanks.

isunli commented 2 months ago

Hi,

What L1 or L2 resource are you planing to contribute? Is it an existing or new construct in aws-cdk-lib?

I searched around and I don't think there is a CFN resource provided by Bedrock team so it can only be achieved by a custom resource.

What would be the user experience look like with this support?

For customer experience, what I am looking for is something similar to CfnStorageLens, a construct that can put settings on the account level, but it is for Bedrock instead of S3. For example

new bedrock.ModelInvocationLoggingConfiguration(..., {
  s3: {},
  cloudwatch: {},
  ...
})

Please let me know if this make sense.