Lindsey  Koepp

Lindsey Koepp

1603594320

AWS API Gateway — Integrate Environments to Different Versions of the Same Lambda Function

Recently, I came across a small project. The requirements were perfect for a serverless implementation described in AWS Lambda functions and invoking it using AWS API Gateway.

I started drawing the flow and realized that, after going live, I won’t be able to make incremental changes to the same function directly as it may impact the production.

That means I would need at least one more environment apart from production to be able to test the changes safely before going live.

The quickest option was to create a new lambda function and copy the same code and then make the changes. This would have worked but then I had to create a separate API in API Gateway to integrate with this new lambda function. It also increases maintenance efforts and costs.

After a bit of research, I found a better way :)

As a first step, you need to create just one function in AWS Lambda.

Choose the required runtime and deploy the code.

Test the function to make its working.

I’m assuming you already know how to do that and skipping the detailed steps :)

Publish a new version

Go to the AWS Lambda function in AWS,

  • Scroll to the top and locate the “Actions” dropdown.
  • Click to expand it and choose “Publish new version”

Image for post

  • Enter a short description of the changes you made and click the “Publish” button

Image for post

#serverless #aws-lambda #versioning #aws-api-gateway

What is GEEK

Buddha Community

AWS API Gateway — Integrate Environments to Different Versions of the Same Lambda Function
Lindsey  Koepp

Lindsey Koepp

1603594320

AWS API Gateway — Integrate Environments to Different Versions of the Same Lambda Function

Recently, I came across a small project. The requirements were perfect for a serverless implementation described in AWS Lambda functions and invoking it using AWS API Gateway.

I started drawing the flow and realized that, after going live, I won’t be able to make incremental changes to the same function directly as it may impact the production.

That means I would need at least one more environment apart from production to be able to test the changes safely before going live.

The quickest option was to create a new lambda function and copy the same code and then make the changes. This would have worked but then I had to create a separate API in API Gateway to integrate with this new lambda function. It also increases maintenance efforts and costs.

After a bit of research, I found a better way :)

As a first step, you need to create just one function in AWS Lambda.

Choose the required runtime and deploy the code.

Test the function to make its working.

I’m assuming you already know how to do that and skipping the detailed steps :)

Publish a new version

Go to the AWS Lambda function in AWS,

  • Scroll to the top and locate the “Actions” dropdown.
  • Click to expand it and choose “Publish new version”

Image for post

  • Enter a short description of the changes you made and click the “Publish” button

Image for post

#serverless #aws-lambda #versioning #aws-api-gateway

Einar  Hintz

Einar Hintz

1599364620

API Integration Practices and Patterns

We all hear it so often that we almost stop hearing it: “Integration is critical to meeting users’ needs.”

Integration work consumes 50%-80% of the time and budget of digital transformation projects, or building a digital platform, while innovation gets only the leftovers, according to SAP and Salesforce. And as everyone from legacy enterprises to SaaS startups launches new digital products, they all hit a point at which the product cannot unlock more value for users or continue to grow without making integration a feature.

If I were to sum up the one question behind all of the other questions that I hear from customers, enterprises, partners, and developers, it would be something like: “Is integration a differentiator that we should own? Or an undifferentiated but necessary feature that supports what we’re trying to accomplish?”

This Refcard won’t try to answer that question for you. Rather, no matter what type of development work you do, API integration is a fact of life today, like gravity. Why? Today, experience is paramount. The average enterprise uses more than 1,500 cloud applications (with the number growing by 20% each year). Every app needs to integrate with other systems in a fluid and ever-changing application ecosystem. So instead, I’ll share some of the common practices you’re likely to contend with as well as some patterns to consider.


This is a preview of the API Integrations Practices and Patterns Refcard. To read the entire Refcard, please download the PDF from the link above.

#apis #api integration #integration patterns #api cloud #api patterns #api authentication #api errors #apis and integrations

Autumn  Blick

Autumn Blick

1601381326

Public ASX100 APIs: The Essential List

We’ve conducted some initial research into the public APIs of the ASX100 because we regularly have conversations about what others are doing with their APIs and what best practices look like. Being able to point to good local examples and explain what is happening in Australia is a key part of this conversation.

Method

The method used for this initial research was to obtain a list of the ASX100 (as of 18 September 2020). Then work through each company looking at the following:

  1. Whether the company had a public API: this was found by googling “[company name] API” and “[company name] API developer” and “[company name] developer portal”. Sometimes the company’s website was navigated or searched.
  2. Some data points about the API were noted, such as the URL of the portal/documentation and the method they used to publish the API (portal, documentation, web page).
  3. Observations were recorded that piqued the interest of the researchers (you will find these below).
  4. Other notes were made to support future research.
  5. You will find a summary of the data in the infographic below.

Data

With regards to how the APIs are shared:

#api #api-development #api-analytics #apis #api-integration #api-testing #api-security #api-gateway

Lindsey  Koepp

Lindsey Koepp

1603674601

Integrating API Gateway — Lambda Responses

Probably the most used, versatile and oldest combination between AWS cloud services is REST APIs (public) with Lambda integration on the backend [1]. While RESTful API development is not at all new, if you are relatively new to developing in the cloud, working with these two services may be somewhat challenging. This article requires a basic understanding of these two services. Its focus is beyond the point where you are able to invoke a Lambda function and receive status code 200 from the API. Given the availability of SNS and CloudWatch Logs, why would one bother integrating the API Method & Integration Responses past returning code 200? The answer is that would be a half implemented feature, which lets users speculating about what the result of the invocation was. This article shows how to program an API to return status codes that make sense to your application.

My Use Case

I shall focus on a Lambda function which may throw unexpected exceptions, errors and return a response. To make this more challenging, I am going to use Python. This language is a big hit with developers transitioning from traditional scientific and engineering roles, who have not used any “JS” languages. The intention is to create a foundation on which further API development can be done or at least leave the API in a minimum viable state.

My Solution

I started creating the Lambda function, which I called DanielHTTP. The function uses the latest Python runtime and the IAM policy AWSLambdaBasicExecutionRole which allows CloudWatch logs to be created. I created a role called the same and attached the policy. Alternatively, when this function is created, I could have selected Create New Role to have this done automatically. The function code is available in my GitHub repository [2]. The code is designed to throw an exception by performing an illegal operation, to raise exceptions and errors and to return an Ok response. All cases are individually handled in the API.

#api-gateway #api-development #api-integration #aws-lambda #aws

Anissa  Barrows

Anissa Barrows

1626931020

AWS API Gateway + Lambda /w TypeScript

AWS API Gateway + Lambda /w TypeScript

#aws api #api gateway #api #aws #typescript #lambda