classmethod / gradle-aws-plugin

Gradle plugin to manage Amazon Web Services
276 stars 132 forks source link

CreateBucketTask ignores region #48

Open cagataygurturk opened 8 years ago

cagataygurturk commented 8 years ago

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

cagataygurturk commented 8 years ago

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

glebsts commented 8 years ago

historical note: was merged, can be closed.

cagataygurturk commented 8 years ago

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

cagataygurturk commented 8 years ago

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.

glebsts commented 8 years ago

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.

cagataygurturk commented 8 years ago

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.

glebsts commented 8 years ago

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?

cagataygurturk commented 8 years ago

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

glebsts commented 8 years ago

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".