Skip to content

Commit

Permalink
fix: incorporate review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mazyu36 committed Jun 17, 2024
1 parent 25f0197 commit 6ec1bdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions packages/aws-cdk-lib/aws-synthetics/lib/canary.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as crypto from 'crypto';
import { Construct } from 'constructs';
import { Code } from './code';
import { Runtime } from './runtime';
import { Runtime, RuntimeFamily } from './runtime';
import { Schedule } from './schedule';
import { CloudWatchSyntheticsMetrics } from './synthetics-canned-metrics.generated';
import { CfnCanary } from './synthetics.generated';
Expand Down Expand Up @@ -552,12 +552,8 @@ export class Canary extends cdk.Resource implements ec2.IConnectable {
!props.timeout) {
return undefined;
}
const activeTracingNotSupportedRuntime = [
Runtime.SYNTHETICS_PYTHON_SELENIUM_2_1,
Runtime.SYNTHETICS_PYTHON_SELENIUM_3_0,
];

if (props.activeTracing && activeTracingNotSupportedRuntime.includes(props.runtime)) {
if (props.activeTracing && !cdk.Token.isUnresolved(props.runtime.family) && props.runtime.family !== RuntimeFamily.NODEJS) {
throw new Error('You can enable active tracing only for canaries that use version `syn-nodejs-2.0` or later for their canary runtime.');
}

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-synthetics/test/canary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ test('throws when activeTracing is enabled with an unsupported runtime', () => {
runtime: synthetics.Runtime.SYNTHETICS_PYTHON_SELENIUM_2_1,
activeTracing: true,
}))
.toThrow('You can enable active tracing only for canaries that use version syn-nodejs-2.0 or later for their canary runtime.');
.toThrow('You can enable active tracing only for canaries that use version `syn-nodejs-2.0` or later for their canary runtime.');
});

test('environment variables can be specified', () => {
Expand Down

0 comments on commit 6ec1bdc

Please sign in to comment.