/tf_sg_app

Terraform module for security groups for app server (ports 22, 80, 443,)

Primary LanguageHCL

sg_web terraform module

A terraform module which contains rules for a common web application deployment.

Ports

  • TCP 22 (SSH)
  • TCP 80 (HTTP)
  • TCP 443 (HTTPS)

Input Variables

  • security_group_name - The name for your security group, e.g. bluffdale_web_stage1
  • vpc_id - The VPC this security group should be created in.

Usage

You can use these in your terraform template with the following steps.

  1. Adding a module resource to your template, e.g. main.tf
module "sg_web" {
  source = "github.com/terraform-community-modules/tf_aws_sg//sg_web"
  security_group_name = "${var.security_group_name}-web"
  vpc_id = "${var.vpc_id}"
  source_cidr_block = "${var.source_cidr_block}"
}
  1. Setting values for the following variables, either through terraform.tfvars or -var arguments on the CLI
  • security_group_name
  • vpc_id
  • source_cidr_block