VPC module

The VPC module creates our private network inside AWS; we do not want to or need to expose the NATS server to the outside world, so we can create a private network that only allows the resources attached to that network to access it, as shown in the following code:

module "vpc" { 
  source = "./vpc" 
  namespace = "bog-chapter11" 

The source attribute is the location of the module; Terraform supports the following sources:

  • Local file paths
  • GitHub
  • Bitbucket
  • Generic Git and Mercurial repositories
  • S3 buckets

Following the source attribute, we can configure custom attributes, which correspond to the variables in the module. Variables are required placeholders for a module; when they are not present, Terraform complains when ...

Get Building Microservices with Go now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.