@aws/agentcore-cdk 0.1.0-alpha.35 → 0.1.0-alpha.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdk/constructs/components/mcp/Gateway.d.ts +11 -0
- package/dist/cdk/constructs/components/mcp/Gateway.d.ts.map +1 -1
- package/dist/cdk/constructs/components/mcp/Gateway.js +377 -4
- package/dist/cdk/constructs/components/mcp/Gateway.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/connector-defaults.d.ts +20 -0
- package/dist/cdk/constructs/components/mcp/connector-defaults.d.ts.map +1 -0
- package/dist/cdk/constructs/components/mcp/connector-defaults.js +16 -0
- package/dist/cdk/constructs/components/mcp/connector-defaults.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts +36 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js +65 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts +3 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js +68 -22
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts +64 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js +91 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts +25 -6
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js +133 -11
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts +47 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js +388 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/index.d.ts +1 -0
- package/dist/cdk/constructs/components/primitives/harness/index.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/harness/index.js +3 -1
- package/dist/cdk/constructs/components/primitives/harness/index.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/index.d.ts +4 -1
- package/dist/cdk/constructs/components/primitives/index.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/index.js +9 -1
- package/dist/cdk/constructs/components/primitives/index.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts +69 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js +292 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts +28 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js +44 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts +38 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js +111 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/index.d.ts +3 -0
- package/dist/cdk/constructs/components/primitives/payment/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/index.js +8 -0
- package/dist/cdk/constructs/components/primitives/payment/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js +20 -5
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js.map +1 -1
- package/dist/cdk/constructs/index.d.ts +2 -2
- package/dist/cdk/constructs/index.d.ts.map +1 -1
- package/dist/cdk/constructs/index.js +6 -1
- package/dist/cdk/constructs/index.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts +74 -4
- package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreApplication.js +264 -2
- package/dist/cdk/constructs/l3/AgentCoreApplication.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts +24 -0
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js +27 -3
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.js +25 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentEnvironment.d.ts +6 -0
- package/dist/cdk/constructs/l3/AgentEnvironment.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentEnvironment.js +7 -0
- package/dist/cdk/constructs/l3/AgentEnvironment.js.map +1 -1
- package/dist/cdk/constructs/l3/index.d.ts +1 -1
- package/dist/cdk/constructs/l3/index.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/index.js.map +1 -1
- package/dist/cdk/feature-flags.d.ts +15 -0
- package/dist/cdk/feature-flags.d.ts.map +1 -0
- package/dist/cdk/feature-flags.js +19 -0
- package/dist/cdk/feature-flags.js.map +1 -0
- package/dist/cdk/index.d.ts +1 -1
- package/dist/cdk/index.d.ts.map +1 -1
- package/dist/cdk/index.js +7 -1
- package/dist/cdk/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/schema/schemas/agent-env.d.ts +35 -0
- package/dist/schema/schemas/agent-env.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.d.ts +233 -4
- package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.js +125 -6
- package/dist/schema/schemas/agentcore-project.js.map +1 -1
- package/dist/schema/schemas/auth.d.ts +171 -0
- package/dist/schema/schemas/auth.d.ts.map +1 -1
- package/dist/schema/schemas/auth.js +125 -3
- package/dist/schema/schemas/auth.js.map +1 -1
- package/dist/schema/schemas/mcp.d.ts +254 -0
- package/dist/schema/schemas/mcp.d.ts.map +1 -1
- package/dist/schema/schemas/mcp.js +452 -4
- package/dist/schema/schemas/mcp.js.map +1 -1
- package/dist/schema/schemas/primitives/harness.d.ts +369 -19
- package/dist/schema/schemas/primitives/harness.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/harness.js +390 -21
- package/dist/schema/schemas/primitives/harness.js.map +1 -1
- package/dist/schema/schemas/primitives/index.d.ts +5 -1
- package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/index.js +31 -1
- package/dist/schema/schemas/primitives/index.js.map +1 -1
- package/dist/schema/schemas/primitives/knowledge-base.d.ts +103 -0
- package/dist/schema/schemas/primitives/knowledge-base.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/knowledge-base.js +98 -0
- package/dist/schema/schemas/primitives/knowledge-base.js.map +1 -0
- package/dist/schema/schemas/primitives/memory.d.ts +2 -2
- package/dist/schema/schemas/primitives/online-evaluation-config.d.ts +19 -2
- package/dist/schema/schemas/primitives/online-evaluation-config.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/online-evaluation-config.js +39 -5
- package/dist/schema/schemas/primitives/online-evaluation-config.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONNECTOR_DEFAULTS = void 0;
|
|
4
|
+
exports.CONNECTOR_DEFAULTS = {
|
|
5
|
+
'bedrock-knowledge-bases': {
|
|
6
|
+
operation: 'Retrieve',
|
|
7
|
+
enabled: ['Retrieve'],
|
|
8
|
+
label: 'Knowledge Base',
|
|
9
|
+
},
|
|
10
|
+
'bedrock-agentic-retrieve': {
|
|
11
|
+
operation: 'AgenticRetrieveStream',
|
|
12
|
+
enabled: ['AgenticRetrieveStream'],
|
|
13
|
+
label: 'Agentic Retrieve',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=connector-defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector-defaults.js","sourceRoot":"","sources":["../../../../../src/cdk/constructs/components/mcp/connector-defaults.ts"],"names":[],"mappings":";;;AAoBa,QAAA,kBAAkB,GAA2C;IACxE,yBAAyB,EAAE;QACzB,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,CAAC,UAAU,CAAC;QACrB,KAAK,EAAE,gBAAgB;KACxB;IACD,0BAA0B,EAAE;QAC1B,SAAS,EAAE,uBAAuB;QAClC,OAAO,EAAE,CAAC,uBAAuB,CAAC;QAClC,KAAK,EAAE,kBAAkB;KAC1B;CACF,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ConfigBundle } from '../../../../../schema';
|
|
2
|
+
import type { AgentCoreComponentProps } from '../../base-props';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
export interface AgentCoreConfigBundleProps extends AgentCoreComponentProps {
|
|
5
|
+
configBundle: ConfigBundle;
|
|
6
|
+
/**
|
|
7
|
+
* Resolved component map: keys are actual ARNs (or CDK token refs),
|
|
8
|
+
* values are the configuration objects. If not provided, falls back
|
|
9
|
+
* to configBundle.components (which may contain placeholder keys).
|
|
10
|
+
*/
|
|
11
|
+
resolvedComponents?: Record<string, {
|
|
12
|
+
configuration: Record<string, unknown>;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* AgentCore ConfigurationBundle construct.
|
|
17
|
+
*
|
|
18
|
+
* Creates an `AWS::BedrockAgentCore::ConfigurationBundle` resource.
|
|
19
|
+
*
|
|
20
|
+
* Uses a raw CfnResource because no L1 CfnConfigurationBundle exists in aws-cdk-lib yet.
|
|
21
|
+
*
|
|
22
|
+
* Key property notes:
|
|
23
|
+
* - BundleName is createOnly (immutable after creation).
|
|
24
|
+
* - Components is mutable (updates create a new version).
|
|
25
|
+
* - BranchName is createOnly.
|
|
26
|
+
* - Ref resolves to BundleArn (per CloudFormation resource spec).
|
|
27
|
+
* - BundleId and VersionId are available via getAtt.
|
|
28
|
+
*/
|
|
29
|
+
export declare class AgentCoreConfigBundle extends Construct {
|
|
30
|
+
readonly bundleArn: string;
|
|
31
|
+
readonly bundleId: string;
|
|
32
|
+
readonly versionId: string;
|
|
33
|
+
readonly bundleName: string;
|
|
34
|
+
constructor(scope: Construct, id: string, props: AgentCoreConfigBundleProps);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=AgentCoreConfigBundle.d.ts.map
|
package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentCoreConfigBundle.d.ts","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,0BAA2B,SAAQ,uBAAuB;IACzE,YAAY,EAAE,YAAY,CAAC;IAC3B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CACjF;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,qBAAsB,SAAQ,SAAS;IAClD,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,UAAU,EAAE,MAAM,CAAC;gBAEvB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,0BAA0B;CA2C5E"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentCoreConfigBundle = void 0;
|
|
4
|
+
const tags_1 = require("../../../../utils/tags");
|
|
5
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
6
|
+
const constructs_1 = require("constructs");
|
|
7
|
+
/**
|
|
8
|
+
* AgentCore ConfigurationBundle construct.
|
|
9
|
+
*
|
|
10
|
+
* Creates an `AWS::BedrockAgentCore::ConfigurationBundle` resource.
|
|
11
|
+
*
|
|
12
|
+
* Uses a raw CfnResource because no L1 CfnConfigurationBundle exists in aws-cdk-lib yet.
|
|
13
|
+
*
|
|
14
|
+
* Key property notes:
|
|
15
|
+
* - BundleName is createOnly (immutable after creation).
|
|
16
|
+
* - Components is mutable (updates create a new version).
|
|
17
|
+
* - BranchName is createOnly.
|
|
18
|
+
* - Ref resolves to BundleArn (per CloudFormation resource spec).
|
|
19
|
+
* - BundleId and VersionId are available via getAtt.
|
|
20
|
+
*/
|
|
21
|
+
class AgentCoreConfigBundle extends constructs_1.Construct {
|
|
22
|
+
bundleArn;
|
|
23
|
+
bundleId;
|
|
24
|
+
versionId;
|
|
25
|
+
bundleName;
|
|
26
|
+
constructor(scope, id, props) {
|
|
27
|
+
super(scope, id);
|
|
28
|
+
const { configBundle, projectName, resolvedComponents } = props;
|
|
29
|
+
this.bundleName = `${projectName}${configBundle.name}`;
|
|
30
|
+
const components = resolvedComponents ?? configBundle.components;
|
|
31
|
+
// Convert components to CFN format: keys are ARNs, values have PascalCase Configuration.
|
|
32
|
+
// A component key may be a CDK token (e.g. a runtime ARN resolved from a `{{runtime:name}}`
|
|
33
|
+
// placeholder via Fn::GetAtt). CloudFormation forbids unresolved tokens as map *keys*, so we
|
|
34
|
+
// wrap the whole map in CfnJson — a custom resource that resolves the tokens at deploy time and
|
|
35
|
+
// emits a concrete JSON object, letting token-derived ARNs be used as keys.
|
|
36
|
+
const cfnComponents = {};
|
|
37
|
+
for (const [key, value] of Object.entries(components)) {
|
|
38
|
+
cfnComponents[key] = { Configuration: value.configuration };
|
|
39
|
+
}
|
|
40
|
+
const componentsValue = new aws_cdk_lib_1.CfnJson(this, 'Components', { value: cfnComponents });
|
|
41
|
+
const mergedTags = (0, tags_1.recordToCfnTags)((0, tags_1.composeTags)(props.projectTags));
|
|
42
|
+
const cfnBundle = new aws_cdk_lib_1.CfnResource(this, 'Resource', {
|
|
43
|
+
type: 'AWS::BedrockAgentCore::ConfigurationBundle',
|
|
44
|
+
properties: {
|
|
45
|
+
BundleName: this.bundleName,
|
|
46
|
+
Components: componentsValue,
|
|
47
|
+
// On a Components change the service creates a new bundle version and parents it to the
|
|
48
|
+
// prior version itself: the CFN resource type does not accept a ParentVersionIds property
|
|
49
|
+
// (additionalProperties:false; lineage surfaces only via the read-only LineageMetadata).
|
|
50
|
+
// The Uluru handler supplies parentVersionIds from the resource's tracked VersionId via a
|
|
51
|
+
// lock token on UpdateConfigurationBundle, so the template must not set it.
|
|
52
|
+
...(configBundle.description && { Description: configBundle.description }),
|
|
53
|
+
...(configBundle.branchName && { BranchName: configBundle.branchName }),
|
|
54
|
+
...(configBundle.commitMessage && { CommitMessage: configBundle.commitMessage }),
|
|
55
|
+
CreatedBy: { Name: 'user' },
|
|
56
|
+
...(mergedTags && { Tags: mergedTags.map(t => ({ Key: t.key, Value: t.value })) }),
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
this.bundleArn = cfnBundle.ref;
|
|
60
|
+
this.bundleId = cfnBundle.getAtt('BundleId').toString();
|
|
61
|
+
this.versionId = cfnBundle.getAtt('VersionId').toString();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.AgentCoreConfigBundle = AgentCoreConfigBundle;
|
|
65
|
+
//# sourceMappingURL=AgentCoreConfigBundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentCoreConfigBundle.js","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.ts"],"names":[],"mappings":";;;AACA,iDAAsE;AAEtE,6CAAmD;AACnD,2CAAuC;A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GAAG,CAAC,YAAY,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,YAAY,CAAC,WAAW,EAAE,CAAC;gBAC1E,GAAG,CAAC,YAAY,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,UAAU,EAAE,CAAC;gBACvE,GAAG,CAAC,YAAY,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,YAAY,CAAC,aAAa,EAAE,CAAC;gBAChF,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBAC3B,GAAG,CAAC,UAAU,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;aACnF;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;QACxD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5D,CAAC;CACF;AAjDD,sDAiDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/config-bundle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentCoreConfigBundle = void 0;
|
|
4
|
+
var AgentCoreConfigBundle_1 = require("./AgentCoreConfigBundle");
|
|
5
|
+
Object.defineProperty(exports, "AgentCoreConfigBundle", { enumerable: true, get: function () { return AgentCoreConfigBundle_1.AgentCoreConfigBundle; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/config-bundle/index.ts"],"names":[],"mappings":";;;AAAA,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA"}
|
package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentCoreOnlineEvaluationConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,oCAAqC,SAAQ,uBAAuB;IACnF,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IACxC,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACrD,oGAAoG;IACpG,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,qBAAa,+BAAgC,SAAQ,SAAS;IAC5D,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,UAAU,EAAE,MAAM,CAAC;gBAEvB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,oCAAoC;
|
|
1
|
+
{"version":3,"file":"AgentCoreOnlineEvaluationConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,oCAAqC,SAAQ,uBAAuB;IACnF,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IACxC,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACrD,oGAAoG;IACpG,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,qBAAa,+BAAgC,SAAQ,SAAS;IAC5D,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,UAAU,EAAE,MAAM,CAAC;gBAEvB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,oCAAoC;CAgPtF"}
|
package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js
CHANGED
|
@@ -32,15 +32,17 @@ class AgentCoreOnlineEvaluationConfig extends constructs_1.Construct {
|
|
|
32
32
|
});
|
|
33
33
|
const stack = aws_cdk_lib_1.Stack.of(this);
|
|
34
34
|
const partition = stack.partition;
|
|
35
|
-
// Resolve the
|
|
36
|
-
const agentEnv = environments.get(config.agent);
|
|
37
|
-
if (!agentEnv) {
|
|
35
|
+
// Resolve the agent environment (only required when config.agent is set)
|
|
36
|
+
const agentEnv = config.agent ? environments.get(config.agent) : undefined;
|
|
37
|
+
if (config.agent && !agentEnv) {
|
|
38
38
|
throw new Error(`Online evaluation config "${config.name}" references unknown agent "${config.agent}"`);
|
|
39
39
|
}
|
|
40
|
-
// CloudWatch Logs read — scoped to the monitored agent's runtime log group
|
|
41
|
-
const logGroupArns =
|
|
42
|
-
`arn:${partition}:logs:${stack.region}:${stack.account}:log-group
|
|
43
|
-
|
|
40
|
+
// CloudWatch Logs read — scoped to the monitored agent's runtime log group or custom log groups
|
|
41
|
+
const logGroupArns = config.logGroupNames
|
|
42
|
+
? config.logGroupNames.map(lgName => `arn:${partition}:logs:${stack.region}:${stack.account}:log-group:${lgName}*`)
|
|
43
|
+
: [
|
|
44
|
+
`arn:${partition}:logs:${stack.region}:${stack.account}:log-group:/aws/bedrock-agentcore/runtimes/${agentEnv.runtime.runtimeId}*`,
|
|
45
|
+
];
|
|
44
46
|
// DescribeLogGroups requires * (AWS limitation, same as runtime role)
|
|
45
47
|
role.addToPolicy(new aws_cdk_lib_1.aws_iam.PolicyStatement({
|
|
46
48
|
actions: ['logs:DescribeLogGroups'],
|
|
@@ -101,11 +103,23 @@ class AgentCoreOnlineEvaluationConfig extends constructs_1.Construct {
|
|
|
101
103
|
actions: ['lambda:GetFunction', 'lambda:InvokeFunction'],
|
|
102
104
|
resources: [`arn:${stack.partition}:lambda:${stack.region}:${stack.account}:function:*`],
|
|
103
105
|
}));
|
|
106
|
+
// AgentCore evaluation control/data plane — online eval reads its own config and
|
|
107
|
+
// launches batch evaluations on its behalf (required for insights/clustering).
|
|
108
|
+
role.addToPolicy(new aws_cdk_lib_1.aws_iam.PolicyStatement({
|
|
109
|
+
actions: ['bedrock-agentcore:GetOnlineEvaluationConfig'],
|
|
110
|
+
resources: [
|
|
111
|
+
`arn:${partition}:bedrock-agentcore:${stack.region}:${stack.account}:online-evaluation-config/${this.configName}-*`,
|
|
112
|
+
],
|
|
113
|
+
}));
|
|
114
|
+
role.addToPolicy(new aws_cdk_lib_1.aws_iam.PolicyStatement({
|
|
115
|
+
actions: ['bedrock-agentcore:StartBatchEvaluation'],
|
|
116
|
+
resources: [`arn:${partition}:bedrock-agentcore:${stack.region}:${stack.account}:batch-evaluate/*`],
|
|
117
|
+
}));
|
|
104
118
|
// ═══════════════════════════════════════════════════════════════════
|
|
105
119
|
// Resolve evaluator references
|
|
106
120
|
// ═══════════════════════════════════════════════════════════════════
|
|
107
121
|
const ARN_PREFIX = 'arn:';
|
|
108
|
-
const evaluatorRefs = config.evaluators.map((evalName) => {
|
|
122
|
+
const evaluatorRefs = (config.evaluators ?? []).map((evalName) => {
|
|
109
123
|
if (evalName.startsWith(constants_1.BUILTIN_EVALUATOR_PREFIX)) {
|
|
110
124
|
return { evaluatorId: evalName };
|
|
111
125
|
}
|
|
@@ -123,12 +137,30 @@ class AgentCoreOnlineEvaluationConfig extends constructs_1.Construct {
|
|
|
123
137
|
return { evaluatorId: evaluator.evaluatorId };
|
|
124
138
|
});
|
|
125
139
|
// ═══════════════════════════════════════════════════════════════════
|
|
126
|
-
//
|
|
140
|
+
// Resolve insight references
|
|
141
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
142
|
+
const insightRefs = config.insights?.map((insightId) => ({ InsightId: insightId }));
|
|
143
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
144
|
+
// Resolve clustering config
|
|
145
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
146
|
+
const clusteringCfn = config.clusteringConfig ? { Frequencies: config.clusteringConfig.frequencies } : undefined;
|
|
147
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
148
|
+
// Data source config — agent's CloudWatch log group or custom log groups.
|
|
127
149
|
// CFN limits ServiceNames to 1 entry per online eval config.
|
|
128
150
|
// ═══════════════════════════════════════════════════════════════════
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
151
|
+
let logGroupNames;
|
|
152
|
+
let serviceNames;
|
|
153
|
+
if (config.logGroupNames) {
|
|
154
|
+
// Custom/3rd-party agent — use directly specified log groups and service names
|
|
155
|
+
logGroupNames = config.logGroupNames;
|
|
156
|
+
serviceNames = config.serviceNames ?? [];
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
// Managed AgentCore agent — auto-derive from runtime/endpoint
|
|
160
|
+
const endpointName = config.endpoint ?? 'DEFAULT';
|
|
161
|
+
logGroupNames = [`/aws/bedrock-agentcore/runtimes/${agentEnv.runtime.runtimeId}-${endpointName}`];
|
|
162
|
+
serviceNames = [`${projectName}_${config.agent}.${endpointName}`];
|
|
163
|
+
}
|
|
132
164
|
// ═══════════════════════════════════════════════════════════════════
|
|
133
165
|
// Create CfnOnlineEvaluationConfig
|
|
134
166
|
// ═══════════════════════════════════════════════════════════════════
|
|
@@ -136,7 +168,7 @@ class AgentCoreOnlineEvaluationConfig extends constructs_1.Construct {
|
|
|
136
168
|
const cfnConfig = new aws_bedrockagentcore_1.CfnOnlineEvaluationConfig(this, 'Resource', {
|
|
137
169
|
onlineEvaluationConfigName: this.configName,
|
|
138
170
|
evaluationExecutionRoleArn: role.roleArn,
|
|
139
|
-
evaluators: evaluatorRefs,
|
|
171
|
+
evaluators: evaluatorRefs.length > 0 ? evaluatorRefs : [],
|
|
140
172
|
executionStatus: config.enableOnCreate !== false ? 'ENABLED' : 'DISABLED',
|
|
141
173
|
...(config.description && { description: config.description }),
|
|
142
174
|
...(mergedTags && { tags: mergedTags }),
|
|
@@ -155,17 +187,31 @@ class AgentCoreOnlineEvaluationConfig extends constructs_1.Construct {
|
|
|
155
187
|
},
|
|
156
188
|
},
|
|
157
189
|
});
|
|
190
|
+
// The privately-registered CFN resource supports insights and clusteringConfig, but the
|
|
191
|
+
// public CDK L1 types do not yet include these fields. Use property overrides to pass them.
|
|
192
|
+
if (evaluatorRefs.length === 0) {
|
|
193
|
+
cfnConfig.addPropertyDeletionOverride('Evaluators');
|
|
194
|
+
}
|
|
195
|
+
if (insightRefs?.length) {
|
|
196
|
+
cfnConfig.addPropertyOverride('Insights', insightRefs);
|
|
197
|
+
}
|
|
198
|
+
if (clusteringCfn) {
|
|
199
|
+
cfnConfig.addPropertyOverride('ClusteringConfig', clusteringCfn);
|
|
200
|
+
}
|
|
158
201
|
// Ensure role policies are attached before the config is created
|
|
159
202
|
cfnConfig.node.addDependency(role);
|
|
160
|
-
//
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (
|
|
168
|
-
|
|
203
|
+
// Dependencies on managed runtime/endpoint — only when monitoring an AgentCore agent
|
|
204
|
+
if (agentEnv) {
|
|
205
|
+
// Ensure the runtime exists before the config — the service validates that the
|
|
206
|
+
// referenced log group exists, and the log group is created by the runtime.
|
|
207
|
+
cfnConfig.node.addDependency(agentEnv.runtime);
|
|
208
|
+
// If scoped to an endpoint, depend on the endpoint too — its log group is
|
|
209
|
+
// created when the endpoint is provisioned, not when the runtime starts.
|
|
210
|
+
if (config.endpoint) {
|
|
211
|
+
const endpointConstruct = agentEnv.endpoints.get(config.endpoint);
|
|
212
|
+
if (endpointConstruct) {
|
|
213
|
+
cfnConfig.node.addDependency(endpointConstruct);
|
|
214
|
+
}
|
|
169
215
|
}
|
|
170
216
|
}
|
|
171
217
|
this.configId = cfnConfig.attrOnlineEvaluationConfigId;
|
package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentCoreOnlineEvaluationConfig.js","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.ts"],"names":[],"mappings":";;;AACA,qDAA8F;AAC9F,iDAAsE;AAItE,6CAAoD;AACpD,2EAA6E;AAC7E,2CAAuC;AAUvC;;;;;;;;GAQG;AACH,MAAa,+BAAgC,SAAQ,sBAAS;IAC5C,QAAQ,CAAS;IACjB,SAAS,CAAS;IAClB,UAAU,CAAS;IAEnC,YAAY,KAAgB,EAAE,EAAU,EAAE,KAA2C;QACnF,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAEjB,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;QAChE,IAAI,CAAC,UAAU,GAAG,GAAG,WAAW,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAElD,sEAAsE;QACtE,qBAAqB;QACrB,sEAAsE;QACtE,MAAM,IAAI,GAAG,IAAI,qBAAG,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE;YAC/C,SAAS,EAAE,IAAI,qBAAG,CAAC,gBAAgB,CAAC,uCAA2B,CAAC;YAChE,WAAW,EAAE,wCAAwC,MAAM,CAAC,IAAI,EAAE;SACnE,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,mBAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QAElC,
|
|
1
|
+
{"version":3,"file":"AgentCoreOnlineEvaluationConfig.js","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.ts"],"names":[],"mappings":";;;AACA,qDAA8F;AAC9F,iDAAsE;AAItE,6CAAoD;AACpD,2EAA6E;AAC7E,2CAAuC;AAUvC;;;;;;;;GAQG;AACH,MAAa,+BAAgC,SAAQ,sBAAS;IAC5C,QAAQ,CAAS;IACjB,SAAS,CAAS;IAClB,UAAU,CAAS;IAEnC,YAAY,KAAgB,EAAE,EAAU,EAAE,KAA2C;QACnF,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAEjB,MAAM,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AiB,EAAE,CAAC;oBACtB,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;gBAClD,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,4BAA4B,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,6BAA6B,CAAC;IAC3D,CAAC;CACF;AArPD,0EAqPC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { HarnessSpec } from '../../../../../schema';
|
|
2
|
+
import type { AgentCoreComponentProps } from '../../base-props';
|
|
3
|
+
import { aws_iam as iam } from 'aws-cdk-lib';
|
|
4
|
+
import { Construct } from 'constructs';
|
|
5
|
+
export interface AgentCoreHarnessProps extends AgentCoreComponentProps {
|
|
6
|
+
/** The full harness configuration (already validated against HarnessSpecSchema). */
|
|
7
|
+
readonly harness: HarnessSpec;
|
|
8
|
+
/** Directory containing this harness's harness.json — used to resolve a system-prompt file path at synth. */
|
|
9
|
+
readonly harnessDir: string;
|
|
10
|
+
/** Execution role ARN the harness assumes (CFN-required). */
|
|
11
|
+
readonly executionRoleArn: string;
|
|
12
|
+
/** The execution role construct, when created in-stack, so the resource depends on its policies. */
|
|
13
|
+
readonly executionRole?: iam.IRole;
|
|
14
|
+
/** Resolved container image URI (from spec.containerUri or a dockerfile build). */
|
|
15
|
+
readonly containerUri?: string;
|
|
16
|
+
/** Resolved memory ARN (intra-stack token or literal) when the harness references memory. */
|
|
17
|
+
readonly memoryArn?: string;
|
|
18
|
+
/** Retrieval config (per-namespace TopK/RelevanceScore) derived from the referenced memory. */
|
|
19
|
+
readonly retrievalConfig?: Record<string, {
|
|
20
|
+
TopK?: number;
|
|
21
|
+
RelevanceScore?: number;
|
|
22
|
+
}>;
|
|
23
|
+
/** Credential deployed state for resolving skill git auth credential names. */
|
|
24
|
+
readonly credentials?: Record<string, {
|
|
25
|
+
credentialProviderArn: string;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* AgentCore Harness component construct.
|
|
30
|
+
*
|
|
31
|
+
* Creates an `AWS::BedrockAgentCore::Harness` resource from a HarnessSpec.
|
|
32
|
+
*
|
|
33
|
+
* Uses a raw CfnResource because no L1 CfnHarness exists in aws-cdk-lib that
|
|
34
|
+
* matches the (private) resource's property surface yet — following the
|
|
35
|
+
* Dataset / PaymentManager escape-hatch precedent.
|
|
36
|
+
*
|
|
37
|
+
* Key property notes:
|
|
38
|
+
* - HarnessName is createOnly; the physical name is `${projectName}_${name}` and
|
|
39
|
+
* must be ≤40 chars (CFN cap) — validated here before synth.
|
|
40
|
+
* - Environment.AgentCoreRuntimeEnvironment.NetworkConfiguration is createOnly.
|
|
41
|
+
* - Ref resolves to the harness Arn; HarnessId/Status/AgentRuntimeArn via getAtt. Version is also a
|
|
42
|
+
* getAtt attribute but only read when gated features are enabled (it's absent on the older type).
|
|
43
|
+
*/
|
|
44
|
+
export declare class AgentCoreHarness extends Construct {
|
|
45
|
+
/** The ARN of the harness (CloudFormation Ref). */
|
|
46
|
+
readonly harnessArn: string;
|
|
47
|
+
/** The unique identifier of the harness. */
|
|
48
|
+
readonly harnessId: string;
|
|
49
|
+
/** The current status of the harness. */
|
|
50
|
+
readonly status: string;
|
|
51
|
+
/**
|
|
52
|
+
* The read-only harness config version (service-incremented on every successful update).
|
|
53
|
+
* Only populated when gated features are enabled — the `Version` attribute does not exist on the
|
|
54
|
+
* pre-NY-Summit `AWS::BedrockAgentCore::Harness` resource type, so reading it via getAtt against an
|
|
55
|
+
* un-updated region/account fails the whole deploy. Undefined when gated off.
|
|
56
|
+
*/
|
|
57
|
+
readonly harnessVersion?: string;
|
|
58
|
+
/** The ARN of the underlying managed AgentCore Runtime. */
|
|
59
|
+
readonly agentRuntimeArn: string;
|
|
60
|
+
/** The physical harness name as deployed to AWS. */
|
|
61
|
+
readonly harnessName: string;
|
|
62
|
+
constructor(scope: Construct, id: string, props: AgentCoreHarnessProps);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=AgentCoreHarness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentCoreHarness.d.ts","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/harness/AgentCoreHarness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAe,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAKvC,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,6GAA6G;IAC7G,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,oGAAoG;IACpG,QAAQ,CAAC,aAAa,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC;IACnC,mFAAmF;IACnF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,6FAA6F;IAC7F,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,+FAA+F;IAC/F,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtF,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,qBAAqB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1E;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;IAC7C,mDAAmD;IACnD,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,4CAA4C;IAC5C,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,yCAAyC;IACzC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,SAAgB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxC,2DAA2D;IAC3D,SAAgB,eAAe,EAAE,MAAM,CAAC;IACxC,oDAAoD;IACpD,SAAgB,WAAW,EAAE,MAAM,CAAC;gBAExB,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB;CA6DvE"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentCoreHarness = void 0;
|
|
4
|
+
const feature_flags_1 = require("../../../../feature-flags");
|
|
5
|
+
const harness_cfn_mapping_1 = require("./harness-cfn-mapping");
|
|
6
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
7
|
+
const constructs_1 = require("constructs");
|
|
8
|
+
/** CFN HarnessName max length (`^[a-zA-Z][a-zA-Z0-9_]{0,39}$`). */
|
|
9
|
+
const MAX_HARNESS_NAME_LENGTH = 40;
|
|
10
|
+
/**
|
|
11
|
+
* AgentCore Harness component construct.
|
|
12
|
+
*
|
|
13
|
+
* Creates an `AWS::BedrockAgentCore::Harness` resource from a HarnessSpec.
|
|
14
|
+
*
|
|
15
|
+
* Uses a raw CfnResource because no L1 CfnHarness exists in aws-cdk-lib that
|
|
16
|
+
* matches the (private) resource's property surface yet — following the
|
|
17
|
+
* Dataset / PaymentManager escape-hatch precedent.
|
|
18
|
+
*
|
|
19
|
+
* Key property notes:
|
|
20
|
+
* - HarnessName is createOnly; the physical name is `${projectName}_${name}` and
|
|
21
|
+
* must be ≤40 chars (CFN cap) — validated here before synth.
|
|
22
|
+
* - Environment.AgentCoreRuntimeEnvironment.NetworkConfiguration is createOnly.
|
|
23
|
+
* - Ref resolves to the harness Arn; HarnessId/Status/AgentRuntimeArn via getAtt. Version is also a
|
|
24
|
+
* getAtt attribute but only read when gated features are enabled (it's absent on the older type).
|
|
25
|
+
*/
|
|
26
|
+
class AgentCoreHarness extends constructs_1.Construct {
|
|
27
|
+
/** The ARN of the harness (CloudFormation Ref). */
|
|
28
|
+
harnessArn;
|
|
29
|
+
/** The unique identifier of the harness. */
|
|
30
|
+
harnessId;
|
|
31
|
+
/** The current status of the harness. */
|
|
32
|
+
status;
|
|
33
|
+
/**
|
|
34
|
+
* The read-only harness config version (service-incremented on every successful update).
|
|
35
|
+
* Only populated when gated features are enabled — the `Version` attribute does not exist on the
|
|
36
|
+
* pre-NY-Summit `AWS::BedrockAgentCore::Harness` resource type, so reading it via getAtt against an
|
|
37
|
+
* un-updated region/account fails the whole deploy. Undefined when gated off.
|
|
38
|
+
*/
|
|
39
|
+
harnessVersion;
|
|
40
|
+
/** The ARN of the underlying managed AgentCore Runtime. */
|
|
41
|
+
agentRuntimeArn;
|
|
42
|
+
/** The physical harness name as deployed to AWS. */
|
|
43
|
+
harnessName;
|
|
44
|
+
constructor(scope, id, props) {
|
|
45
|
+
super(scope, id);
|
|
46
|
+
const { harness, projectName, executionRoleArn, harnessDir, containerUri, memoryArn, retrievalConfig, credentials, } = props;
|
|
47
|
+
this.harnessName = `${projectName}_${harness.name}`;
|
|
48
|
+
if (this.harnessName.length > MAX_HARNESS_NAME_LENGTH) {
|
|
49
|
+
throw new Error(`Harness name "${this.harnessName}" is ${this.harnessName.length} characters; the maximum is ${MAX_HARNESS_NAME_LENGTH} ` +
|
|
50
|
+
`(CloudFormation HarnessName limit). The physical name is "\${projectName}_\${harnessName}" — shorten the project name or the harness name "${harness.name}".`);
|
|
51
|
+
}
|
|
52
|
+
const cfnHarness = new aws_cdk_lib_1.CfnResource(this, 'Resource', {
|
|
53
|
+
type: 'AWS::BedrockAgentCore::Harness',
|
|
54
|
+
properties: (0, harness_cfn_mapping_1.mapHarnessSpecToCfnProperties)({
|
|
55
|
+
harness,
|
|
56
|
+
harnessName: this.harnessName,
|
|
57
|
+
executionRoleArn,
|
|
58
|
+
harnessDir,
|
|
59
|
+
containerUri,
|
|
60
|
+
memoryArn,
|
|
61
|
+
retrievalConfig,
|
|
62
|
+
projectTags: props.projectTags,
|
|
63
|
+
credentials,
|
|
64
|
+
}),
|
|
65
|
+
});
|
|
66
|
+
// Ensure the execution role AND its inline policies are attached before CreateHarness
|
|
67
|
+
// validates the role. addDependency(role) only covers the CfnRole — it does NOT walk to the
|
|
68
|
+
// sibling AWS::IAM::Policy (DefaultPolicy) that the role's addToPolicy calls create lazily, so
|
|
69
|
+
// without an explicit dep on DefaultPolicy the harness can be created before the policy
|
|
70
|
+
// attaches → flaky AccessDenied. Mirrors AgentCoreKnowledgeBase's role+DefaultPolicy deps.
|
|
71
|
+
if (props.executionRole instanceof aws_cdk_lib_1.aws_iam.Role) {
|
|
72
|
+
cfnHarness.node.addDependency(props.executionRole);
|
|
73
|
+
const inlinePolicy = props.executionRole.node.tryFindChild('DefaultPolicy');
|
|
74
|
+
if (inlinePolicy) {
|
|
75
|
+
cfnHarness.node.addDependency(inlinePolicy);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
this.harnessArn = cfnHarness.ref;
|
|
79
|
+
this.harnessId = cfnHarness.getAtt('HarnessId').toString();
|
|
80
|
+
this.status = cfnHarness.getAtt('Status').toString();
|
|
81
|
+
// Version is a NY-Summit read-only attribute absent from the older resource type. getAtt('Version')
|
|
82
|
+
// synthesizes Fn::GetAtt, which fails template validation against a pre-Summit registered type, so
|
|
83
|
+
// only read it when gated features are enabled (mirrors the CLI's ENABLE_GATED_FEATURES gate).
|
|
84
|
+
if ((0, feature_flags_1.isGatedFeaturesEnabled)()) {
|
|
85
|
+
this.harnessVersion = cfnHarness.getAtt('Version').toString();
|
|
86
|
+
}
|
|
87
|
+
this.agentRuntimeArn = cfnHarness.getAtt('Environment.AgentCoreRuntimeEnvironment.AgentRuntimeArn').toString();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.AgentCoreHarness = AgentCoreHarness;
|
|
91
|
+
//# sourceMappingURL=AgentCoreHarness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentCoreHarness.js","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/harness/AgentCoreHarness.ts"],"names":[],"mappings":";;;AACA,6DAAmE;AAEnE,+DAAsE;AACtE,6CAA0D;AAC1D,2CAAuC;AAEvC,mEAAmE;AACnE,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAqBnC;;;;;;;;;;;;;;;GAeG;AACH,MAAa,gBAAiB,SAAQ,sBAAS;IAC7C,mDAAmD;IACnC,UAAU,CAAS;IACnC,4CAA4C;IAC5B,SAAS,CAAS;IAClC,yCAAyC;IACzB,MAAM,CAAS;IAC/B;;;;;OAKG;IACa,cAAc,CAAU;IACxC,2DAA2D;IAC3C,eAAe,CAAS;IACxC,oDAAoD;IACpC,WAAW,CAAS;IAEpC,YAAY,KAAgB,EAAE,EAAU,EAAE,KAA4B;QACpE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAEjB,MAAM,EACJ,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,eAAe,EACf,WAAW,GACZ,GAAG,KAAK,CAAC;QAEV,IAAI,CAAC,WAAW,GAAG,GAAG,WAAW,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACpD,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,uBAAuB,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CACb,iBAAiB,IAAI,CAAC,WAAW,QAAQ,IAAI,CAAC,WAAW,CAAC,MAAM,+BAA+B,uBAAuB,GAAG;gBACvH,8IAA8I,OAAO,CAAC,IAAI,IAAI,CACjK,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,IA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AAQ,EAAE,CAAC;IACjH,CAAC;CACF;AAhFD,4CAgFC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { HarnessApiFormat, HarnessSkill, HarnessTool } from '../../../../../schema/schemas/primitives/harness';
|
|
1
2
|
import type { AgentCoreComponentProps } from '../../base-props';
|
|
2
3
|
import { aws_iam as iam } from 'aws-cdk-lib';
|
|
3
4
|
import { Construct } from 'constructs';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* A harness tool, as defined in the schema. The role construct only reads
|
|
7
|
+
* `type` and the browser/code-interpreter ARNs from `config` for IAM scoping,
|
|
8
|
+
* but uses the full schema type so it accepts every tool variant the spec allows.
|
|
9
|
+
*/
|
|
10
|
+
export type HarnessToolConfig = HarnessTool;
|
|
8
11
|
export interface HarnessMountConfig {
|
|
9
12
|
readonly accessPointArn: string;
|
|
10
13
|
readonly mountPath: string;
|
|
@@ -13,14 +16,24 @@ export interface HarnessRoleConfig {
|
|
|
13
16
|
readonly name: string;
|
|
14
17
|
readonly executionRoleArn?: string;
|
|
15
18
|
readonly memoryName?: string;
|
|
19
|
+
/**
|
|
20
|
+
* True when the harness uses managed memory (`memory.mode === 'managed'`). The harness reads/writes
|
|
21
|
+
* its managed memory at RUNTIME using this execution role, so the role needs the memory data-plane
|
|
22
|
+
* actions scoped to the harness's managed-memory ARN pattern. This is the same data-plane set granted
|
|
23
|
+
* for existing memory (see AgentCoreApplication.wireMemoriesToHarnesses) — NOT control-plane: the
|
|
24
|
+
* memory is created by the CFN resource handler (its own role), never by this runtime role.
|
|
25
|
+
*/
|
|
26
|
+
readonly managedMemory?: boolean;
|
|
16
27
|
readonly containerUri?: string;
|
|
17
28
|
readonly hasDockerfile?: boolean;
|
|
18
29
|
readonly dockerfile?: string;
|
|
19
30
|
readonly codeLocation?: string;
|
|
20
|
-
readonly tools?:
|
|
31
|
+
readonly tools?: HarnessTool[];
|
|
32
|
+
readonly skills?: HarnessSkill[];
|
|
21
33
|
readonly apiKeyArn?: string;
|
|
22
34
|
readonly efsAccessPoints?: HarnessMountConfig[];
|
|
23
35
|
readonly s3AccessPoints?: HarnessMountConfig[];
|
|
36
|
+
readonly apiFormat?: HarnessApiFormat;
|
|
24
37
|
}
|
|
25
38
|
export interface AgentCoreHarnessRoleProps extends AgentCoreComponentProps {
|
|
26
39
|
readonly harness: HarnessRoleConfig;
|
|
@@ -39,7 +52,13 @@ export declare class AgentCoreHarnessRole extends Construct {
|
|
|
39
52
|
constructor(scope: Construct, id: string, props: AgentCoreHarnessRoleProps);
|
|
40
53
|
/**
|
|
41
54
|
* Add a policy statement to this harness role.
|
|
42
|
-
*
|
|
55
|
+
*
|
|
56
|
+
* For roles created by this construct the statement is attached normally.
|
|
57
|
+
* For an imported role (`executionRoleArn`, brought in via
|
|
58
|
+
* `fromRoleArn(..., { mutable: false })`) CDK cannot mutate the role, so the
|
|
59
|
+
* statement cannot be attached. Rather than dropping the grant silently — which
|
|
60
|
+
* surfaces only as a runtime AccessDenied — emit a synth-time warning so the
|
|
61
|
+
* user knows the imported role must already carry the required permissions.
|
|
43
62
|
*/
|
|
44
63
|
addToPolicy(statement: iam.PolicyStatement): void;
|
|
45
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentCoreHarnessRole.d.ts","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentCoreHarnessRole.d.ts","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,WAAW,EAEZ,MAAM,kDAAkD,CAAC;AAG1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE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