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 ae0b174
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 60 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"Name": "next",
"RunConfig": {
"ActiveTracing": true,
"MemoryInMB": 1024,
"MemoryInMB": 2048,
"TimeoutInSeconds": 240
},
"RuntimeVersion": "syn-nodejs-puppeteer-7.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestStack extends Stack {
}),
cleanup: synthetics.Cleanup.LAMBDA,
activeTracing: true,
memory: Size.mebibytes(1024),
memory: Size.mebibytes(2048),
timeout: Duration.minutes(4),
});
}
Expand Down
10 changes: 3 additions & 7 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 @@ -206,7 +206,7 @@ export interface CanaryProps {
* This value must be a multiple of 64 Mib.
* The range is 960 MiB to 3008 MiB.
*
* @default Size.mebibytes(5)
* @default Size.mebibytes(1024)
*/
readonly memory?: cdk.Size;

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 ae0b174

Please sign in to comment.