aws-sdk-light package bundled into a file for use as an IncludeURL resource in Apigee's JavaScript policy.
aws-sdk-light package: https://npmjs.com/package/aws-sdk-light
To be able to work with your source code directly in any Apigee proxy JavaScript policy.
Using the aws-sdk-light package as an IncludeURL dependency, policy code does not have to be bundled with Webpack.
Note: All the restrictions of Apigee's JavaScript policy still apply.
You may use the release/aws-sdk-light-apigee.bundle.js file of this repo following steps 3 and 4 below.
Or you may generate it from the source following all of the below steps.
- Clone this repo:
git clone https://github.com/srikanthmanda/aws-sdk-light-apigee-bundle.git - Install the packages:
npm install - Run the
package.jsonscript to bundle the code with Webpack:npm run shipit - Add (or upload) the
aws-sdk-light-apigee.bundle.jsfile from thereleasedirectory to the Apigee proxy as ajscresource. - Include the bundle file in the proxy's JavaScript policies calling the AWS Lambda and STS services, before the
ResourceURLproperty as:
<IncludeURL>jsc://aws-sdk-light-apigee.bundle.js</IncludeURL>
- Find
consolepolyfill, as the Rhino JavaScript engine Apigee uses has onlyprint().
aws-sdk-lightsource: https://github.com/karopolopoulos/aws-sdk-light- Apigee JavaScript Policy: https://docs.apigee.com/api-platform/reference/policies/javascript-policy
- Structuring Javascript modules in Apigee: https://www.googlecloudcommunity.com/gc/Apigee/What-are-your-best-practices-for-structuring-Javascript-modules/td-p/66833
- Rhino JavaScript Engine: https://github.com/mozilla/rhino