gradle-aws-plugin icon indicating copy to clipboard operation
gradle-aws-plugin copied to clipboard

CreateBucketTask ignores region

Open cagataygurturk opened this issue 9 years ago • 9 comments
trafficstars

This task always creates bucket in us-east-1.

cagataygurturk avatar Jul 17 '16 14:07 cagataygurturk

Thanks for the fix, for when should we expect the next release?

cagataygurturk avatar Jul 18 '16 15:07 cagataygurturk

historical note: was merged, can be closed.

glebsts avatar Aug 22 '16 11:08 glebsts

I know it's merged but since 14 July you haven't released any code. When will you release? Thanks.

cagataygurturk avatar Sep 11 '16 15:09 cagataygurturk

Also, the plugin already has a global region value

apply plugin: "jp.classmethod.aws"
    aws {
        region = "eu-west-1"
    }

I believe that if region value is not given in CreateBucketTask task, this global value should be used instead of us-east-1.

cagataygurturk avatar Sep 11 '16 15:09 cagataygurturk

Thank you @cagataygurturk a) http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region:

For accounts created on or after March 8, 2013, the default region is us-west-2; for older accounts, the default region is us-east-1.

So default value corresponds to Amazon default, and that is expected.

b) Not sure where is aws.region used currently, but CreateBucketTask did not use it before PR, it used AWS default from SDK (see previous note). Please give me code link if I am wrong.

glebsts avatar Sep 12 '16 07:09 glebsts

Did not know they changed the default region for accounts.

But my problem is different. Now in build.gradle we define already a region and all services are using this configuration. But for create bucket task we have to specify again the region for the second time, if not it suddenly creates in us-west-2. i am sure many people won't even realize this behaviour. I think it should respect to previously set region. Thanks.

cagataygurturk avatar Sep 12 '16 07:09 cagataygurturk

Ok, I got your problem. Would be a short fix, but unfortunately I am not repo maintainer :
Out of curiosity: before that PR, when you set some non-default region in aws.region, did CreateBucketTask use it?

glebsts avatar Sep 12 '16 07:09 glebsts

No, and there was even no region parameter, so it was always creating the bucket in eu-east-something.

cagataygurturk avatar Sep 12 '16 07:09 cagataygurturk

so it was always creating the bucket in eu-east-something

at least now you have a workaround for that, no critical issues. I believe that will be updated some day. Mb some other tasks are no using aws.region as well. Must raise separate issue, mb generic like "fix all tasks that do not use aws.region".

glebsts avatar Sep 12 '16 07:09 glebsts