Ludwig Tutorial 3: Internet Gateway

This tutorial is actually a Ludwig composition. You can download it here and fugue run it like you would any other composition. You can use lwc, the Ludwig compiler, to compile the composition.

If you’re interested in text editor plug-ins, you can find them here.


Let’s Go!

We’ll begin with the work from the last tutorial.


import Fugue.AWS as AWS
import Fugue.AWS.EC2 as EC2

my-vpc: {
  cidrBlock: "",
  region: AWS.Us-west-2

subnet1: {
  cidrBlock: '',
  vpc: my-vpc,
  availabilityZone: AWS.A,
  mapPublicIpOnLaunch: True

Following the same pattern as the VPC and subnet declarations, now an internet gateway is added. There is not much to say about an IGW, so this declaration is very small and easy.

my-igw: {
  vpc: my-vpc

Running and Compiling the Composition

You can run this composition with the following command:

fugue run Tutorial3.lw

This will create a VPC, subnet, and internet gateway in your AWS account.

Optionally, if you have a process running from previous tutorials, you can simply update the process like this:

fugue update [ALIAS or FID] Tutorial3.lw

To just check compilation, invoke lwc, the Ludwig compiler:

lwc Tutorial3.lw