Skip to content

Commit

Permalink
fix: #1289 change credentials file location to /src
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuong Vu committed May 22, 2020
1 parent f8c6be2 commit 27ac0ac
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ const credentials = {
region: AWS_REGION,
}

fs.writeFileSync(path.resolve(__dirname, '../credentials.json'), JSON.stringify(credentials))
// this will create a credentials.json file in src folder
fs.writeFileSync(path.resolve(__dirname, '../src/credentials.json'), JSON.stringify(credentials))
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import path from 'path'
import AWS from 'aws-sdk'
import DynamoDB from 'aws-sdk/clients/dynamodb'
import { DataMapper } from '@aws/dynamodb-data-mapper'
import AWS from 'aws-sdk'
import path from 'path'

AWS.config.loadFromPath(path.resolve(__dirname, '../../credentials.json'))
// load AWS credentials into this lambda
// relative to src
AWS.config.loadFromPath(path.resolve(__dirname, './credentials.json'))

const dynamoDBClient = new DynamoDB({
region: process.env.AWS_REGION,
Expand Down
1 change: 0 additions & 1 deletion packages/web-components-config-server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import serverless from 'serverless-http'

import app from './app'

const handler = serverless(app)
Expand Down
4 changes: 2 additions & 2 deletions packages/web-components-config-server/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ module.exports = {
new CopyPlugin({
patterns: [
{
from: path.resolve(__dirname, './credentials.json'),
to: path.resolve(__dirname, 'dist'),
from: path.resolve(__dirname, './src/credentials.json'),
to: 'src',
},
],
}),
Expand Down

0 comments on commit 27ac0ac

Please sign in to comment.