feat(synthetics): support canary environment variables#15082
feat(synthetics): support canary environment variables#15082mergify[bot] merged 11 commits intomasterfrom
Conversation
nija-at
left a comment
There was a problem hiding this comment.
Good stuff! Only minor comments below.
You can decide if they're worth it or not.
| * | ||
| * @default - No environment variables. | ||
| */ | ||
| readonly environmentVariables?: { [key: string]: string }; |
There was a problem hiding this comment.
minor: Just environment is sufficient.
In some of our target languages, it can get even longer (eg: withEnvironmentVariables()). Would be nice to be terse.
There was a problem hiding this comment.
@NetaNir mentioned she wanted something more explicit – thoughts?
There was a problem hiding this comment.
We call it environment in Lambda - https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.Function.html#environment. No one has complained so far.
There was a problem hiding this comment.
The context in Lambda is clear, it's the function environment variables, in the synthetics module there is not definition of a function, the user only pass a Code type, so environment does not have any context.
| failureRetentionPeriod: props.failureRetentionPeriod?.toDays(), | ||
| successRetentionPeriod: props.successRetentionPeriod?.toDays(), | ||
| code: this.createCode(props), | ||
| runConfig: this.createRunConfig(props), |
There was a problem hiding this comment.
| runConfig: this.createRunConfig(props), | |
| runConfig: props.environmentVariables ?? { | |
| environmentVariables: props.environmentVariables, | |
| } |
There was a problem hiding this comment.
are you suggesting that I ditch the createRunConfig function? or that the run config shouldn't exist if env vars aren't supplied (as this is already the case)
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Add support for canary environment variables that will be threaded to the underlying Lambda function. This allows multiple canaries to use the same source code by extracting configuration to the resource specification. Also makes the README snippets compile since it was hard to tell whether my changes were correct. closes aws#10515 refer aws#9300 Co-authored-by: Florian Chazal <florianchazal@gmail.com> ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add support for canary environment variables that will be threaded to the underlying Lambda function. This allows multiple canaries to use the same source code by extracting configuration to the resource specification. Also makes the README snippets compile since it was hard to tell whether my changes were correct. closes aws#10515 refer aws#9300 Co-authored-by: Florian Chazal <florianchazal@gmail.com> ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add support for canary environment variables that will be threaded to the underlying Lambda function. This allows multiple canaries to use the same source code by extracting configuration to the resource specification.
Also makes the README snippets compile since it was hard to tell whether my changes were correct.
closes #10515
refer #9300
Co-authored-by: Florian Chazal florianchazal@gmail.com
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license