Skip to content

Commit

Permalink
Merge pull request #4 from hoegertn/hoegertn-fixes
Browse files Browse the repository at this point in the history
feat: some improvements
  • Loading branch information
kirkness authored Feb 19, 2021
2 parents d47ef8f + 288f0aa commit 144476c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/WatchableNodejsFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class WatchableNodejsFunction extends NodejsFunction {
bundle: true,
entryPoints: [entry],
platform: 'node',
minify: props.bundling?.minify,
minify: props.bundling?.minify ?? false,
sourcemap: props.bundling?.sourceMap,
external: [
...(props.bundling?.externalModules ?? []),
...(props.bundling?.externalModules ?? ['aws-sdk']),
...(props.bundling?.nodeModules ?? []),
],
loader: props.bundling?.loader as {[ext: string]: Loader} | undefined,
Expand Down
8 changes: 5 additions & 3 deletions src/utils/initAwsSdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import * as AWS from 'aws-sdk';

export const initAwsSdk = (region: string, profile?: string): void => {
AWS.config.region = region;
AWS.config.credentials = new AWS.SharedIniFileCredentials({
profile,
});
if (profile) {
AWS.config.credentials = new AWS.SharedIniFileCredentials({
profile,
});
}
};
2 changes: 1 addition & 1 deletion src/utils/resolveLambdaDetailsFromManifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const resolveLambdaDetailFromManifest = async (
detail: CloudFormation.StackResourceDetail;
lambdaManifest: LambdaManifestType;
}> => {
const cfn = new CloudFormation();
const cfn = new CloudFormation({maxRetries: 10});
const lambdaStackName = await lambdaManifest.nestedStackLogicalIds.reduce(
(promise, nextNestedStack) =>
promise.then((stackName) =>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/updateLambdaFunctionCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const updateLambdaFunctionCode = async (
watchOutdir: string,
detail: CloudFormation.StackResourceDetail,
): Promise<PromiseResult<Lambda.FunctionConfiguration, AWSError>> => {
const lambda = new Lambda();
const lambda = new Lambda({maxRetries: 10});
return zipDirectory(watchOutdir).then((zip) => {
return lambda
.updateFunctionCode({
Expand Down

0 comments on commit 144476c

Please sign in to comment.