Skip to main content

Writing Cost-Conscious Terraform Using Infracost and AWS Developer Tools

· 8 min read
Scottie Enriquez
Director, Cloud FinOps at SiriusXMLos Angeles, CA

Solution Overview

My current role focuses on every facet of AWS cost optimization. Much of this entails helping to remediate existing infrastructure and usage. Many customers ask how they can shift left on cloud costs, like they do with security. Ultimately, cost consciousness needs to be injected into every aspect of the engineering lifecycle: from the initial architecture design to implementation and upkeep.

One such aspect is providing developers visibility into the impact of their code changes. Infrastructure as code has made it easy to deploy cloud resources faster and at larger scale than ever before, but this means that cloud bills can also scale up quickly in parallel. This solution demonstrates how to integrate Infracost into a deployment pipeline to bring cost impact to the pull request process and code review discussion. The source code is hosted on GitHub.

A CDK Companion for Rahul Nath's .NET Lambda Course

· 6 min read
Scottie Enriquez
Director, Cloud FinOps at SiriusXMLos Angeles, CA

The Course and Companion

Rahul Nath recently released a course called AWS Lambda for the .NET Developer on Udemy and Gumroad. I had a ton of fun going through the exercises and highly recommend purchasing a copy. While working through the material, I implemented the solutions with infrastructure as code using AWS CDK in C# and .NET 6. I also containerized most of the Lambda functions and wrote unit tests for both the functions and infrastructure. You can find all my source code on GitHub.

Configuring AWS SAM Pipelines for GitHub Actions

· 5 min read
Scottie Enriquez
Director, Cloud FinOps at SiriusXMLos Angeles, CA

About AWS SAM Pipelines

Last week, AWS announced the public preview for SAM Pipelines. This feature expands the SAM CLI allowing users to create multi-account CI/CD pipelines for serverless applications quickly across several providers such as GitHub Actions, GitLab CI/CD, and Jenkins. Along with CDK Pipelines, the AWS tooling keeps making it easier to standardize with best practices.

Exploring CDK for Terraform for .NET

· 4 min read
Scottie Enriquez
Director, Cloud FinOps at SiriusXMLos Angeles, CA

Overview

Both AWS CDK and Terraform aim to solve a similar problem: alleviating some of the infrastructure management challenges with code. CDK supports several general-purpose languages, including C#, Python, and TypeScript, while Terraform uses its configuration language called HCL. While CDK can only create AWS resources, Terraform supports virtually every cloud provider, granting the ability to write code to deploy to multiple public clouds at once. Last year, Terraform and AWS announced a project called Terraform for CDK, aiming to grant the best of both worlds (i.e., support for GPLs, multi-cloud, etc.).

.NET 5 Docker Lambda Function with API Gateway and Self-Mutating Pipeline Using CDK

· 9 min read
Scottie Enriquez
Director, Cloud FinOps at SiriusXMLos Angeles, CA

Deciding on Which Technology to Use

While infrastructure as code (IaC) has existed within the AWS ecosystem since 2011, adoption has exploded recently due to the ability to manage large amounts of infrastructure at scale and standardize design across an organization. There are almost too many options between CloudFormation (CFN), CDK, and Terraform for IaC and Serverless Application Model ( SAM) and Serverless Framework for development. This article from A Cloud Guru quickly sums up the pros and cons of each option. I choose this particular stack for some key reasons:

  • CDK allows the infrastructure and the CI/CD pipeline to be described as C# instead of YAML, JSON, or HCL
  • CDK provides the ability to inject more robust logic than intrinsic functions in CloudFormation and more modularity as well while still being a native AWS offering
  • Docker ensures that the Lambda functions run consistently across local development, builds, and production environments and simplifies dependency management
  • CDK Pipelines offer a higher level construct with much less configuration than CodePipeline and streamline management of multiple environments

AWS re:Invent 2020

· 11 min read
Scottie Enriquez
Director, Cloud FinOps at SiriusXMLos Angeles, CA

Contents

  • Container Support for Lambda
  • Introducing AWS Proton
  • EC2 macOS Instances
  • First-Class .NET 5 Support for Lambda
  • CloudShell

Cloud9 IDE Configuration

· 3 min read
Scottie Enriquez
Director, Cloud FinOps at SiriusXMLos Angeles, CA

Cloud9 Overview and Use Cases

Per AWS, “Cloud9 is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a browser. It includes a code editor, debugger, and terminal. Cloud9 comes prepackaged with essential tools like Docker and support for popular programming languages, including JavaScript, Python, PHP, and .NET.” The AWS, Serverless Application Model (SAM), and Cloud Development Kit (CDK) CLIs are pre-installed as well. Users are abstracted from credential management (i.e., there’s no need to provision an IAM user and run aws configure). Since the underlying compute is an EC2 instance, developers have a consistent experience across client devices.

Using Former2 for Existing AWS Resources

· 5 min read
Scottie Enriquez
Director, Cloud FinOps at SiriusXMLos Angeles, CA

Overview

I’ve been making a concerted effort lately to use infrastructure as code via CloudFormation for all of my personal AWS-hosted projects. Writing these templates can feel a bit tedious, even with editor tooling and plugins. I thought it would be awesome to generate CloudFormation templates for existing resources and first found CloudFormer. I found blog posts about CloudFormer from as far back as 2013, but it was never advertised much.

Update: Former2 is the de facto standard now that CloudFormer has been deprecated. I kept my notes on CloudFormer for posterity at the end of the post.