Git Product home page Git Product logo

f5-aws-apigw-proxy's Introduction

F5 AWS Lambda/API Gateway Proxy iRules LX Plug-in

Introduction

This extension is community supported.

The f5_aws_apigw_proxy iRules LX plug-in is a BIG-IP iRules LX plugin for enables the BIG-IP to act as a many-to-one proxy for both AWS API Gateway and direct Lambda function requests. The plug-in utilizes a data-group to perform path/URI and path/LambdaFunction matching. This allows for a single public facing proxy endpoint to service multiple backend AWS Lambda functions and APIs.

Lambda Proxy

To proxy a Lambda function located within the same region as the F5 BIG-IP instance, create a datagroup, ('aws-apis')to create path/fxn mappings fxn1 ---> glc-hello-function. To proxy a Lambda function located in a different AWS region simply prepend the region to the function name fxn1 ---> eu-west-1/glc-hello-function.

Lambda Proxy Example1:
POST/apigw.f5demo.net/fxn1 -- proxies directly to the Lambda function with the name glc-hello-function

Lambda Proxy outside of region Example2:
POST/apigw.f5demo.net/fxn2 -- proxies directly to the Lambda function with the region/name eu-west-2/glc-hello-function

AWS API Proxy

To proxy AWS APIs, use the same datagroup to create path --> URI matchings - api1 ---> jbfipbsqfa.execute-api.us-east-1.amazonaws.com/prod/LambdaPub-WCGIBYB9AHI

API example:
POST/apigw.f5demo.net/api1 -- proxies to -- POST/jbfipbsqfa.execute-api.us-east-1.amazonaws.com/prod/LambdaPub-WCGIBYB9AHI

Requirements

BIG-IP VE 13.1 or later running on EC2

Installation

1. Download and import .tgz file into the BIGIP, (see below).





2. Create LX plugin from imported workspace - Note: must be named 'f5_aws_apigw_proxy'

TMSH command example: tmsh create ilx plugin f5_aws_apigw_proxy from-workspace f5_aws_apigw_proxy



3. Create and populate the data-group //Note: must be named 'aws-apis'


TMSH command example: tmsh create ltm data-group internal aws-apis type string records add { api1 { data jbfipbsqfa.execute-api.us-east-1.amazonaws.com/default/serverlessrepo-glc-publisher-LambdaPublisher-WFCGIBYB9AHI } fxn1 { data glc-hello-fxn }}



4. Create an AWS IAM role with the name: f5ApiProxyRole

The role requires, at a minimum the 'AmazonAPIGatewayInvokeFullAccess' and 'AWSLambdaFullAccess' permissions, (see below). Attach the newly created role to BIG-IP ec2 instance. Refer to this link for instructions.



For a quick video run through of the installation process, check out this video.

Modification

Once the workspace has been installed, you can use the BIG-IP workspace, (see below) to view and modify the underlying iRule -tcl and the nodejs processor

f5-aws-apigw-proxy's People

Contributors

gregcoward avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.