(synthetics): add Runtime property for syn-python-selenium-1.0 to create synthetics canary
See original GitHub issueI want to use CDK to create synthetic canary in python and selenium. However, when I try to write some code, i found the there is no matching runtime property.
Not found syn-python-selenium-1.0 from the API docs: - https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_synthetics/Runtime.html - https://docs.aws.amazon.com/cdk/api/latest/typescript/api/aws-synthetics/runtime.html#aws_synthetics_Runtime
Is there anyway I can create this type canary by CDK?
Use Case
const canary = new synthetics.Canary(this, 'MyCanary', {
schedule: synthetics.Schedule.rate(Duration.minutes(5)),
test: Test.custom({
// code: synthetics.Code.fromAsset(path.join(__dirname, 'lambda')),
code: synthetics.Code.fromInline(
fs
.readFileSync(path.join(__dirname, '../../lambda/app.py'))
.toString()
),
handler: 'index.handler',
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_1,
});
The synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_1 in above code is for NodeJS and Puppeteer
Proposed Solution
Other
- 👋 I may be able to implement this feature request
- ⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Synthetics runtime versions - Amazon CloudWatch
Explains the versions of CloudWatch Synthetics runtimes, libraries, ... When you create or update a canary, you choose a Synthetics runtime version for...
Read more >Create Canaries Using Amazon CloudWatch Synthetics
In this video, you'll see how to create canaries using Amazon CloudWatch Synthetics. With this feature, you can create different kinds of ...
Read more >CloudWatch Synthetics: Tutorial by Example - OpsRamp
Learn how to use CloudWatch Synthetics canaries to check API endpoints and broken links, and understand how to integrate the service with AWS...
Read more >aws_synthetics_canary | Resources | hashicorp/aws
When you create a canary, AWS creates supporting implicit resources. See the Amazon CloudWatch Synthetics documentation on DeleteCanary for a full list.
Read more >@aws-cdk/aws-synthetics - npm
The Canary code will be executed in a lambda function created by Synthetics on your behalf. The Lambda function includes a custom runtime...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While the workaround works for code that’s
fromInline()
orfromBucket()
, there is currently a requirement for codefromAsset()
to have the file structurenodejs/node_modules
. The relevant line of code is here and this issue was referenced previously.It looks like in addition to adding the static method we need to also modify the
validateCanaryAsset
check to parse betweennode
runtimes andpython
runtimes. We should be checking that canaries withpython
runtimes come from within apython
folder [source].Sorry, should have specified the workaround:
new Runtime('syn-python-selenium-1.0')
. But should keep this open to support this via a static method.