Difficulty: Beginner
Estimated Time: 30 minutes

Build a Module

This Katacoda scenario is meant to serve as a companion piece for the Build a Module Terraform Learn tutorial.

In this scenario, you will create a module to manage AWS S3 buckets used to host static websites.

This environment has been pre-configured with the Terraform CLI, AWS CLI and localstack, a mocking framework that mocks core AWS APIs locally. As a result, you do not need an AWS account to complete this scenario.

Congratulations!

You've reached the end of the scenario!

If you'd like to learn more, try one of these resources on HashiCorp Learn:

Build a Module

Step 1 of 4

Explore configuration

Open main.tf.

This configuration includes three blocks:

  • The provider "aws" block defines your defines your provider and region. It also includes additional settings that allow this scenario to use localstack to simulate infrastructure, instead of requiring you to have an AWS account. Refer to the code in the Learn tutorial to build real infrastructure, which will require you to authenticate with AWS.

  • The module "vpc" block defines a Virtual Private Cloud (VPC), which will provide networking services for the rest of your infrastructure.

  • The module "ec2_instances" block defines two EC2 instances within your VPC.