Skip to content

Commit c5133c0

Browse files
committed
test(bedrock-agentcore-alpha): add integ test for tracing resource policy opt-out
Adds integration test covering the NONE mode for TracingResourcePolicyMode, verifying tracing delivery resources are created without the X-Ray resource policy. Snapshot to be generated once full build pipeline is available.
1 parent 7f7f908 commit c5133c0

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Integration test for Bedrock AgentCore Runtime tracing resource policy opt-out.
3+
* This test creates a runtime with tracing enabled but with the X-Ray resource
4+
* policy creation disabled, for use when a shared policy is managed elsewhere.
5+
*/
6+
7+
/// !cdk-integ aws-cdk-bedrock-agentcore-runtime-tracing-policy
8+
9+
import * as path from 'path';
10+
import * as integ from '@aws-cdk/integ-tests-alpha';
11+
import * as cdk from 'aws-cdk-lib';
12+
import * as agentcore from '../../../lib';
13+
14+
const app = new cdk.App();
15+
const stack = new cdk.Stack(app, 'aws-cdk-bedrock-agentcore-runtime-tracing-policy');
16+
17+
const runtimeArtifact = agentcore.AgentRuntimeArtifact.fromAsset(
18+
path.join(__dirname, 'testArtifact'),
19+
);
20+
21+
// Runtime with tracing enabled but X-Ray resource policy creation disabled.
22+
// This is the opt-out path for accounts where a shared resource policy is
23+
// managed outside this stack (avoids the 20-policy per-region quota).
24+
new agentcore.Runtime(stack, 'TracingPolicyNoneRuntime', {
25+
runtimeName: 'integ_tracing_policy_none_runtime',
26+
description: 'Runtime with tracing enabled and resource policy creation disabled',
27+
agentRuntimeArtifact: runtimeArtifact,
28+
protocolConfiguration: agentcore.ProtocolType.HTTP,
29+
tracingEnabled: true,
30+
tracingResourcePolicy: {
31+
mode: agentcore.TracingResourcePolicyMode.NONE,
32+
},
33+
});
34+
35+
new integ.IntegTest(app, 'BedrockAgentCoreRuntimeTracingPolicyTest', {
36+
testCases: [stack],
37+
});

0 commit comments

Comments
 (0)