AWS San Francisco Summit- DEM308
Accelerate frontend web and mobile development with AWS Amplify - User-facing web and mobile applications are the primary touchpoint between organizations and their customers. To meet the ever-rising bar for customer experience, developers must deliver high-quality applications with both foundational and differentiating features. AWS Amplify helps frontend web and mobile developers build full-stack applications faster. This session reviews AWS Amplify’s core capabilities, including authentication, data, file storage, and geolocation, and introduces new capabilities such as extensibility features for easier backend customization with AWS services. See how you can now visually build your application front to back, from developing the frontend UI to configuring the application backend and connecting them with the new Amplify Studio.
AWS San Francisco Summit- MAD201
Best practices for continuous testing and observability – In this session, discover how to improve the resiliency of your applications through continuous resilience testing. Learn best practices for continuous testing using testing and observability tools such as AWS Fault Injection Simulator and Amazon DevOps Guru.
Co-presented with Adnan Bilwani.
Building Raspberry Pi Docker Images in AWS CodeBuild
I have a few Raspberry Pis around the house doing various tasks and wanted to automate Docker image builds using AWS CodeBuild. I assumed I could build on the Graviton ARM instances and run on the Pi. It works with the raspbian/stretch base image, but the Raspbian images are not actively maintained. When I switched to alpine base image, I started getting this error on the Pi.
standard_init_linux.go:207: exec user process caused “exec format error”
Running Redshift RSQL is a Fargate Container
RSQL is a command-line client for Redshift. Unlike the psql command-line, RSQL has control flow commands (IF, ELSE, GOTO, etc.) that are useful for ETL jobs. I want to run RSQL in a Fargate container so I call it from Step Functions ETL workflow. Overall this was fairly straight forward, but I’ll document it anyway.
Setup
In my use case, I am converting hundreds of Teradata BTEQ scripts to RSQL using the Schema Conversion Tool (SCT). These scripts have interdependencies and must be in the same the folder. Therefore, I copied them all to an EFS volume. If the scripts were stand alone, I would prefer to put them on S3.
AWS re:Invent 2021 - DOP306
Implementing release management strategies for CI/CD Pipelines Workshop – This workshop will guide you through building CI/CD Pipelines with release management best practices, including artifact management as well as zero downtime release promotion and rollback mechanisms. We will evaluate various rollback/roll forward strategies across compute types and assess the need for manual processes.
The workshop instructions are here.
Co-presented with Viyoma Sachdeva.
AWS Amplify Download Api
AWS Amplify is a framework to accelerate web and mobile application development. I needed to build an API that would return a binary object. Specifically, it allows me to download a PDF file. I could not find an example so I am documenting it here. In the end it was crazy simple. You just need to add a single line "BinaryMediaTypes": ["application/pdf"]
to the AWS::ApiGateway::RestApi
resource in the CFN template created by Amplify. You should make this change after Amplify generates the API but before you push it to AWS.
AWS Serverless Demo Applications
I published a post this summer with a few simple demo applications I use when configuring AWS infrastructure. I needed something similar for a serverless application on AWS. In other words, a Lambda function sitting behind an API Gateway or Application Load Balancer (ALB).
I tend to use this simple Node.js function. It will return whatever it received as input. This is useful when you are debugging the infrastructure. For example, configuring Cognito with API Gateway or OIDC with ALB.
Connecting to AWS IoT Core from Arduino
Every Halloween my kids and I build some kind of decoration to scare everyone. The past few years we have been evolving a pneumatic wolf head that pops up and scares you. Then, it takes a picture of you looking silly. It was based on a RaspberryPi and AWS IoT. This year I wanted to move to Arduino, but I could not find instructions for connecting to AWS IoT from the Arduino.
Connecting to RDS SQL Server from a .NET 5 Application on Linux
AWS Directory Services allows you to join AWS resources to Microsoft Active Directory. This includes Amazon Relational Database Service (RDS), Amazon FSx, Amazon Workspaces, Amazon Appstream 2.0, Amazon Connect, Amazon QuickSight, Amazon WorkDocs, Amazon WorkMail, and of course Amazon Elastic Compute Cloud (EC2) Windows instances. In addition, AWS recently announced the ability to Seamlessly Domain Join Linux EC2 Instances.
As I modernize .NET applications by moving to .NET 5 and Linux, I can continue to leverage Active Directory for credential management. Seamless domain join for EC2 Linux greatly simplifies the undifferentiated heavy lifting of configuring these architectures. This post will explore how to connect to RDS for SQL Server from a .NET 5 application running on EC2 Linux, using domain credentials.
Replay Recorded Requests with JMeter
I need to run a load test against Redshift. However, rather than repeatedly running a few sample queries, I want to replay all queries from the audit log over a period of time. I had never tried to do this in JMeter so it took a little hacking to get it working. I’m running this against Redshift, but the logic should apply to any workload. For example, you could use your web server logs to replay HTTP requests.
Simple Demo Applications
When doing a customer demo, I often need a simple app. Generally I am discussing the infrastructure – Elastic Load Balancer, API Gateway, etc – and the application is unimportant. I have found that phpinfo is a great sample application because it shows the headers received by the server. This allows me to see x-forwarded-for headers, etc. On Windows, ASP.NET Tracing provides similar results. Keep in mind that these utilities expose a lot of info about your environment so use them wisely.
Multi-Tenant Elasticsearch
I have been working on multi-tenant OpenSearch (a.k.a. Open Distro for ElasticSearch) project. This article (https://www.elastic.co/blog/found-multi-tenancy) (from 2015) outlines a few isolation models and the issues you are likely to hit with each. Below I look at two options: one index per tenant and multiple tenants per index with document level security – a feature of OpenSearch.
Provisioning
I created a simple single-node Elasticsearch cluster on a t3.small. This is really small but I want to put pressure on the system and see how it scales. In the samples below, assume the VPC endpoint is https://vpc-test-xxxxxx.us-east-1.es.amazonaws.com and the username:password is admin:password.
Case-sensitivity in Aurora PostgreSQL
When moving from SQL Server to PostgreSQL a common issue is case sensitivity. PostgreSQL 12 adds support for nondeterministic collations. These are my notes from testing various scenarios in Aurora. In my opinion CITEXT is still the best option despite native support.
Create some test data
First, Create a new Case Sensitive and Case Insensitive collation. Technically these exist under other names, but I thought his was more clear in the examples. The important part is the deterministic flag. This is Unicode speak for compare the bytes (true) or compare the logical values (false).
Lambda Cold Start for ASP.NET (Part 3)
In this final post I’ll list a few additional optimizations for reducing the first invocation times. See part one and two for more details.
Burst CPU
According to this video Lambda functions get additional CPU during the initialization phase. That extra CPU can help with JIT compilation but .NET lazy compiles code as it encounters it. Therefore, the function handler is not compiled until it’s executed, which is after the CPU is constrained.
AWS Public Sector Webinar 2021
Enterprise Analytics workshop - Webinar on moving a data warehouse from SQL Server to Redshift using Database Migration Services (DMS) and Schema Conversion Tool (SCT).
GitHub Actions for AWS, Azure and GCP
I’m abandoning the multi-cloud blog hosting model that I was using in favor of AWS Amplify to simplify TLS configuration. But I thought I should document the old approach a little further in case I ever go back to it.
The build pipeline for my blog fails every once in a while. For example, there was an issue with the Azure CLI earlier this month. Each time that happens it takes me a few minutes to remember how the pipeline works. Therefore, I am documenting it quickly in this post.
Lambda Cold Start for ASP.NET (Part 2)
In part one, I looked at what happens the first time an ASP.NET application is invoked in Lambda. When we left off, we had a roughly 3 second initial response time. In this post I’ll focus on the initialization phase and part three will focus on invocation.
ReadyToRun
As I mentioned earlier, one cause of long cold start times in .NET is Just In Time (JIT) compilation. As each .NET assembly is loaded, the runtime converts the Intermediate Language (IL) into machine code for the specific platform it is running on. ReadyToRun tells the compiler to generate machine code at compile time. This allows us to skip that step during initialization. Note that you must compile on the same platform you plan to run on. Therefore, we must build on a Linux machine for this to work in Lambda. I am using CodeBuild to build my project. I can enable ReadyToRun by adding the following to the PropertyGroup of my project file.
Lambda Cold Start for ASP.NET (Part 1)
The ability to host an ASP.NET project in AWS Lambda is a great way to get started with serverless. However, cold starts can result in a slow first invocation of the ASP.NET function. In this post I’ll set up a typical, albeit simple, application to gather benchmarks. In part two and three, I will explore a few options to speed up initialization and invocation respectively.
Background
A Lambda function is fundamentally different from a traditional application. Most important to the topic of Cold Starts is how an application is initialized. On a traditional web server, the application is initialized before it goes into service. The first invocation may be a little slower as caches warm up, but the application itself was already running. In Lambda, the application is initialized when the first invocation arrives. The request is enqueued, Lambda copies your application into a container, initializes the application, and then forwards the request to the container. The same thing happens as Lambda scales out and adds new containers. For subsequent invocations the application is already running the response is much faster. Often one or two orders of magnitude faster.
Using Amazon Rekognition with .NET 5 Video
I just published a video to YouTube showing how to use Amazon Rekognition with .NET 5 applications.
Building Linux Docker Containers on EC2 Windows
In the post, I will show you how to build a Linux container in Visual Studio running on a EC2 Windows Instance.
The AWS Toolkit for Visual Studio allows you to deploy your project to Elastic Container Service (ECS) Fargate and recently as a container image to AWS Lambda among other options. In both of these cases, you must build a Linux container from Visual Studio or the dotnet command line. If you are working in Visual Studio on Windows, Docker Desktop uses a Linux container running in Hyper-V to build the container. Unfortunately, Hyper-V does not run on EC2 Instances (though it will run on EC2 bare metal).
AWS VPN on UniFi Security Gateway
I recently upgraded my home network from the Ubiquiti EdgeRouter to the UniFi Security Gateway (USG). Similar to the EdgeRouter, the USG supports most common configuration tasks from the web UI, but advanced configuration is only available from the command line. While you can configure a VPN tunnel to AWS from the UI, it does not allow you to configure redundancy or Border Gateway Protocol (BGP). With everyone quarantined – working and learning from home – I have been struggling to find time to hack the router. So, with the holiday weekend upon us, I finally had time to dive in.
AWS Modernization Workshop For .NET
I had the privilege of working with four talented interns, Anjan Amarnath, Aravind Ramalingam, Chihao Sun, and Hongyi Li this summer to build a workshop on .NET Modernization.
In this workshop, you will migrate a monolithic .NET framework application to a microservices-based .NET Core application on AWS by applying the Strangler Fig Pattern. After completing this workshop, you will have the skills to feel more comfortable modernizing your legacy .NET Framework applications using AWS services and features including Amazon Cognito, Amazon API Gateway, AWS Lambda, Amazon DynamoDB, Amazon Aurora, Amazon Elastic Container Service, AWS Schema Conversion Tool (SCT), AWS Database Migration Service (DMS), and others.
Pearson OnVUE Broke Mac Mission Control
Pearson OnVUE Broke Mac Mission Control
Pearson has started offering Online Proctored exams. You download the OnVUE application and take the exam from the comfort of your home. This sounds great, but the actual experience was poor. Here is how to fix Mission Control and App Expose after taking an exam.
I took an exam last week. I won’t mention which because I have not passed it yet. I have never failed a certification exam, but I am superstitions and never talk about an exam until I clear it. I uploaded a few pictures of my work area and downloaded the OnVUE app. It asks you to close any running applications before the exam starts, and a proctor watches you while you take the exam.
The Quilt 2020 Winter Meeting
I’ll be presenting The Quilt Member Meeting in San Diego today. I’ll cover the following topics:
- Overview of AWS Global Infrastructure
- Recent Announcements – Local Zones
- Recent Announcements – Wavelength
- Recent Announcements – Outposts
- Recent Announcements – HPC Advances
- Partnership Opportunities for RENs