New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS: Fix ${cf.REGION} syntax causes deployment in wrong region #5650

Merged
merged 2 commits into from Jan 7, 2019
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+4 −1
Diff settings

Always

Just for now

@@ -226,7 +226,7 @@ class AwsProvider {
*/ */
request(service, method, params, options) { request(service, method, params, options) {
const that = this; const that = this;
const credentials = that.getCredentials(); const credentials = _.cloneDeep(that.getCredentials());
// Make sure options is an object (honors wrong calls of request) // Make sure options is an object (honors wrong calls of request)
const requestOptions = _.isObject(options) ? options : {}; const requestOptions = _.isObject(options) ? options : {};
const shouldCache = _.get(requestOptions, 'useCache', false); const shouldCache = _.get(requestOptions, 'useCache', false);
@@ -324,6 +324,7 @@ describe('AwsProvider', () => {
}, },
}, },
}; };
expect(awsProvider.getCredentials()).to.deep.eql({ region: options.region });


return awsProvider return awsProvider
.request('CloudFormation', .request('CloudFormation',
@@ -332,6 +333,8 @@ describe('AwsProvider', () => {
{ region: 'ap-northeast-1' }) { region: 'ap-northeast-1' })
.then(data => { .then(data => {
expect(data).to.eql({ region: 'ap-northeast-1' }); 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 });
}); });
}); });


ProTip! Use n and p to navigate between commits in a pull request.