diff --git a/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/.dockerignore b/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/.dockerignore index 69b73f61d249a..88a84e55aa43b 100644 --- a/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/.dockerignore +++ b/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/.dockerignore @@ -1,2 +1 @@ build.sh -.no-packagejson-validator diff --git a/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/.no-packagejson-validator b/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/.no-packagejson-validator deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/Dockerfile b/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/Dockerfile index 8c747a0e2b95f..2e3f644258652 100644 --- a/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/Dockerfile +++ b/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/Dockerfile @@ -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 @@ -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 diff --git a/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/package.json b/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/package.json deleted file mode 100644 index 102dd83c99391..0000000000000 --- a/packages/@aws-cdk/lambda-layer-node-proxy-agent/layer/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "node-proxy-agent-layer", - "private": true, - "version": "0.0.1", - "license": "Apache-2.0", - "devDependencies": { - "proxy-agent": "^5.0.0" - } -} diff --git a/packages/@aws-cdk/lambda-layer-node-proxy-agent/lib/node-proxy-agent-layer.ts b/packages/@aws-cdk/lambda-layer-node-proxy-agent/lib/node-proxy-agent-layer.ts index 9e6471a2da2c6..60b8c8697dea7 100644 --- a/packages/@aws-cdk/lambda-layer-node-proxy-agent/lib/node-proxy-agent-layer.ts +++ b/packages/@aws-cdk/lambda-layer-node-proxy-agent/lib/node-proxy-agent-layer.ts @@ -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', });