Using AWS Lambda for PowerShell To Get Data From Microsoft SQL Instance

Standard

I’ve got many PowerShell scripts I’ve written over the years but one of the most useful was to simply get data from a Microsoft SQL server and another to insert or update data. This is an example of modernizing a script I wrote over 5 years ago to now run on serverless computing with AWS Lambda. In addition I can use API Gateway and Lambda to create a serverless interface to a Microsoft SQL instance. I’ve tested this with an Amazon RDS MS SQL standard instance within a VPC, a Lambda function with an ENI within that VPC, and API integration with Lambda. Additionally the security group on the RDS instance will need to allow port 1433 with the source being the Lambda function security group. With this combination of components I can do an HTTPS get request to the API which reads from a MSSQL database. This is also very useful for decoupling, migration, and adopting a microservices architecture.

Continue reading

AWS CodeBuild for PowerShell

Standard

As I’ve been building more AWS Lambda for PowerShell functions I’m wanting to automate testing and deployment with Continuous Integration and Continuous Deployment, a CI/CD Pipeline. To do this one of the steps we’ll need to do is use the AWS Lambda PowerShell cmdlet New-AWSPowerShellLambdaPackage which will package up our script with all it’s dependencies into a zip file. I’ll want to run this on a build environment within AWS CodeBuild. Unfortunately there’s not a PowerShell specific runtime in CodeBuild yet. However, we can utilize the existing .NET 2.2 runtime provided and install PowerShell on it. With that we can run our PowerShell scripts on CodeBuild to build our functions artifacts.

Continue reading

AWS Lambda for PowerShell Encrypted Environment Variables

Standard

Recently I was developing a AWS Lambda for PowerShell function to read a table from a Microsoft SQL on RDS Instance within a VPC. Using the .NET Core SQL client I need to provide credentials to access the database. For the password it should be stored encrypted at rest, never in plain text, and when passed to the function should be done so as a secure string. We can configure the function to use KMS for encryption at rest. This presents us with two challenges. How do I encrypt a AWS Lambda environment variable and how will my AWS Lambda for PowerShell function securely get the decrypted value in memory as a secure string when the Lambda function is invoked.

Continue reading

New Fitch.Tech Domain Name

Standard

I was able to register a new domain to shorted my URL. https://Fitch.Tech is now live! https://FitchTech.com now redirects to the new domain. I love all the new root domain options available.

Testing PS Core Cross-Platform Support using VS Code with WSL PWSH and Windows PS Terminals

Standard

When working with PowerShell using Visual Studio Code it’ll default to the old PowerShell terminal. By using $PSVersionTable we can see it’s running PowerShell 5.1 but we’ll want 6.2. Also I wan’t to test using PowerShell Core on both Windows and Linux. To use .NET Core and PowerShell Core together and test cross platform development we’ll need to install PowerShell Core and the .NET Core SDK on Windows 10 and also within the Windows Subsystem for Linux (WSL).

Continue reading

Essential Cloud Development Tools for Windows 10 Users

Standard

The combination of Docker Desktop, Windows Subsystem for Linux (WSL), and Visual Studio Code with extensions is extremely powerful!

I seen that a lot of software developers use Mac, and I’ve used Macs too. However now that Microsoft has a focus on open source, everything has changed. Windows 10 can leverage many Linux distros with the WSL. Using PowerShell and the Bash Shell natively is amazing. We will still leverage virtualization on Windows utilizing Hyper-V for Linux Docker containers, however we can still use the WSL with Docker Desktop. There’s extra configuration needed to make it work. This is due to limitations of WSL not being able to run daemons as a service. Regardless this is the best development experience I’ve seen as I can run locally just as easily as in the cloud and I know though my testing it’ll work the same. The portability of containers solves a lot of challenges.

Here I’ll show you the essentials of preparing your Windows 10 computer for modern applications development in the cloud.

Continue reading

AWS Toolkit for Eclipse Installation

Standard
Lately I’ve been focused on JavaScript and Node.JS so I installed the Eclipse for JavaScript. The Eclipse JavaScript IDE does not have the required dependencies for the AWS Toolkit for Eclipse as it’s designed for Java Developers. If you’ve attempt to install the AWS Toolkit for Eclipse and get errors it’s probably because you did not install the Java Eclipse build and the dependencies aren’t installed. However, you can still use the toolkit. Before you can install the AWS toolkit the Maven Integration for Eclipse (M2E) and JUnit tools for Eclipse need to be installed. There’s a few steps that need to be performed to prepare your Eclipse environment.

The following steps will add the Eclipse IDE dependencies and the AWS Toolkit for Eclipse.

Continue reading