aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.62k stars 3.91k forks source link

[synthetics] support runConfig properties #9300

Closed kaizencc closed 2 months ago

kaizencc commented 4 years ago

Issue

AWS Synthetics Canary has an optional runConfig property that is currently not supported by the Canary L2. This property exposes timeoutInSeconds and memoryInMb.

The difficulty is that timeoutInSeconds is required if runConfig is set, so one cannot only specify memoryInMb.

This does not seem like it should be a hard requirement (i.e. one should be able to set memoryInMb without timeout).

The requirements for timeoutInSeconds are that it is inside the range 3 - 840 seconds* and not greater than the amount specified in the schedule expression.

 

* yes, this is different than specified in the docs but I tried to set it to be 900 seconds and received the error "Invalid request provided: Run timeout cannot be less than 3 seconds or greater than 840 seconds"

Use Case

The use case for this property is unclear so this issue serves as a platform for discussion on whether it is needed and how to implement.

While the proposed solution is possible, this seems like extra work if the runConfig property is largely ignored anyway. And if timeoutInSeconds becomes optional, then we no longer need to find a default for the property.

Proposed Solution

Add separate optional properties timeout: cdk.Duration and memorySize: cdk.Size to CanaryProps.

timeout should default to the minimum of 840 seconds and the amount in expression. This would require parsing through the expression string to extract the number/unit and convert to seconds.

memorySize is optional in runConfig, so no need to default and it is up to the user to specify a valid amount of memory.


This is a :rocket: Feature Request

NetaNir commented 3 years ago

We are unassigning and marking this issue as p2, which means that we are unable to work on this immediately. We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization.

marius-jakobi commented 3 years ago

environmentVariables would also be useful on Canary construct 👍

ArendAMZN commented 3 years ago

+1, our team would like to use this for environment variables

Also we want our canaries to run every minute, this is supported in cfncanary, but not in synthetics.canary

We added the cfncanary work around, but it's making it hard to extend our cdk from there. For example, adding alarms is much easier using synthetics.canary as opposed to cfncanary

laksandy commented 3 years ago

+1, our team would like to use this for environment variables

github-actions[bot] commented 2 months ago

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

github-actions[bot] commented 2 months ago

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.