-
Notifications
You must be signed in to change notification settings - Fork 0
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
Deploy layer to any AWS Region #5
base: master
Are you sure you want to change the base?
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.
See comment
aws-lambda-layer/Rakefile
Outdated
@@ -4,6 +4,7 @@ require 'fileutils' | |||
|
|||
BUILD_DIR = File.join(__dir__, 'build') | |||
DEFAULT_FREETDS_VERSION = '1.1.6' | |||
DEFAULT_AWS_REGION = 'us-east-1' |
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.
What about something like
DEFAULT_AWS_REGION = 'us-east-1' | |
DEFAULT_AWS_REGION = ENV['AWS_REGION'] || 'us-east-1' |
Also, is this compatible with a default region from .aws/credentials?
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.
Yes, see "Setting the AWS Region" in https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html if you would like more information/confirmation.
4173552
to
1e6e762
Compare
@@ -30,19 +31,21 @@ task :build, [:freetds_version] do |_t, args| | |||
end | |||
|
|||
desc 'Build FreeTDS AWS Lambda Layer' | |||
task :deploy, [:freetds_version] => [:build] do |_t, args| | |||
task :deploy, [:freetds_version, :aws_region] => [:build] do |_t, args| |
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.
Given that we have an env var for this, do we also need a task parameter? I think it would probably best to just have one way to control this. The current iteration sets up a weird conflict, eg what does this mean: AWS_REGION=whatever bundle exec rake deploy[1.1.6, some_other_region]
.
I realize we also have that conflict with the freetds version parameter, but that makes it worse somehow.
How about this: for now, either:
- make it work exactly like the freetds version stuff. (hard code a const, at the top, then do a 3 layer coalesce for the effective value)
- refactor both parameters to be exclusively env vars or task params but not both
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.
I realize I recommended splitting the coalescing in a prior review, but that's because I didn't realize what we were doing with freetds version at the time 🤷♂️🤦♂️
Adds support to deploy layer to any AWS region.