AWS CDK: Place a Lambda function in specific subnets

I struggled for a while today to figure out how to place a lambda function inside of a given SubnetType of a VPC generated in the same CDK stack. To specify subnets for a lambda function it needs a SubnetSelection object passed in. I expected to find a method of ec2.VPC() which would give me an output with the type SubnetSelection but this doesn’t exist. After some reading of other people’s posts online I found an example which showed what I needed to do:...

January 27, 2021 · 1 min · chart

AWS CDK: Python Tips, Tricks, and Examples

Examples Official CDK Python Examples: https://github.com/aws-samples/aws-cdk-examples/tree/master/python Unofficial CDK best practices: https://github.com/kevinslin/open-cdk Basics Read the docs! Run the following command to open the CDK docs in your browser: cdk docs Set the deployment region In the app.py in the root of your CDK construct: add env={‘region’: ‘us-east-2’} to your ConstructStack(…). At time of writing this is on line 9 by default. It should look something like this: app = core.App() MyConstructStack(app, "my-construct", env={'region': 'us-east-2'}) Install new packages When working with a new services you may need to install them with a command similar to the one below:...

January 11, 2021 · 2 min · chart

Learning the AWS CDK

CloudFormation written in Python? Yes! After using the CDK for a bit, I believe it will be replacing CloudFormation for most AWS IaC in the coming years. The CDK is a layer of abstraction built on top of CloudFormation(CF). It allows you to write a condensed, but more powerful form of CF in one of several programming languages(JavaScript, TypeScript, Python, Java, and C#). You utilize AWS Constructs to more concisely deploy infra....

January 11, 2021 · 1 min · chart

Transfer QuickBooks 2008 to a new Windows 10 Computer

My dad got a new Windows PC for Christmas and requested help with installing QuickBooks 2008 pro so he wouldn’t have to pay to upgrade, here are the steps. Here I’ll describe how to transfer a previously purchased QuickBooks 2008 to a new Windows computer. This process is somewhat convoluted, if you aren’t coming from and IT background please read each step carefully. I hope this guide helps save you some time and Merry Christmas!...

December 30, 2020 · 2 min · chart

WSL 2 Docker running slow

Yesterday I discovered my new Alpine Linux WordPress container had terrible latency when loading any pages. Running docker stats I could see the issue was not related to resources. A google search brought up this issue on the WSL GitHub project. It turns out there are very low throughput speeds when accessing the Windows file system in a WSL container. This is exactly what I was doing, hosting my WordPress files on the Windows file system instead of in WSL’s file system....

December 23, 2020 · 1 min · chart

Quick bash script for testing URL status code

Here is a quick script I have written in Bash to get URL status codes. An application in a container I have been working was failing to retrieve a file from somewhere on the internet. I needed to determine if the issue was with the container(possibly networking related) or the application. I threw together this little reusable script utilizing curl.

December 17, 2020 · 1 min · chart