Skip to content

Commit

Permalink
fix(serverless-aws-s3): remove credentials from client instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel910 committed Jul 14, 2020
1 parent 43528da commit fc87f37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 1 addition & 5 deletions packages/serverless-aws-s3/serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AwsS3 extends Component {

this.context.instance.debug(`Deploying bucket %o in region %o`, config.name, config.region);

const clients = getClients(this.context.instance.credentials.aws, config.region);
const clients = getClients(config.region);
await ensureBucket(clients.regular, config.name, this.context.instance.debug);

if (config.accelerated) {
Expand Down Expand Up @@ -59,10 +59,6 @@ class AwsS3 extends Component {
);
}

if (config.upload) {
await this.upload({ bucket: config.name, region: config.region, files: config.upload });
}

this.state.name = config.name;
this.state.region = config.region;
this.state.accelerated = config.accelerated;
Expand Down
7 changes: 2 additions & 5 deletions packages/serverless-aws-s3/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ const { green } = require("chalk");

const PRETRY_ARGS = { retries: 3 };

const getClients = (credentials, region) => {
const params = {
region,
credentials
};
const getClients = region => {
const params = { region };

// we need two S3 clients because creating/deleting buckets
// is not available with the acceleration feature.
Expand Down

0 comments on commit fc87f37

Please sign in to comment.