-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(synthetics): support canary environment variables #15082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NetaNir mentioned she wanted something more explicit – thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -306,6 +314,7 @@ export class Canary extends cdk.Resource { | |||
failureRetentionPeriod: props.failureRetentionPeriod?.toDays(), | |||
successRetentionPeriod: props.successRetentionPeriod?.toDays(), | |||
code: this.createCode(props), | |||
runConfig: this.createRunConfig(props), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runConfig: this.createRunConfig(props), | |
runConfig: props.environmentVariables ?? { | |
environmentVariables: props.environmentVariables, | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> ---- *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 <[email protected]> ---- *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 [email protected]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license