mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Merge pull request #5650 from exoego/fix-cf-region-syntax
AWS: Fix ${cf.REGION} syntax causes deployment in wrong region
This commit is contained in:
commit
d4e36b71c3
@ -226,7 +226,7 @@ class AwsProvider {
|
||||
*/
|
||||
request(service, method, params, options) {
|
||||
const that = this;
|
||||
const credentials = that.getCredentials();
|
||||
const credentials = _.cloneDeep(that.getCredentials());
|
||||
// Make sure options is an object (honors wrong calls of request)
|
||||
const requestOptions = _.isObject(options) ? options : {};
|
||||
const shouldCache = _.get(requestOptions, 'useCache', false);
|
||||
|
||||
@ -324,6 +324,7 @@ describe('AwsProvider', () => {
|
||||
},
|
||||
},
|
||||
};
|
||||
expect(awsProvider.getCredentials()).to.deep.eql({ region: options.region });
|
||||
|
||||
return awsProvider
|
||||
.request('CloudFormation',
|
||||
@ -332,6 +333,8 @@ describe('AwsProvider', () => {
|
||||
{ region: 'ap-northeast-1' })
|
||||
.then(data => {
|
||||
expect(data).to.eql({ region: 'ap-northeast-1' });
|
||||
// Requesting different region should not affect region in credentials
|
||||
expect(awsProvider.getCredentials()).to.deep.eql({ region: options.region });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user