0

I have AWS instances in several regions (us-east-1, us-west-2). I use CodeDeploy to take .zip files stored in S3 and deploy them to AutoScale groups. However, since the S3 bucket only exists in us-east-1, and I am attempting to deploy to us-west-2, specifying a region in my PowerShell commandlet (New-CDDeployment) doesn't work.

I need to specify a region (us-west-2), but pull the files from the S3 bucket in us-east-1 by using a custom endpoint (s3-us-east-1.amazonaws.com), but I cannot find any way of doing this within the PowerShell commandlet.

Anthony Neace
  • 25,013
  • 7
  • 114
  • 129
Nathan R
  • 1,190
  • 7
  • 13
  • 1
    Looking at New-CDDeployment docs, haven't tried this personally but agree that the way it reads, this seems tricky. As a workaround, can you simply use [cross-region replication](http://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html) to replicate your bucket from us-east-1 into us-west-2, and reference the replica bucket in your powershell cmdlet? – Anthony Neace Mar 10 '17 at 18:07
  • Use your powershell to call the .NET API !!!! https://aws.amazon.com/articles/3801 – mootmoot Mar 10 '17 at 18:10
  • 1
    Additional note: Cross-region replication might be a good thing to do either way, so that your code isn't unavailable during S3 us-east-1 outages. :) – Anthony Neace Mar 10 '17 at 18:13

1 Answers1

1

Use cross-region replication to replicate your bucket from us-east-1 into us-west-2, and reference the replica bucket in your powershell cmdlet since it will be in the same region.

Even if you didn't have this issue, this would be a good general practice so that you don't lose access to your code on S3 during us-east-1 S3 outages.

Anthony Neace
  • 25,013
  • 7
  • 114
  • 129
  • I went with this route. It's double the storage, but you're right, redundancy is never a bad thing. – Nathan R Mar 10 '17 at 18:56