OPA on AWS. Part 6 – Deploying Serverless APIs | Amazon Web Services
- March 8, 2024
- Posted by: MainInstructor
- Category: Amazon Web Services C Go Java JavaScript Python
Video Title: OPA on AWS. Part 6 – Deploying Serverless APIs | Amazon Web Services
Welcome back to the OPA on AWS video series I’m Anthony Watson a prototyping Solutions architect and a contributing developer on the OPA project in this video we’ll discuss applications that utilize a serverless architecture and I’ll walk you through how Opa can make using serverless even easier and faster
For context I’ll start by recapping what serverless architecture is and then we’ll look at some example use cases we’ll then see a demonstration of using Opa to create a serverless API and then we’ll finish with the discussion of how Opa benefits companies that are using serverless before we go any further
Let’s first level set and review what serverless is serverless is an architecture where AWS manages servers for you so you don’t have to serverless architectures scale automatically so there’s no need for you to worry about that either customers only get charged for resources that are actually used to
Process requests this can save you money during periods of low usage of your application serverless deployments are typically simpler as as well since all you have to do is upload your code and configuration changes and AWS takes care of the rest due to its Simplicity and the additional responsibilities that AWS
Takes on for you serverless applications can often have a faster time to Market so what are some examples of applications that are a good fit with serverless one example is a website as opposed to setting up a web server using Technologies like engine X or Apache web server serverless allows you to utilize
An S3 bucket to serve your website files you can even put a Content delivery Network or CDN in front of your S3 bucket to provide caching and reduce latency by serving your files from The Edge other common examples that utilize serverless architectures are event driven and message processing systems data processing and workflow
Orchestrations and restful and graphql apis AWS also provides a serverless key value database called Dynamo DB for more information on serverless visit the the official AWS serverless website at this URL now it’s time to see Opa in action with the serverless application in this demo I’ll take on the Persona of an
Application developer who is a coding wizard but not a cloud expert this developer wants to create a restful API and have it just work on the AWS cloud from the OPA homepage I will click that I want to create my app Opa shows me several templates that I can use to
Create things I’ll now filter this list down to templates that will create a rest API I can see from the description that this template is what I’m looking for so I will select it before we continue let’s compare the developer experience we just saw with a developer portal to a developer experience without
A developer portal many organizations start to create platform standards based only on reusable scripts let’s see how this can often play out here we have a platform engineer who says I’ve created a great new reusable script now my teammates can all use this to solve problem XY Z now let’s see what happens
When developers go to use that script we’ll illustrate this with a conversation between developers I think there’s a script out there to scaffold a new app but I’m not sure where it is I think it’s on the wiki where on the wiki I don’t know I can never find what I’m
Looking for on that thing now we have a new developer join the conversation who says I have the script I used it six months ago here you go thanks now I just need to figure out what parameter values to pass into the script an hour later
Okay I think I’ve got it let’s run this thing and then he proceeds to run an outdated version of the script that no longer works a developer portal can prevent the pitfalls we just witnessed by providing a single place for reusable assets so that they are always easy to
Find also since the portal can sync with Git repositories where assets are stored users will always make use of the latest asset versions finally portals allow for a wizard-driven approach that can help guide users on the appropriate values to input into into a reusable template this is a perfect segue back to our
Demonstration where the developer will provide information for Opa to use to create the new rest API we can see that Opa displays a form that asks the developer to enter information about the new API it’s important to note that the questions asked on this form are specific to an API application template
That was previously created by a platform engineer the platform engineer can customize the new application wizard to ask the developer to input any additional information that is needed to generate a new application I’m feeling a bit hungry so let’s name our new API snacks and we’ll describe it to say that
It’s going to return a list of yummy snack foods next I need to pick an application owner and the value I choose here affects which group can log in the developer portal and View and interact with this app I’m going to pick the developers group Next I need to pick an
Initial environment that my application will be deployed to to in this example let’s say I’m a member of the API team so I’ll pick my team’s developer environment the last step is that I will need to enter a name of a git repository that’s going to be created for this
Application I’ll go ahead and say Yes I want to create and we now see that Opa has begun working on creating the new API and that the process is moving very quickly now that it is finished we can open our snacks API initially Opa displays only summary details about our
API and this is because the process of staging our application in the AWS cloud has not completed yet we can see that by looking at the applications cicd pipeline which shows as running I don’t need to wait for the cicd pipeline to complete before I begin customizing the
Apps code instead I’ll grab the git command to clone the apps repository and execute it I’ve cloned the snack API repository to my laptop and now I will edit the code in my IDE of choice with serverless applications custom code logic is defined inside a Lambda function the learning curve for using
Lambda functions is extremely small because it’s no different from writing a plain old function in any programming language Lambda supports for example Lambda supports languages such as python Java JavaScript goang and C our snacks API is written in JavaScript I will now edit it to return some yummy snacks here
We can see the definition of our Lambda function as we can see the function takes a vent as an input parameter and it’s going to return a HTTP Response Code some HTTP response headers and a body that’s just an array of Json data so in this case we want to return snacks
So I’ll update the data with some snack ideas okay so now that we’ve updated the data to be snack data now we need to update the path that the API is listening on we’ll go into our definition of our API and we’ll change this p path to snacks I’m now ready to
Test the changes using a free CLI tool called Sam CLI I can execute the snacks API on my laptop before I even push my changes to AWS Sam CLI uses Docker containers to emulate running lambdas in the cloud let’s make sure the API is working properly I can see that Sam is
Running my API on Local Host now I’ll try to hit that API great you can see my gummy worms and my chip and salsa the changes that I made are working properly now I’ll go ahead and commit my changes to get and utilize Opa to deploy those
Changes to the AWS Cloud when I merged my changes to G my application cicd pipeline built my application so that it is ready for deployment to AWS I’ll now start the deployment to the dev environment Opa will continuously pull to let us know the progress that it is
Making on the deployment I’ll pause here until it completes all right the deployment was successful and we can see that Opa is showing us that our application is live let’s click the link to hit the API on the AWS Dev environment to make sure it is returning our snacks awesome we’re seeing our
Snack data as a developer I’ll frequently want to see my applications logs so let’s see how I can do that I’ll go ahead and click on the logs tab my logs come up in order so I’ll look at the latest log and I have access to
Those logs I may also want to see an audit trail of what activities have been taken against my application if we click on the audit tab we can see a trail of activities here we see that the applications stack was created on this date by this person now let’s see what
Actions I can take to manage my app click on the management Tab and we can see that I have the ability to add a QA environment or any other environments that have been set up I can add those to my cicd pipeline to deploy to those environments without me having to make
Any any code changes at all next we can see that I have an option to bind resources if I had things like a database setup here that I wanted my application to be able to access I can go through this wizard to add access to that database from my app and then
Finally I can delete my app from just the dev environment or from all environments that it is deployed to in closing let’s recap the benefits Opa provides for developers the latest version of your organization’s reusable assets and templates are available in one place no more searching next application cicd pipelines that can
Deploy to one or more AWS environments are provided out of the box without the developer needing to write any code these pipelines are stored in the applications repository though in case the developer wants to customize them developers have a single pane of glass with easy access to all the things
They’ll frequently need this enables developers to take actions like viewing application logs deploying the latest version of their app to an environment enironment cloning the application’s get repository viewing application audit Trails seeing what cloud resources make up their app and getting a link to the running app for a specific environment
Developers can also use the portal to answer questions like which environments are is my application running in and when was my application last updated in a given environment overall Opa enables developers so that they can focus on the code not the cloud thank you for watching this video on Opa
For serverless application developers stay tuned for the next video in our series
Video Keywords: Amazon Web Services
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99