Creating REST services using AWS Lambda Function and API Gateway in eclipse and testing with Postman.

Creating REST services using AWS Lambda Function and API Gateway in eclipse and testing with Postman.

Jan. 31, 2018
14 minutes read time
1 likes
0 comments
1772 times viewed


header image

Description

This tutorials explains creating Lambda function in eclipse using aws eclipse sdk. It also explains how to deal with certain aws components like creating IAM User, Roles, Policies, S3 bucket, Lambda functions and API Gateways. Uploading the created lambda function to S3 bucket using the aws crdentials, invoking function and starting APIs, deploying apis and testing it with Postman Rest Client.

Content

Install and Configure Eclipse with AWS Toolkit

Install the AWS Toolkit

To install AWS Toolkit for Eclipse follow the steps below.

install_software_eclipse.png

aws_toolkit_eclipse.png

aws_icon.png

Create IAM User & Get AWS Access Keys

To get your access key ID and secret access key follow the steps below.

create_user.png

add_user_aws.png

permissions_aws.png

create_aws_user.png

credentials_aws.png

After getting access credentials, we need to add those to eclipse.

Add your AWS access keys to the AWS Toolkit for Eclipse

To add your access keys follow the steps below:

eclipse_preferences.png

access_keys_aws.png


Create and IAM Role

After creating an IAM User and setting credentials we need to create an IAM Role. To create an IAM Role follow the below steps:

role_aws.png

role_aws_lambda.png

review_policy_role.png

role_aws_create.png

created_aws_role.png


Create S3 Bucket

To create S3 bucket follow the steps below:

S3_console.png

Note: You need to remember the Region selected, it will be used in later part.

new_s3_bucket.png

new_s3_created.png


Creating Lambda Function

To create lambda function follow the below steps:

new_lambda.png

lambda_function.png

function_customize.png

upload_lambda.png

Note: You need to select the same AWS Region in which you had created your S3 bucket.

lambda_function_name.png

upload_lambda_aws.png

uploaded_lambda_s3.png

lambda_function_updated_aws.png

run_lambda.png

Note: Due to some bug in eclipse, if you type your input in the box it will not work coz it automatically changes the quotes which is not compatible withh UTF-8. So just type it in some editor and just paste your input in the box.

invoke_lambda.png

output_lambda.png

Now, as our service is ready, this service says Welcome to the whhatever name is given as input. We need to deploy it using AWS API Gateway and then test this service url using Postman-Rest Client.


Deploy Lambda Function to API Gateway

To deploy lambda function to API Gateway follow the steps below:

api_home.png

create_api.png

aws_api_resource.png

create_api_resource.png

api_method.png

method_api_type.png

create_api_method.png

created_api.png

test_api.png

deploy_api.png

deploying_api.png

deployed_api.png


Testing API with Postman

To test your api with postman follow below steps:

postman.png



We are done



Like this post

1   Like


Share this post on

Google Plus LinkedIn


About the author




Join the discussion

Nothing to preview

Post Comment



Comments