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

Multi-region operation #7

Closed
cristim opened this issue Oct 25, 2016 · 5 comments
Closed

Multi-region operation #7

cristim opened this issue Oct 25, 2016 · 5 comments

Comments

@cristim
Copy link

cristim commented Oct 25, 2016

The stack should only need to be deployed in a single region, and it should be able to trigger instance terminations is any other region, because I would like to only set it up once, not once per region.

@pclifford
Copy link
Collaborator

It should be doable, but in general it's good to keep each region as independent as possible, avoiding things like configuration changes in one region impacting another.

We've realised that the code is small enough to embed in the CloudFormation template (via the ZipFile property), and combined with a solution for #5, it should make at least the code deployment part pretty quick.

What's the main pain point for you at the moment when setting it up for multiple regions?

@endofcake
Copy link

I'd argue that running lambda it each region separately has some advantages:

  • kind of HA - if lambda service is down in one region (and we've seen it happen), it doesn't affect the others
  • lambda needs to only care about its own region, which keeps its design and configuration simpler
  • iterating over stacks in other regions would be slower and affect cost (even though it's negligible)

We've made chaos lambda part of our automated deployments scoped to a region (along with other region-specific resources, such as SNS topics), and it's working quite well.

@cristim
Copy link
Author

cristim commented Oct 30, 2016

My use case is that I have an application running in 6 regions, and I would prefer to only run and configure it once to work against all those regions, instead of running it in each and every of those regions.

This doesn't need to be the default behavior, I would just like to have this available as a configuration option.

@cristim
Copy link
Author

cristim commented Nov 3, 2016

Another use case I saw yesterday is the support for regions where Lambda is not yet supported, such as California, Brazil or Mumbai.

A multi-region model would allow a Lambda function deployed in Virginia to randomly terminate instances there.

pclifford added a commit that referenced this issue Nov 11, 2016
A regions.txt file can now be added to the lambda to specify a list of
regions it should target.

This file, if present, should list one or more regions separated by
newlines.  Any whitespace surrounding a line is ignored, as are blank
lines, and if the file is missing, empty, or only contains whitespace,
the lambda defaults to region it was started in.

(ref GitHub issue #7)
@pclifford
Copy link
Collaborator

While we'd still recommend using a different instance of the lambda per region you're right that some regions don't yet support running lambda functions at all, so the latest version should now optionally be able to target ASGs in other regions.

Details are in README.md under the "Regions" heading, but basically: create a regions.txt file in the src/ folder with a newline-separated list of regions, bundle that up with the code (make zip), upload this to a S3 bucket in the region you want to run the lambda, then create the stack using the lambda.json template rather than lambda_standalone.json.

Slightly convoluted, but there doesn't seem to be a more direct way to trigger a lambda with arbitrary configuration values?

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

No branches or pull requests

3 participants