Recommendation: Evaluate Node.JS Hosted Targets and AWS Lambda Extension (though the latter doesn't support temporary credentials). Use this approach ONLY if you cannot use either hosted targets or Lambda extension.
Setting aside the above warning and recommendation, this repo demonstrates what is possible with Apigee policies. However, it includes only few of the policies. The AWS CloudFormation template demos setting up a customer master key (CMK) to be used by AWS services for encrypting data at rest.
- Apigee account: You can sign up for one at https://login.apigee.com/sign_up.
- AWS account: You can sign up for one directly with AWS or sign up for A Cloud Guru and use their AWS sandbox.
- Create a CloudFormation stack named
apigeeDemo
with new resources in AWS, by uploading the file aws-cloudformation-stack.yaml. - Create a new API proxy in Apigee, by uploading the bundle lambda-proxy.zip. (Or make any proxy changes you like in the directory apiproxy, zip it and upload it.)
- Generate credentials for the IAM user
apigeeDemo-stsUser
in AWS console. - Create a new KVM named
sts_creds
, preferably intest
environment, with the 7 keys mentioned in the file apigee-sts_creds-kvm.yaml. Replace the<placeholder>
strings with appropriate values in KVM. - Deploy the API proxy in the same environment as the KVM, preferably
test
.
- Download the two files from tests directory.
- Replace
username-randomstring-eval
with the name of your Apigee organisation asorg
key's value in hoppscotch-environment.json file. - Update the
env
key's value as well in the same file if you deployed the API proxy to an environment other thantest
. - Import the environment and collection at https://hoppscotch.io.
- Choose the imported environment and start testing the requests in the collection.
- You may also enable trace in Apigee and observe the flow for all requests.
Note: Success tests at the end of the collection may fail on first try as Lambda (cold) start may take more time than the js-call-lambda
policy's timeout. Retry should be successful.
- Apigee anti-patterns: https://docs.apigee.com/api-platform/antipatterns/intro
aws-sdk-light
package: https://github.com/karopolopoulos/aws-sdk-light- Apigee documentation: https://docs.apigee.com/api-platform/get-started/get-started
- AWS documentation: https://docs.aws.amazon.com/index.html
- A couple of my own resources:
- AWS CloudFormation Attributes:
aws-sdk-light-apigee-bundle
: https://github.com/srikanthmanda/aws-sdk-light-apigee-bundle