ebs_snapper icon indicating copy to clipboard operation
ebs_snapper copied to clipboard

How can you deploy to a region other than us-east-1?

Open LewS opened this issue 8 years ago • 4 comments

deploy.py does not utilise the specified DEFAULT_REGION when creating the s3 bucket. from what I can gather the script only works by virtue of the default bucket region being us-east-1, which ostensibly means it can only be deployed in us-east-1 as lambda can only utilise a bucket from the same region. Would be nice of we could specify the region (as appears to have been designed for), tried to fiddle with the CreateBucketConfiguration={'LocationConstraint': DEFAULT_REGION} within the s3_client.create_bucket section; which sort of works if the bucket does not exist, but will fail updates where it does.

LewS avatar Jun 13 '17 11:06 LewS

Hello! As you've figured out already, we typically deploy the script only in a known region, so we tend to override everything with 'us-east-1'. The deploy feature originally was a separate script, hence it's somewhat separated from the rest of the code and not respecting the override (that's definitely a bug!).

  -t [CONF_TOOLREGION], --tool_region [CONF_TOOLREGION]
                        dynamodb & SNS region used by ebs-snapper (us-east-1
                        is default)

It seems like this will need some further testing to figure out the right syntax to land a bucket in a different region (likely the params will need tweaking in create_bucket...).

martinb3 avatar Jun 13 '17 12:06 martinb3

Something permanent so as to avoid the need to ebs-snapper -t region each time seems ideal. All appears to be working pretty well so far with the bucket hacked into place ;-) Let me know if you need any assistance testing.

LewS avatar Jun 13 '17 12:06 LewS

@LewS -- would you mind trying the alternate_regions branch? It seems like CloudFormation doesn't like looking in an alternate S3 region for its Lambda functions, especially if there used to be a bucket by that name in us-east-1. Otherwise, I think I have that branch doing what you need for deployment. Thanks!

martinb3 avatar Jun 16 '17 19:06 martinb3

It seems like you gave that branch a try -- is it working okay now for you, once the S3 buckets/naming was worked out?

martinb3 avatar Jun 23 '17 15:06 martinb3