<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ajay Karki on Medium]]></title>
        <description><![CDATA[Stories by Ajay Karki on Medium]]></description>
        <link>https://medium.com/@ajaykarki?source=rss-a4033208016b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Dh2Qr7wdFgh_NqZTJJJrPA.jpeg</url>
            <title>Stories by Ajay Karki on Medium</title>
            <link>https://medium.com/@ajaykarki?source=rss-a4033208016b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 08:09:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ajaykarki/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Working with Amazon Lambda Connector via WSO2 EI Management Console]]></title>
            <link>https://medium.com/@ajaykarki/working-with-amazon-lambda-connector-via-wso2-ei-management-console-48c4c5107bde?source=rss-a4033208016b------2</link>
            <guid isPermaLink="false">https://medium.com/p/48c4c5107bde</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Ajay Karki]]></dc:creator>
            <pubDate>Tue, 14 May 2019 20:31:22 GMT</pubDate>
            <atom:updated>2019-05-14T20:47:08.874Z</atom:updated>
            <content:encoded><![CDATA[<p>Okay, here we go for the step-by-step guide about the Lambda connector we discussed in <a href="https://medium.com/@ajaykarki/amazon-lambda-connector-for-wso2-enterprise-integrator-65393cc80b25">previous post</a>.</p><p>Let’s start with prerequisites for working with Amazon Lambda Connector via WSO2 Enterprise Integrator ( WSO2 EI).</p><p><strong>Prerequisites:</strong></p><ul><li>Oracle JDK 1.8</li><li>WSO2 Enterprise Integrator</li><li>AWS Credential</li><li>Amazon Lambda Connector</li></ul><p>To perform any action in the REST API of Amazon Web Service(AWS), you must have an AWS account and credentials. You are not charged for any AWS services that you sign up for, unless you use them.</p><p><strong>Signing Up for AWS</strong></p><p>Navigate to this link <a href="https://aws.amazon.com/">https://aws.amazon.com/</a> and then click Create an AWS Account. Follow the online Instructions and get it done with creating account.</p><p><strong>Obtaining user’s credentials(AWS)</strong></p><p>You can access Amazon Lambda service using the root user credentials but these credentials allow full access to all resources in the account as you can’t restrict permission for root user credentials. If you want to restrict certain resources and allow controlled access to AWS services then you can create IAM(Identity and Access Management) users in your AWS account.</p><p><strong>Follow given steps below to get an AWS Access Key for your AWS root account:</strong></p><blockquote>-Go to AWS Management Console.</blockquote><blockquote>-Hover over your NAME in the right top menu and click “My Security Credentials”.</blockquote><blockquote>-Scroll to the “Access Keys” section.</blockquote><blockquote>-Click on “Create New Access Key”.</blockquote><blockquote>-Copy both the Access Key ID (YOUR_AMAZON_LAMBDA_KEY) and Secret Access Key (YOUR_AMAZON_LAMBDA_SECRET).</blockquote><p><strong>Follow given steps below to get an AWS Access Key for an IAM user account:</strong></p><blockquote>-Sign in to AWS Management Console and open IAM console.</blockquote><blockquote>-In the navigation pane, choose Users.</blockquote><blockquote>-Add a check mark next to the name of the desired user, and then choose User Actions from the top.</blockquote><blockquote>-Click on Manage Access Keys.</blockquote><blockquote>-Click on Create Access Key.</blockquote><blockquote>-Click on Show User Security Credentials. Copy and paste the Access Key ID and Secret Access Key values, or click on Download Credentials to download the credentials in a CSV (file).</blockquote><p>Let’s download the connector first. <a href="https://store.wso2.com/store/assets/esbconnector/details/fb0aec6a-3525-4bc4-952e-0b60489a82bc">Click here to download.</a></p><p><strong>Setting up WSO2 Enterprise Integrator.</strong></p><ul><li>Download WSO2 Enterprise Integrator version 6.4.0 from <a href="https://wso2.com/integration/">https://wso2.com/integration/</a> and extract the zip.</li><li>Open a terminal and navigate to &lt;EI_HOME&gt;/bin directory.</li><li>Execute following scripts to start ESB profile of WSO2 EI .<br>On windows: integrator.bat — run<br>On Linux/Mac OS: sh integrator.sh</li><li>Open the Web Browser you like and navigate to ESB profile’s management console using the following URL: <a href="https://localhost:9443/carbon">https://localhost:9443/carbon</a></li><li>Log into the management console (Username: admin , Password: admin)</li></ul><p>Once you are logged into the management console you can see similar screen as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DDG6ThUhbvu_vLxPymbSUg.png" /><figcaption>EI management Console</figcaption></figure><p>On the left pane you can see list of options. Go to the Main tab and click <strong>Connectors-&gt; Add</strong> you will see the UI for adding the connector on right side. Click on the Browse button to browse the connector that you have downloaded from the store and upload it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z4yXwvTL5G-ya_6WRd2uYw.png" /><figcaption>After adding the connector.</figcaption></figure><p>To enable the connector, click on “<strong>Disabled</strong>” , that is under the “<strong>Status</strong>” column and refresh the page. You will see it turned to “<strong>Enabled</strong>” with the green tick in front of it.</p><p>Let’s move on to setup the proxy. Here,I will guide you to setup proxy and run the command for one particular action i.e. GetAccountSettings. You can follow the same pattern for other actions too that are supported by the API. Just give the correct value &amp; name to the variables needed by each action and write the proxy accordingly, it works fine.</p><p>Click on the “Proxy Service” tab in the left side pane in EI management console and click “<strong>Custom Proxy-&gt;switch to source view</strong>”. Here you will see a editor-like UI for writing a proxy.</p><p>Copy and paste the below content in that editor and save it.</p><pre>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;<br>&lt;proxy xmlns=”http://ws.apache.org/ns/synapse&quot;<br>name=”amazonlambda_getAccountSettings”<br>startOnLoad=”true”<br>statistics=”disable”<br>trace=”disable”<br>transports=”http,https”&gt;<br>&lt;target&gt;<br>&lt;inSequence&gt;<br>&lt;property expression=”json-eval($.secretAccessKey)” name=”secretAccessKey”/&gt;<br>&lt;property expression=”json-eval($.accessKeyId)” name=”accessKeyId”/&gt;<br>&lt;property expression=”json-eval($.region)” name=”region”/&gt;<br>&lt;property expression=”json-eval($.blocking)” name=”blocking”/&gt;<br>&lt;property expression=”json-eval($.apiVersionGetAccountSettings)”<br>name=”apiVersionGetAccountSettings”/&gt;<br>&lt;amazonlambda.init&gt;<br>&lt;secretAccessKey&gt;{$ctx:secretAccessKey}&lt;/secretAccessKey&gt;<br>&lt;accessKeyId&gt;{$ctx:accessKeyId}&lt;/accessKeyId&gt;<br>&lt;region&gt;{$ctx:region}&lt;/region&gt;<br>&lt;blocking&gt;{$ctx:blocking}&lt;/blocking&gt;<br>&lt;/amazonlambda.init&gt;<br>&lt;amazonlambda.getAccountSettings&gt;<br>&lt;apiVersionGetAccountSettings&gt;{$ctx:apiVersionGetAccountSettings<br>&lt;/apiVersionGetAccountSettings&gt;<br>&lt;/amazonlambda.getAccountSettings&gt;<br>&lt;respond/&gt;<br>&lt;/inSequence&gt;<br>&lt;/target&gt;<br>&lt;description/&gt;<br>&lt;/proxy&gt;</pre><p>Now obtain the endpoint of that proxy service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgt88vZdt2iuYt114C5HFQ.jpeg" /><figcaption>UI for getting endpoints of the proxy.</figcaption></figure><p>Now you can use curl command to call the API by providing the needed data to make a call. For that you can either directly give the data in command itself or you can save the data in json file and pass the file in command. The data needed for this action is given below:</p><pre>{<br>“secretAccessKey”:”QHEY90UcuZ/5loX*****************”,<br>“accessKeyId”:”AKIAJ3O*********”,<br>“region”:”us-east-2&quot;,<br>“blocking”:”false”,<br>“apiVersionGetAccountSettings”:”2016–08–19&quot;<br>}</pre><p>I prefer saving the data in json file and later use the file in curl command. So save the above data :) after replacing it with your credentials and values to the variable. So,go to the location where json file is saved and open the terminal there and pass the curl command given below end press Enter:</p><pre>curl ENDPOINT -H “Content-Type: application/json” -d @getAccountSettings.json</pre><blockquote>Note:</blockquote><blockquote>Here getAccountSettings.json is the json file that I used for saving data to be sent to the API along with the request and ENDPOINT is the endpoint that you copied earlier from management console.</blockquote><p>If your credentials and values to the variable are correct you will see the similar response as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFSMpu3oqRbHJxg8l05Pkw.jpeg" /><figcaption>Response from API for the curl command.</figcaption></figure><p>Cheers!!</p><p>You can use this connector to perform other actions(operations) too, that are supported by AWS Lambda REST API. For that you need to setup proxy accordingly and give the needed data for each action correctly.</p><p>To work with other action related to AWS Lambda and configuring proxy and all those stuffs you can refer to the content of this link. <a href="https://github.com/ajkarki/esb-connector-amazonlambda/tree/master/docs">https://github.com/ajkarki/esb-connector-amazonlambda/tree/master/docs</a></p><p>It has detailed information about every action which helps you to configure proxy and give the proper set of data to make API call.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48c4c5107bde" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Lambda Connector for WSO2 Enterprise Integrator]]></title>
            <link>https://medium.com/@ajaykarki/amazon-lambda-connector-for-wso2-enterprise-integrator-65393cc80b25?source=rss-a4033208016b------2</link>
            <guid isPermaLink="false">https://medium.com/p/65393cc80b25</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Ajay Karki]]></dc:creator>
            <pubDate>Wed, 01 May 2019 13:12:20 GMT</pubDate>
            <atom:updated>2020-04-12T11:37:15.314Z</atom:updated>
            <content:encoded><![CDATA[<p>Before starting with this connector, let me give you a brief introduction about Amazon Lambda, WSO2 Enterprise Integrator(WSO2 EI), and Connectors, just in case you didn’t know earlier.</p><p><strong>AWS Lambda</strong></p><p>AWS Lambda is a compute service that lets you run code without provisioning or managing servers. It lets you run your own code on Amazon’s servers, so you don’t need to host the code yourself. It does all the administration of the compute-resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging. You pay only for the compute time you consume. All you need to do is supply your code in one of the languages that AWS Lambda supports (currently Node.js, Java, C#, Go and Python).</p><p><strong>Connector</strong></p><p>A connector is a tool that allows its user to access the third party API and get the information from it. It defines operation in a way that user can call from their configuration and it makes the pragmatic request to the API and gets the information. It enables applications to interact with third-party API using a template-driven approach. Here we configure options for request and connector uses the request module as the HTTP client to make the request. It allows performing different actions in the service that it is designed for.</p><p><strong>WSO2 Enterprise Integrator</strong></p><p>WSO2 Enterprise Integrator is a comprehensive integration solution that enables communication among various, disparate applications. The EI connector allows you to connect to any third party systems. For more info about WSO2 EI <a href="https://docs.wso2.com/display/EI611/Introducing+the+Enterprise+Integrator">click here</a>.</p><p>Coming back to the topic, Amazon Lambda Connector for WSO2 EI, it provides access to the REST API of Amazon Lambda allowing users to access every feature in it. <strong>For example</strong>, you might want to analyse on your website’s log files to get important security information which helps to prevent greater risk by timely analysing the logs. For this, you can write a lambda function that will monitor your website’s log files. Set up your lambda function so that when a log file changes, it triggers the lambda code which can perform any number of analyses on the log files and give you important security information. You can get this information using the connector by Invoking that function using “Invoke” operation in the connector and with the use of Gmail connector you can send that information to desired email address.</p><p>The diagram given below best describes the above scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*XqmJR1Y9IwDE5dsMVJ6bEQ.png" /></figure><p>You can perform a lot of other actions and get a lot of information about your account, functions, manipulate functions and lot more with this simple connector. If you feel like you need the connector not only for this specific purpose but others too then feel free to get from WSO2 store.<a href="https://store.wso2.com/store/assets/esbconnector/details/511c00f9-8529-4e50-b058-032deecdc802"> Link to the connector in store.</a></p><p>Will post another article soon on how to work with Amazon Lambda Connector using WSO2 Enterprise Integrator with complete information on working with it and configuring it.</p><p>You can see here for step-by-step guide to work with Amazon Lambda connector WSO2 EI .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65393cc80b25" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>