Skip to content
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

fix(lambda-layer-node-proxy-agent): Replace use of package.json with Dockerfile command npm install [package]@[version] #17078

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
build.sh
.no-packagejson-validator
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# base lambda image
FROM public.ecr.aws/lambda/nodejs:latest

ARG PROXY_AGENT_VERSION=5.0.0

USER root
RUN mkdir -p /opt
WORKDIR /tmp
Expand All @@ -17,8 +19,7 @@ RUN yum update -y \
#

RUN mkdir -p /opt/nodejs
COPY package.json /opt/nodejs
RUN cd /opt/nodejs && npm install
RUN cd /opt/nodejs && npm install proxy-agent@${PROXY_AGENT_VERSION}

#
# create the bundle
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export class NodeProxyAgentLayer extends lambda.LayerVersion {
constructor(scope: Construct, id: string) {
super(scope, id, {
code: lambda.Code.fromAsset(path.join(__dirname, 'layer.zip'), {
// we hash the package.json (it contains the tools versions) because hashing the zip is non-deterministic
assetHash: hashFile(path.join(__dirname, '..', 'layer', 'package.json')),
// we hash the Dockerfile (it contains the tools versions) because hashing the zip is non-deterministic
assetHash: hashFile(path.join(__dirname, '..', 'layer', 'Dockerfile')),
}),
description: '/opt/nodejs/node_modules/proxy-agent',
});
Expand Down