nodeproxyagentv5

module
v2.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2022 License: Apache-2.0

README

AWS Lambda Layer with the NPM dependency proxy-agent

---


This module bundles the NPM dependency proxy-agent as a local asset. It exposes constants ASSET_FILE and LAYER_SOURCE_DIR that can be consumed via the CDK Asset construct.

  • proxy-agent Version: 5.0.0

Usage:

import { ASSET_FILE, LAYER_SOURCE_DIR } from '@aws-cdk/asset-node-proxy-agent';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as s3_assets from 'aws-cdk-lib/aws-s3-assets';
import { FileSystem } from 'aws-cdk-lib';

declare const fn: lambda.Function;
const asset = new s3_assets.Asset(this, 'layer-asset', {
  path: ASSET_FILE,
  assetHash: FileSystem.fingerprint(LAYER_SOURCE_DIR),
});

fn.addLayers(new lambda.LayerVersion(this, 'ProxyAgentLayer', {
  code: lambda.Code.fromBucket(asset.bucket, asset.s3ObjectKey),
}));

proxy-agent will be installed under /nodejs/node_modules.

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL