Skip to content

Commit 2531f10

Browse files
chore: update analytics metadata blueprints
1 parent ec28b68 commit 2531f10

File tree

6 files changed

+373
-18
lines changed

6 files changed

+373
-18
lines changed

packages/@aws-cdk/aws-bedrock-alpha/bedrock/agents/agent-alias.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { ArnFormat, aws_bedrock as bedrock, IResource, Resource, Stack } from 'aws-cdk-lib';
22
import * as events from 'aws-cdk-lib/aws-events';
33
import * as iam from 'aws-cdk-lib/aws-iam';
4+
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';
5+
import { propertyInjectable } from 'aws-cdk-lib/core/lib/prop-injectable';
46
import { Construct } from 'constructs';
57
import { IAgent } from './agent';
68

@@ -186,7 +188,10 @@ export interface AgentAliasAttributes {
186188
* Class to create an Agent Alias with CDK.
187189
* @cloudformationResource AWS::Bedrock::AgentAlias
188190
*/
191+
@propertyInjectable
189192
export class AgentAlias extends AgentAliasBase {
193+
/** Uniquely identifies this class. */
194+
public static readonly PROPERTY_INJECTION_ID: string = '@aws-cdk.aws-bedrock-alpha.AgentAlias';
190195
// ------------------------------------------------------
191196
// Imports
192197
// ------------------------------------------------------
@@ -229,6 +234,8 @@ export class AgentAlias extends AgentAliasBase {
229234
// ------------------------------------------------------
230235
constructor(scope: Construct, id: string, props: AgentAliasProps) {
231236
super(scope, id);
237+
// Enhanced CDK Analytics Telemetry
238+
addConstructMetadata(this, props);
232239

233240
// ------------------------------------------------------
234241
// Set properties or defaults

packages/@aws-cdk/aws-bedrock-alpha/bedrock/agents/agent.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import * as events from 'aws-cdk-lib/aws-events';
66
import * as iam from 'aws-cdk-lib/aws-iam';
77
import * as kms from 'aws-cdk-lib/aws-kms';
88
import * as s3 from 'aws-cdk-lib/aws-s3';
9+
import { addConstructMetadata, MethodMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';
10+
import { propertyInjectable } from 'aws-cdk-lib/core/lib/prop-injectable';
911
import { Construct, IConstruct } from 'constructs';
1012
// Internal Libs
1113
import { AgentActionGroup } from './action-group';
@@ -333,7 +335,11 @@ export interface AgentAttributes {
333335
* Class to create (or import) an Agent with CDK.
334336
* @cloudformationResource AWS::Bedrock::Agent
335337
*/
338+
@propertyInjectable
336339
export class Agent extends AgentBase implements IAgent {
340+
/** Uniquely identifies this class. */
341+
public static readonly PROPERTY_INJECTION_ID: string = '@aws-cdk.aws-bedrock-alpha.Agent';
342+
337343
/**
338344
* Static Method for importing an existing Bedrock Agent.
339345
*/
@@ -429,6 +435,8 @@ export class Agent extends AgentBase implements IAgent {
429435
// ------------------------------------------------------
430436
constructor(scope: Construct, id: string, props: AgentProps) {
431437
super(scope, id);
438+
// Enhanced CDK Analytics Telemetry
439+
addConstructMetadata(this, props);
432440

433441
// ------------------------------------------------------
434442
// Validate props
@@ -580,6 +588,7 @@ export class Agent extends AgentBase implements IAgent {
580588
* - Lambda function invoke permissions if executor is present
581589
* - S3 GetObject permissions if apiSchema.s3File is present
582590
*/
591+
@MethodMetadata()
583592
public addActionGroup(actionGroup: AgentActionGroup) {
584593
validation.throwIfInvalid(this.validateActionGroup, actionGroup);
585594
this.actionGroups.push(actionGroup);
@@ -640,6 +649,7 @@ export class Agent extends AgentBase implements IAgent {
640649
*
641650
* @default - No collaboration configuration.
642651
*/
652+
@MethodMetadata()
643653
public addActionGroups(...actionGroups: AgentActionGroup[]) {
644654
actionGroups.forEach(ag => this.addActionGroup(ag));
645655
}

0 commit comments

Comments
 (0)