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
  • HTTP URLs
  • 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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.