AI News, Viktoria Semaan Talks About Her 5 AWS Certifications! artificial intelligence

Use IAM Access Analyzer to generate IAM policies based on access activity found in your organization trail

Post Syndicated from Arthi Jaganathan original https://aws.amazon.com/blogs/architecture/field-notes-three-steps-to-port-your-containerized-application-to-aws-lambda/ AWS Lambda support for container images allows porting containerized web applications to run in a serverless environment.

This gives you automatic scaling, built-in high availability, and a pay-for-value billing model so you don’t pay for over-provisioned resources.

If you are currently using containers, container image support for AWS Lambda means you can use these benefits without additional upfront engineering efforts to adopt new tooling or development workflows.

You can continue to use your team’s familiarity with containers while gaining the benefits from the operational simplicity and cost effectiveness of Serverless computing.

This blog post describes the steps to take a containerized web application and run it on Lambda with only minor changes to the development, packaging, and deployment process.

In this blog post, you will learn how to port the containerized web application to run in a serverless environment using Lambda.

It follows security best practices by running the application as a non-root user and exposes the invoice generator service on port 4567.

```bash docker run -p 4567:4567 ruby-invoice-generator ``` In a real-world scenario, the order and customer details for the invoice would be passed as POST request body or GET request query string parameters.

--header 'Accept: application/pdf' ``` This command creates the file invoice.pdf in the folder where you ran the curl command.

This means the function handler is still the entry point to application logic when you package a Lambda function as a container image.

Also, by moving our business logic to a Lambda function, we get to separate out two concerns and replace the web server code from the container image with an HTTP API powered by API Gateway.

} end ``` If you need a reminder on the basics of Lambda function handlers, review the documentation on writing a Lambda handler in Ruby.

This completes the new addition to the development workflow—creating a Lambda function handler as the wrapper for the business logic.

Amazon ECR is a fully managed container registry, and it is important to note that Lambda only supports running container images that are stored in Amazon ECR;

Because the function handler is the entry point to business logic, the Dockerfile CMD must be set to the function handler instead of starting the web server.

The runtime interface client is an open-source lightweight interface that receives requests from Lambda, passes the requests to the function handler, and returns the runtime results back to the Lambda service.

This image follows best practices for optimizing Lambda container images by using a multi-stage build.

However, to keep the image as slim as possible, we recommend that you install it locally, and mount it while running the container instead.

chmod +x ~/.aws-lambda-rie/aws-lambda-rie ``` Use the Docker run command with the appropriate overrides to entrypoint and cmd to start the Lambda container.

-d '{}' ``` You will see a JSON output with the base64 encoded value of the invoice for body and isBase64Encoded property set to true.

This deployment workflow is very similar to any other containerized application where you first build the image and then create or update your application to the new image as part of deployment.

In this blog post, we learned how to port an existing containerized application to Lambda with only minor changes to development, packaging, and testing workflows.

For teams with limited time, this accelerates the adoption of Serverless by using container domain knowledge and promoting reuse of existing tooling.

We also saw how you can easily bring your own runtime by packaging it in your image and how you can simplify your application by eliminating the web application framework.

Automating Your Home with Grafana and Siemens Controllers

Imagine that you have access to a digital twin of your house that allows you to remotely monitor and control different devices inside your home.

As an example, we will monitor environmental conditions, including temperature and humidity sensors, thermostat settings,light switches, as well as monthly water and energy consumption.

We will go through the architecture and steps required to integrate different building components to store data for historical analysis, enable voice control, and create interactive near real-time dashboards showing a digital representationof your house.

It could serve as a starting point for building a home automation solution using AWS IoT and Grafana and further customized based on customer needs.

If your home automation equipment sends data in the standard decimal format, then AWS IoT Core can directly write data to other AWS services without Lambda.

Timestream is a serverless time series database service that is optimized for high throughput ingestion and has built-in analytical functions.

Timestream query example to retrieve humidity values and timestamps for the past 24 hours: SELECT measure_value::double as humidity, time FROM "myhome_db"."livingroom"

WHERE measure_name='humidity' and time >=ago(1d) To retrieve data from AWS IoT SiteWise, you can select asset properties from the asset navigation tab, which makes it simple for non-technical users to build dashboards.

One of the common issues of operational dashboards is that it’s hard to get a physical representation by looking at a cluster of multiple readings.

You can upload a picture of your house or a system and drag sensor readings to their exact locations, thus creating digital representations of physical objects.

In this blog, we reviewed how you can create a digital twin of your home automation or industrial systems using Siemens controllers, AWS IoT, and Grafana dashboards.

controller to AWS gives it access to the Internet of Things (IoT) and opens many potential applications such as anomaly detection, predictive maintenance, intrusion detection, and others.