Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BrianBorge
Copy link
Contributor

Adds support to deploy layer to any AWS region.

@BrianBorge BrianBorge requested a review from a team July 16, 2020 23:10
Copy link
Contributor

@aharpervc aharpervc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

@@ -4,6 +4,7 @@ require 'fileutils'

BUILD_DIR = File.join(__dir__, 'build')
DEFAULT_FREETDS_VERSION = '1.1.6'
DEFAULT_AWS_REGION = 'us-east-1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about something like

Suggested change
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?

Copy link
Contributor Author

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.

Base automatically changed from update-lambda-layer-image-name to master July 31, 2020 14:27
@BrianBorge BrianBorge force-pushed the deploy-layer-to-any-aws-region branch from 4173552 to 1e6e762 Compare July 31, 2020 14:33
@BrianBorge BrianBorge requested a review from aharpervc July 31, 2020 14:35
@@ -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|
Copy link
Contributor

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:

  1. 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)
  2. refactor both parameters to be exclusively env vars or task params but not both

Copy link
Contributor

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 🤷‍♂️🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants