Commit abb27a84 authored by Anton Babenko's avatar Anton Babenko

Fixed #1 - done

parent 08901240
...@@ -6,36 +6,28 @@ Terraform module which creates [EC2 security group within VPC](http://docs.aws.a ...@@ -6,36 +6,28 @@ Terraform module which creates [EC2 security group within VPC](http://docs.aws.a
These types of resources are supported: These types of resources are supported:
* [EC2-VPC Security Group](https://www.terraform.io/docs/providers/aws/r/security_group.html) * [EC2-VPC Security Group](https://www.terraform.io/docs/providers/aws/r/security_group.html)
* [EC2-VPC Security Group Rules](https://www.terraform.io/docs/providers/aws/r/security_group_rule.html) * [EC2-VPC Security Group Rule](https://www.terraform.io/docs/providers/aws/r/security_group_rule.html)
Root module creates security group with provided arguments. Features
--------
Modules in [modules directory](modules) has been configured with the list of ingress (inbound) and egress (outbound) ports open for common scenarios (eg, [ssh](modules/ssh), [http](modules/http), [mysql](modules/mysql)). This module aims to implement **ALL** combinations of arguments supported by AWS and latest stable version of Terraform:
* IPv4/IPv6 CIDR blocks
* [VPC endpoint prefix lists](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html) (use data source [aws_prefix_list](https://www.terraform.io/docs/providers/aws/d/prefix_list.html))
* Access from source security groups
* Access from self
* Named rules ([see the rules here](rules.tf))
* Named groups of rules with ingress (inbound) and egress (outbound) ports open for common scenarios (eg, [ssh](modules/ssh), [http-80](modules/http-80), [mysql](modules/mysql), see the whole list [here](modules/README.md)).
Code in this module aims to implement **ALL** combinations of arguments (IPV4/IPV6 CIDR blocks, [VPC endpoint prefix lists](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html), source security groups, self), named rules. Ingress and egress rules can be configured in a variety of ways as listed on [the registry documentation](https://registry.terraform.io/modules/terraform-aws-modules/security-group/aws/?tab=inputs).
If there is something missing - [open an issue](https://github.com/terraform-aws-modules/terraform-aws-security-group/issues/new). If there is a missing feature or a bug - [open an issue](https://github.com/terraform-aws-modules/terraform-aws-security-group/issues/new).
Usage Usage
----- -----
There are two ways to create security groups using this module: There are two ways to create security groups using this module:
##### 1. Security group with pre-defined rules ##### 1. Security group with custom rules
```hcl
module "web_server_sg" {
source = "terraform-aws-modules/security-group/aws//modules/http"
name = "web-server"
description = "Security group for web-server with HTTP ports open within VPC"
vpc_id = "vpc-12345678"
ingress_cidr_blocks = ["10.10.0.0/16"]
}
```
##### 2. Security group with custom rules
```hcl ```hcl
module "vote_service_sg" { module "vote_service_sg" {
...@@ -46,33 +38,47 @@ module "vote_service_sg" { ...@@ -46,33 +38,47 @@ module "vote_service_sg" {
vpc_id = "vpc-12345678" vpc_id = "vpc-12345678"
ingress_cidr_blocks = ["10.10.0.0/16"] ingress_cidr_blocks = ["10.10.0.0/16"]
ingress_rules = ["mysql"] ingress_rules = ["https-443-tcp"]
ingress_with_cidr_blocks = [ ingress_with_cidr_blocks = [
{ {
from_port = 8080 from_port = 8080
to_port = 8090 to_port = 8090
protocol = 6 protocol = "tcp"
description = "User-service ports" description = "User-service ports"
cidr_blocks = "10.10.0.0/16" cidr_blocks = "10.10.0.0/16"
}, },
{ {
rule = "postgres" rule = "postgresql-tcp"
cidr_blocks = "0.0.0.0/0" cidr_blocks = "0.0.0.0/0"
}, },
] ]
} }
``` ```
Parameters ##### 2. Security group with pre-defined rules (NOTE: This is not working with any available version of Terraform, but should be possible in 0.11)
----------
```hcl
module "web_server_sg" {
source = "terraform-aws-modules/security-group/aws//modules/http"
name = "web-server"
description = "Security group for web-server with HTTP ports open within VPC"
vpc_id = "vpc-12345678"
Ingress and egress rules can be configured in a variety of ways as listed on [the registry](https://registry.terraform.io/modules/terraform-aws-modules/security-group/aws/?tab=inputs). ingress_cidr_blocks = ["10.10.0.0/16"]
}
```
Examples Examples
-------- --------
* [Complete Security Group example](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/examples/complete) * [Complete Security Group example](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/examples/complete) shows all available parameters to configure security group.
* [HTTP Security Group example](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/examples/http) * [HTTP Security Group example](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/examples/http) shows more applicable security groups for common web-servers.
How to add/update rules/groups?
-------------------------------
Rules and groups are defined in [rules.tf](rules.tf). Run `update_groups.sh` when content of that file has changed to recreate content of all automatic modules.
Authors Authors
------- -------
......
...@@ -39,16 +39,16 @@ module "complete_sg" { ...@@ -39,16 +39,16 @@ module "complete_sg" {
# ingress_prefix_list_ids = ["pl-123456"] # ingress_prefix_list_ids = ["pl-123456"]
# Open for all CIDRs defined in ingress_cidr_blocks # Open for all CIDRs defined in ingress_cidr_blocks
ingress_rules = ["http"] ingress_rules = ["https-443-tcp"]
# Open to CIDRs blocks (rule or from_port+to_port+protocol+description) # Open to CIDRs blocks (rule or from_port+to_port+protocol+description)
ingress_with_cidr_blocks = [ ingress_with_cidr_blocks = [
{ {
rule = "postgres" rule = "postgresql-tcp"
cidr_blocks = "0.0.0.0/0,2.2.2.2/32" cidr_blocks = "0.0.0.0/0,2.2.2.2/32"
ipv6_cidr_blocks = "2001:db8::/60" ipv6_cidr_blocks = "2001:db8::/60"
}, },
{ {
rule = "postgres" rule = "postgresql-tcp"
cidr_blocks = "30.30.30.30/32" cidr_blocks = "30.30.30.30/32"
}, },
{ {
...@@ -62,7 +62,7 @@ module "complete_sg" { ...@@ -62,7 +62,7 @@ module "complete_sg" {
# Open for security group id (rule or from_port+to_port+protocol+description) # Open for security group id (rule or from_port+to_port+protocol+description)
ingress_with_source_security_group_id = [ ingress_with_source_security_group_id = [
{ {
rule = "mysql" rule = "mysql-tcp"
source_security_group_id = "${data.aws_security_group.default.id}" source_security_group_id = "${data.aws_security_group.default.id}"
}, },
{ {
...@@ -101,16 +101,16 @@ module "complete_sg" { ...@@ -101,16 +101,16 @@ module "complete_sg" {
# egress_prefix_list_ids = ["pl-123456"] # egress_prefix_list_ids = ["pl-123456"]
# Open for all CIDRs defined in egress_cidr_blocks # Open for all CIDRs defined in egress_cidr_blocks
egress_rules = ["http"] egress_rules = ["http-80-tcp"]
# Open to CIDRs blocks (rule or from_port+to_port+protocol+description) # Open to CIDRs blocks (rule or from_port+to_port+protocol+description)
egress_with_cidr_blocks = [ egress_with_cidr_blocks = [
{ {
rule = "postgres" rule = "postgresql-tcp"
cidr_blocks = "0.0.0.0/0,2.2.2.2/32" cidr_blocks = "0.0.0.0/0,2.2.2.2/32"
ipv6_cidr_blocks = "2001:db8::/60" ipv6_cidr_blocks = "2001:db8::/60"
}, },
{ {
rule = "postgres" rule = "postgresql-tcp"
cidr_blocks = "30.30.30.30/32" cidr_blocks = "30.30.30.30/32"
}, },
{ {
...@@ -124,7 +124,7 @@ module "complete_sg" { ...@@ -124,7 +124,7 @@ module "complete_sg" {
# Open for security group id (rule or from_port+to_port+protocol+description) # Open for security group id (rule or from_port+to_port+protocol+description)
egress_with_source_security_group_id = [ egress_with_source_security_group_id = [
{ {
rule = "mysql" rule = "mysql-tcp"
source_security_group_id = "${data.aws_security_group.default.id}" source_security_group_id = "${data.aws_security_group.default.id}"
}, },
{ {
...@@ -143,7 +143,7 @@ module "complete_sg" { ...@@ -143,7 +143,7 @@ module "complete_sg" {
{ {
from_port = 30 from_port = 30
to_port = 40 to_port = 40
protocol = 6 protocol = "tcp"
description = "Service name" description = "Service name"
self = true self = true
}, },
......
Complete Security Group example HTTP Security Group example
=============================== ===========================
Configuration in this directory creates set of Security Group and Security Group Rules resources in various combination. Configuration in this directory creates set of Security Group and Security Group Rules resources in various combination.
......
...@@ -22,7 +22,7 @@ data "aws_security_group" "default" { ...@@ -22,7 +22,7 @@ data "aws_security_group" "default" {
# HTTP # HTTP
####### #######
module "http_sg" { module "http_sg" {
source = "../../modules/http" source = "../../modules/http-80"
name = "http-sg" name = "http-sg"
description = "Security group with HTTP ports open for everybody, egress ports are all world open" description = "Security group with HTTP ports open for everybody, egress ports are all world open"
...@@ -33,28 +33,28 @@ module "http_sg" { ...@@ -33,28 +33,28 @@ module "http_sg" {
# HTTP with MySQL #1 # HTTP with MySQL #1
##################### #####################
module "http_mysql_1_sg" { module "http_mysql_1_sg" {
source = "../../modules/http" source = "../../modules/http-80"
name = "http-mysql-1" name = "http-mysql-1"
description = "Security group with HTTP and MySQL ports open for everybody globally" description = "Security group with HTTP and MySQL ports open for everybody globally"
vpc_id = "${data.aws_vpc.default.id}" vpc_id = "${data.aws_vpc.default.id}"
# Add MySQL rules # Add MySQL rules
ingress_rules = ["mysql"] ingress_rules = ["mysql-tcp"]
} }
##################### #####################
# HTTP with MySQL #2 # HTTP with MySQL #2
##################### #####################
module "http_mysql_2_sg" { module "http_mysql_2_sg" {
source = "../../modules/http" source = "../../modules/http-80"
name = "http-mysql-2" name = "http-mysql-2"
description = "Security group with HTTP and MySQL ports open within current VPC" description = "Security group with HTTP and MySQL ports open within current VPC"
vpc_id = "${data.aws_vpc.default.id}" vpc_id = "${data.aws_vpc.default.id}"
# Add mysql rules # Add mysql rules
ingress_rules = ["mysql"] ingress_rules = ["mysql-tcp"]
# Allow ingress rules to be accessed only within current VPC # Allow ingress rules to be accessed only within current VPC
ingress_cidr_blocks = ["${data.aws_vpc.default.cidr_block}"] ingress_cidr_blocks = ["${data.aws_vpc.default.cidr_block}"]
...@@ -65,7 +65,7 @@ module "http_mysql_2_sg" { ...@@ -65,7 +65,7 @@ module "http_mysql_2_sg" {
# HTTP with egress minimal # HTTP with egress minimal
########################### ###########################
module "http_with_egress_minimal_sg" { module "http_with_egress_minimal_sg" {
source = "../../modules/http" source = "../../modules/http-80"
name = "http-with-egress-minimal" name = "http-with-egress-minimal"
description = "Security group with HTTP ports open within current VPC, and allow egress access to HTTP ports to the whole world" description = "Security group with HTTP ports open within current VPC, and allow egress access to HTTP ports to the whole world"
...@@ -75,21 +75,21 @@ module "http_with_egress_minimal_sg" { ...@@ -75,21 +75,21 @@ module "http_with_egress_minimal_sg" {
ingress_cidr_blocks = ["${data.aws_vpc.default.cidr_block}"] ingress_cidr_blocks = ["${data.aws_vpc.default.cidr_block}"]
# Allow all rules for all protocols # Allow all rules for all protocols
egress_rules = ["http"] egress_rules = ["http-80-tcp"]
} }
########################### ###########################
# HTTP with egress limited # HTTP with egress limited
########################### ###########################
module "http_with_egress_sg" { module "http_with_egress_sg" {
source = "../../modules/http" source = "../../modules/http-80"
name = "http-with-egress" name = "http-with-egress"
description = "Security group with HTTP ports open within current VPC, and allow egress access just to small subnet" description = "Security group with HTTP ports open within current VPC, and allow egress access just to small subnet"
vpc_id = "${data.aws_vpc.default.id}" vpc_id = "${data.aws_vpc.default.id}"
# Add mysql rules # Add mysql rules
ingress_rules = ["mysql"] ingress_rules = ["mysql-tcp"]
# Allow ingress rules to be accessed only within current VPC # Allow ingress rules to be accessed only within current VPC
ingress_cidr_blocks = ["${data.aws_vpc.default.cidr_block}"] ingress_cidr_blocks = ["${data.aws_vpc.default.cidr_block}"]
......
...@@ -2,5 +2,24 @@ List of Security Groups implemented as Terraform modules ...@@ -2,5 +2,24 @@ List of Security Groups implemented as Terraform modules
======================================================== ========================================================
* [http](http) * [carbon-relay-ng](carbon-relay-ng)
* [cassandra](cassandra)
* [consul](consul)
* [docker-swarm](docker-swarm)
* [elasticsearch](elasticsearch)
* [http-80](http-80)
* [https-443](https-443)
* [kafka](kafka)
* [ldaps](ldaps)
* [memcached](memcached)
* [mssql](mssql)
* [mysql](mysql)
* [nomad](nomad)
* [openvpn](openvpn)
* [postgresql](postgresql)
* [redis](redis)
* [ssh](ssh) * [ssh](ssh)
* [storm](storm)
* [web](web)
* [zipkin](zipkin)
* [zookeeper](zookeeper)
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["carbon-line-in-tcp", "carbon-line-in-udp", "carbon-pickle-tcp", "carbon-pickle-udp", "carbon-gui-udp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["cassandra-clients-tcp", "cassandra-thrift-clients-tcp", "cassandra-jmx-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["consul-tcp", "consul-webui-tcp", "consul-dns-tcp", "consul-dns-udp", "consul-serf-lan-tcp", "consul-serf-lan-udp", "consul-serf-wan-tcp", "consul-serf-wan-udp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["docker-swarm-mngmt-tcp", "docker-swarm-node-tcp", "docker-swarm-node-udp", "docker-swarm-overlay-udp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["elasticsearch-rest-tcp", "elasticsearch-java-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["http-80-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["https-443-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["kafka-broker-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
variable "auto_ingress_rules" { variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically" description = "List of ingress rules to add automatically"
type = "list" type = "list"
default = ["http"] default = ["ldaps-tcp"]
} }
variable "auto_ingress_with_self" { variable "auto_ingress_with_self" {
......
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["memcached-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["mssql-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["mysql-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["nomad-http-tcp", "nomad-rpc-tcp", "nomad-serf-tcp", "nomad-serf-udp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["openvpn-udp", "openvpn-tcp", "openvpn-443-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["postgresql-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["redis-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
variable "auto_ingress_rules" { variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically" description = "List of ingress rules to add automatically"
type = "list" type = "list"
default = ["http", "ssh"] default = ["ssh-tcp"]
} }
variable "auto_ingress_with_self" { variable "auto_ingress_with_self" {
......
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["storm-nimbus-tcp", "storm-ui-tcp", "storm-supervisor-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["http-80-tcp", "http-8080-tcp", "https-443-tcp", "web-jmx-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["zipkin-admin-tcp", "zipkin-admin-query-tcp", "zipkin-admin-web-tcp", "zipkin-query-tcp", "zipkin-web-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
# This file was generated from values defined in rules.tf using update_groups.sh.
###################################
# DO NOT CHANGE THIS FILE MANUALLY
###################################
variable "auto_ingress_rules" {
description = "List of ingress rules to add automatically"
type = "list"
default = ["zookeeper-2181-tcp", "zookeeper-2888-tcp", "zookeeper-3888-tcp", "zookeeper-jmx-tcp"]
}
variable "auto_ingress_with_self" {
description = "List of ingress rules with self to add automatically"
type = "list"
default = []
}
variable "auto_egress_rules" {
description = "List of egress rules to add automatically"
type = "list"
default = ["all-all"]
}
variable "auto_egress_with_self" {
description = "List of egress rules with self to add automatically"
type = "list"
default = []
}
module "sg" {
source = "../../"
name = "${var.name}"
description = "${var.description}"
vpc_id = "${var.vpc_id}"
tags = "${var.tags}"
##########
# Ingress
##########
# Rules by names - open for default CIDR
ingress_rules = ["${sort(distinct(concat(var.auto_ingress_rules, var.ingress_rules)))}"]
# Open for self
ingress_with_self = ["${concat(var.auto_ingress_with_self, var.ingress_with_self)}"]
# Open to cidr_blocks
ingress_with_cidr_blocks = ["${var.ingress_with_cidr_blocks}"]
# Open for security group id
ingress_with_source_security_group_id = ["${var.ingress_with_source_security_group_id}"]
# Default ingress CIDR blocks
ingress_cidr_blocks = ["${var.ingress_cidr_blocks}"]
ingress_ipv6_cidr_blocks = ["${var.ingress_ipv6_cidr_blocks}"]
# Default prefix list ids
ingress_prefix_list_ids = ["${var.ingress_prefix_list_ids}"]
#########
# Egress
#########
# Rules by names - open for default CIDR
egress_rules = ["${sort(distinct(concat(var.auto_egress_rules, var.egress_rules)))}"]
# Open for self
egress_with_self = ["${concat(var.auto_egress_with_self, var.egress_with_self)}"]
# Open to cidr_blocks
egress_with_cidr_blocks = ["${var.egress_with_cidr_blocks}"]
# Open for security group id
egress_with_source_security_group_id = ["${var.egress_with_source_security_group_id}"]
# Default egress CIDR blocks
egress_cidr_blocks = ["${var.egress_cidr_blocks}"]
egress_ipv6_cidr_blocks = ["${var.egress_ipv6_cidr_blocks}"]
# Default prefix list ids
egress_prefix_list_ids = ["${var.egress_prefix_list_ids}"]
}
output "this_security_group_id" {
description = "The ID of the security group"
value = "${module.sg.this_security_group_id}"
}
output "this_security_group_vpc_id" {
description = "The VPC ID"
value = "${module.sg.this_security_group_vpc_id}"
}
output "this_security_group_owner_id" {
description = "The owner ID"
value = "${module.sg.this_security_group_owner_id}"
}
output "this_security_group_name" {
description = "The name of the security group"
value = "${module.sg.this_security_group_name}"
}
output "this_security_group_description" {
description = "The description of the security group"
value = "${module.sg.this_security_group_description}"
}
output "this_security_group_ingress" {
description = "The ingress rules"
value = "${module.sg.this_security_group_ingress}"
}
output "this_security_group_egress" {
description = "The egress rules"
value = "${module.sg.this_security_group_egress}"
}
#################
# Security group
#################
variable "vpc_id" {
description = "ID of VPC to create security group into"
}
variable "name" {
description = "Name of security group"
}
variable "description" {
description = "Description of security group"
default = "Security Group managed by Terraform"
}
variable "tags" {
description = "A mapping of tags to assign to security group"
default = {}
}
##########
# Ingress
##########
variable "ingress_rules" {
description = "List of ingress rules to create by name"
default = []
}
variable "ingress_with_self" {
description = "List of ingress rules to create where 'self' is defined"
default = []
}
variable "ingress_with_cidr_blocks" {
description = "List of ingress rules to create where 'cidr_blocks' is used"
default = []
}
variable "ingress_with_source_security_group_id" {
description = "List of ingress rules to create where 'source_security_group_id' is used"
default = []
}
variable "ingress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all ingress rules"
default = ["0.0.0.0/0"]
}
variable "ingress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all ingress rules"
default = ["::/0"]
}
variable "ingress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default = []
}
#########
# Egress
#########
variable "egress_rules" {
description = "List of egress rules to create by name"
default = []
}
variable "egress_with_self" {
description = "List of egress rules to create where 'self' is defined"
default = []
}
variable "egress_with_cidr_blocks" {
description = "List of egress rules to create where 'cidr_blocks' is used"
default = []
}
variable "egress_with_source_security_group_id" {
description = "List of egress rules to create where 'source_security_group_id' is used"
default = []
}
variable "egress_cidr_blocks" {
description = "List of IPv4 CIDR ranges to use on all egress rules"
default = ["0.0.0.0/0"]
}
variable "egress_ipv6_cidr_blocks" {
description = "List of IPv6 CIDR ranges to use on all egress rules"
default = ["::/0"]
}
variable "egress_prefix_list_ids" {
description = "List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules"
default = []
}
...@@ -2,22 +2,111 @@ variable "rules" { ...@@ -2,22 +2,111 @@ variable "rules" {
description = "Map of known security group rules (define as 'name' = ['from port', 'to port', 'protocol', 'description'])" description = "Map of known security group rules (define as 'name' = ['from port', 'to port', 'protocol', 'description'])"
type = "map" type = "map"
# Protocols: All = -1, IPV4-ICMP = 1, TCP = 6, UDP = 16, IPV6-ICMP = 58 # Protocols (tcp, udp, icmp, all - are allowed keywords) or numbers (from https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml):
# All = -1, IPV4-ICMP = 1, TCP = 6, UDP = 16, IPV6-ICMP = 58
default = { default = {
http = [8080, 8088, 6, "HTTP"] # Carbon relay
mysql = [81, 81, 6, "MySQL"] carbon-line-in-tcp = [2003, 2003, "tcp", "Carbon line-in"]
postgres = [82, 82, 6, "PostgreSQL"] carbon-line-in-udp = [2003, 2003, "udp", "Carbon line-in"]
carbon-pickle-tcp = [2013, 2013, "tcp", "Carbon pickle"]
carbon-pickle-udp = [2013, 2013, "udp", "Carbon pickle"]
carbon-admin-tcp = [2004, 2004, "tcp", "Carbon admin"]
carbon-gui-udp = [8081, 8081, "tcp", "Carbon GUI"]
carbon-line-up-tcp = [2003, 2003, 6, "Carbon"] # Cassandra
carbon-line-up-udp = [2003, 2003, 16, "Carbon"] cassandra-clients-tcp = [9042, 9042, "tcp", "Cassandra clients"]
"2013-tcp" = [2013, 2013, 6, "Carbon"] cassandra-thrift-clients-tcp = [9160, 9160, "tcp", "Cassandra Thrift clients"]
"2013-udp" = [2013, 2013, 16, "Carbon"] cassandra-jmx-tcp = [7199, 7199, "tcp", "JMX"]
all-all = [0, 65535, -1, "All protocols"] # Consul
all-icmp = [0, 65535, 1, "All IPV4 ICMP"] consul-tcp = [8300, 8300, "tcp", "Consul server"]
consul-webui-tcp = [8500, 8500, "tcp", "Consul web UI"]
consul-dns-tcp = [8600, 8600, "tcp", "Consul DNS"]
consul-dns-udp = [8600, 8600, "udp", "Consul DNS"]
consul-serf-lan-tcp = [8301, 8301, "tcp", "Serf LAN"]
consul-serf-lan-udp = [8301, 8301, "udp", "Serf LAN"]
consul-serf-wan-tcp = [8302, 8302, "tcp", "Serf WAN"]
consul-serf-wan-udp = [8302, 8302, "udp", "Serf WAN"]
# Docker Swarm
docker-swarm-mngmt-tcp = [2377, 2377, "tcp", "Docker Swarm cluster management"]
docker-swarm-node-tcp = [7946, 7946, "tcp", "Docker Swarm node"]
docker-swarm-node-udp = [7946, 7946, "udp", "Docker Swarm node"]
docker-swarm-overlay-udp = [4789, 4789, "udp", "Docker Swarm Overlay Network Traffic"]
# Elasticsearch
elasticsearch-rest-tcp = [9200, 9200, "tcp", "Elasticsearch REST interface"]
elasticsearch-java-tcp = [9300, 9300, "tcp", "Elasticsearch Java interface"]
# HTTP
http-80-tcp = [80, 80, "tcp", "HTTP"]
http-8080-tcp = [8080, 8080, "tcp", "HTTP"]
# HTTPS
https-443-tcp = [443, 443, "tcp", "HTTPS"]
# Kafka
kafka-broker-tcp = [9092, 9092, "tcp", "Kafka broker 0.8.2+"]
# LDAPS
ldaps-tcp = [636, 636, "tcp", "LDAPS"]
# Memcached
memcached-tcp = [11211, 11211, "tcp", "Memcached"]
# MySQL
mysql-tcp = [3306, 3306, "tcp", "MySQL/Aurora"]
# MSSQL Server
mssql-tcp = [1433, 1433, "tcp", "MSSQL Server"]
# Nomad
nomad-http-tcp = [4646, 4646, "tcp", "Nomad HTTP"]
nomad-rpc-tcp = [4647, 4647, "tcp", "Nomad RPC"]
nomad-serf-tcp = [4648, 4648, "tcp", "Serf"]
nomad-serf-udp = [4648, 4648, "udp", "Serf"]
# OpenVPN
openvpn-udp = [1194, 1194, "udp", "OpenVPN"]
openvpn-tcp = [943, 943, "tcp", "OpenVPN"]
openvpn-https-tcp = [443, 443, "tcp", "OpenVPN"]
# PostgreSQL
postgresql-tcp = [5432, 5432, "tcp", "PostgreSQL"]
# Redis
redis-tcp = [6379, 6379, "tcp", "Redis"]
# SSH
ssh-tcp = [22, 22, "tcp", "SSH"]
# Storm
storm-nimbus-tcp = [6627, 6627, "tcp", "Nimbus"]
storm-ui-tcp = [8080, 8080, "tcp", "Storm UI"]
storm-supervisor-tcp = [6700, 6703, "tcp", "Supervisor"]
# Web
web-jmx-tcp = [1099, 1099, "tcp", "JMX"]
# Zipkin
zipkin-admin-tcp = [9990, 9990, "tcp", "Zipkin Admin port collector"]
zipkin-admin-query-tcp = [9901, 9901, "tcp", "Zipkin Admin port query"]
zipkin-admin-web-tcp = [9991, 9991, "tcp", "Zipkin Admin port web"]
zipkin-query-tcp = [9411, 9411, "tcp", "Zipkin query port"]
zipkin-web-tcp = [8080, 8080, "tcp", "Zipkin web port"]
# Zookeeper
zookeeper-2181-tcp = [2181, 2181, "tcp", "Zookeeper"]
zookeeper-2888-tcp = [2888, 2888, "tcp", "Zookeeper"]
zookeeper-3888-tcp = [3888, 3888, "tcp", "Zookeeper"]
zookeeper-jmx-tcp = [7199, 7199, "tcp", "JMX"]
# Open all ports & protocols
all-all = [-1, -1, "icmp", "All protocols"]
all-tcp = [0, 65535, "tcp", "All TCP ports"]
all-udp = [0, 65535, "udp", "All UDP ports"]
all-icmp = [0, 65535, "icmp", "All IPV4 ICMP"]
all-ipv6-icmp = [0, 65535, 58, "All IPV6 ICMP"] all-ipv6-icmp = [0, 65535, 58, "All IPV6 ICMP"]
all-tcp = [0, 65535, 6, "All TCP"]
all-udp = [0, 65535, 16, "All"]
# This is a fallback rule to pass to lookup() as default. It does not open anything, because it should never be used. # This is a fallback rule to pass to lookup() as default. It does not open anything, because it should never be used.
_ = ["", "", ""] _ = ["", "", ""]
...@@ -30,192 +119,130 @@ variable "auto_groups" { ...@@ -30,192 +119,130 @@ variable "auto_groups" {
# Valid keys - ingress_rules, egress_rules, ingress_with_self, egress_with_self # Valid keys - ingress_rules, egress_rules, ingress_with_self, egress_with_self
default = { default = {
carbon-relay-ng = {
ingress_rules = ["carbon-line-in-tcp", "carbon-line-in-udp", "carbon-pickle-tcp", "carbon-pickle-udp", "carbon-gui-udp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
cassandra = {
ingress_rules = ["cassandra-clients-tcp", "cassandra-thrift-clients-tcp", "cassandra-jmx-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
consul = {
ingress_rules = ["consul-tcp", "consul-webui-tcp", "consul-dns-tcp", "consul-dns-udp", "consul-serf-lan-tcp", "consul-serf-lan-udp", "consul-serf-wan-tcp", "consul-serf-wan-udp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
docker-swarm = {
ingress_rules = ["docker-swarm-mngmt-tcp", "docker-swarm-node-tcp", "docker-swarm-node-udp", "docker-swarm-overlay-udp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
elasticsearch = {
ingress_rules = ["elasticsearch-rest-tcp", "elasticsearch-java-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
http-80 = {
ingress_rules = ["http-80-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
https-443 = {
ingress_rules = ["https-443-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
kafka = {
ingress_rules = ["kafka-broker-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
ldaps = {
ingress_rules = ["ldaps-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
memcached = {
ingress_rules = ["memcached-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
mysql = {
ingress_rules = ["mysql-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
mssql = {
ingress_rules = ["mssql-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
nomad = {
ingress_rules = ["nomad-http-tcp", "nomad-rpc-tcp", "nomad-serf-tcp", "nomad-serf-udp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
openvpn = {
ingress_rules = ["openvpn-udp", "openvpn-tcp", "openvpn-443-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
postgresql = {
ingress_rules = ["postgresql-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
redis = {
ingress_rules = ["redis-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
ssh = { ssh = {
ingress_rules = ["http", "ssh"] ingress_rules = ["ssh-tcp"]
egress_rules = ["all-all"] ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
} }
http = { storm = {
ingress_rules = ["http"] ingress_rules = ["storm-nimbus-tcp", "storm-ui-tcp", "storm-supervisor-tcp"]
egress_rules = ["all-all"] ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
web = {
ingress_rules = ["http-80-tcp", "http-8080-tcp", "https-443-tcp", "web-jmx-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
} }
}
}
/* zipkin = {
List of protocols (https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml): ingress_rules = ["zipkin-admin-tcp", "zipkin-admin-query-tcp", "zipkin-admin-web-tcp", "zipkin-query-tcp", "zipkin-web-tcp"]
Decimal,Keyword,Protocol,IPv6 Extension Header,Reference ingress_rules_with_self = ["all-all"]
0,HOPOPT,IPv6 Hop-by-Hop Option,Y,[RFC-ietf-6man-rfc2460bis-13] egress_rules = ["all-all"]
1,ICMP,Internet Control Message,,[RFC792] }
2,IGMP,Internet Group Management,,[RFC1112]
3,GGP,Gateway-to-Gateway,,[RFC823]
4,IPv4,IPv4 encapsulation,,[RFC2003]
5,ST,Stream,,[RFC1190][RFC1819]
6,TCP,Transmission Control,,[RFC793]
7,CBT,CBT,,[Tony_Ballardie]
8,EGP,Exterior Gateway Protocol,,[RFC888][David_Mills]
9,IGP,"any private interior gateway
(used by Cisco for their IGRP)",,[Internet_Assigned_Numbers_Authority]
10,BBN-RCC-MON,BBN RCC Monitoring,,[Steve_Chipman]
11,NVP-II,Network Voice Protocol,,[RFC741][Steve_Casner]
12,PUP,PUP,,"[Boggs, D., J. Shoch, E. Taft, and R. Metcalfe, ""PUP: An
Internetwork Architecture"", XEROX Palo Alto Research Center,
CSL-79-10, July 1979 also in IEEE Transactions on
Communication, Volume COM-28, Number 4, April 1980.][[XEROX]]"
13,ARGUS (deprecated),ARGUS,,[Robert_W_Scheifler]
14,EMCON,EMCON,,[<mystery contact>]
15,XNET,Cross Net Debugger,,"[Haverty, J., ""XNET Formats for Internet Protocol Version 4"",
IEN 158, October 1980.][Jack_Haverty]"
16,CHAOS,Chaos,,[J_Noel_Chiappa]
17,UDP,User Datagram,,[RFC768][Jon_Postel]
18,MUX,Multiplexing,,"[Cohen, D. and J. Postel, ""Multiplexing Protocol"", IEN 90,
USC/Information Sciences Institute, May 1979.][Jon_Postel]"
19,DCN-MEAS,DCN Measurement Subsystems,,[David_Mills]
20,HMP,Host Monitoring,,[RFC869][Bob_Hinden]
21,PRM,Packet Radio Measurement,,[Zaw_Sing_Su]
22,XNS-IDP,XEROX NS IDP,,"[""The Ethernet, A Local Area Network: Data Link Layer and
Physical Layer Specification"", AA-K759B-TK, Digital
Equipment Corporation, Maynard, MA. Also as: ""The
Ethernet - A Local Area Network"", Version 1.0, Digital
Equipment Corporation, Intel Corporation, Xerox
Corporation, September 1980. And: ""The Ethernet, A Local
Area Network: Data Link Layer and Physical Layer
Specifications"", Digital, Intel and Xerox, November 1982.
And: XEROX, ""The Ethernet, A Local Area Network: Data Link
Layer and Physical Layer Specification"", X3T51/80-50,
Xerox Corporation, Stamford, CT., October 1980.][[XEROX]]"
23,TRUNK-1,Trunk-1,,[Barry_Boehm]
24,TRUNK-2,Trunk-2,,[Barry_Boehm]
25,LEAF-1,Leaf-1,,[Barry_Boehm]
26,LEAF-2,Leaf-2,,[Barry_Boehm]
27,RDP,Reliable Data Protocol,,[RFC908][Bob_Hinden]
28,IRTP,Internet Reliable Transaction,,[RFC938][Trudy_Miller]
29,ISO-TP4,ISO Transport Protocol Class 4,,[RFC905][<mystery contact>]
30,NETBLT,Bulk Data Transfer Protocol,,[RFC969][David_Clark]
31,MFE-NSP,MFE Network Services Protocol,,"[Shuttleworth, B., ""A Documentary of MFENet, a National
Computer Network"", UCRL-52317, Lawrence Livermore Labs,
Livermore, California, June 1977.][Barry_Howard]"
32,MERIT-INP,MERIT Internodal Protocol,,[Hans_Werner_Braun]
33,DCCP,Datagram Congestion Control Protocol,,[RFC4340]
34,3PC,Third Party Connect Protocol,,[Stuart_A_Friedberg]
35,IDPR,Inter-Domain Policy Routing Protocol,,[Martha_Steenstrup]
36,XTP,XTP,,[Greg_Chesson]
37,DDP,Datagram Delivery Protocol,,[Wesley_Craig]
38,IDPR-CMTP,IDPR Control Message Transport Proto,,[Martha_Steenstrup]
39,TP++,TP++ Transport Protocol,,[Dirk_Fromhein]
40,IL,IL Transport Protocol,,[Dave_Presotto]
41,IPv6,IPv6 encapsulation,,[RFC2473]
42,SDRP,Source Demand Routing Protocol,,[Deborah_Estrin]
43,IPv6-Route,Routing Header for IPv6,Y,[Steve_Deering]
44,IPv6-Frag,Fragment Header for IPv6,Y,[Steve_Deering]
45,IDRP,Inter-Domain Routing Protocol,,[Sue_Hares]
46,RSVP,Reservation Protocol,,[RFC2205][RFC3209][Bob_Braden]
47,GRE,Generic Routing Encapsulation,,[RFC2784][Tony_Li]
48,DSR,Dynamic Source Routing Protocol,,[RFC4728]
49,BNA,BNA,,[Gary Salamon]
50,ESP,Encap Security Payload,Y,[RFC4303]
51,AH,Authentication Header,Y,[RFC4302]
52,I-NLSP,Integrated Net Layer Security TUBA,,[K_Robert_Glenn]
53,SWIPE (deprecated),IP with Encryption,,[John_Ioannidis]
54,NARP,NBMA Address Resolution Protocol,,[RFC1735]
55,MOBILE,IP Mobility,,[Charlie_Perkins]
56,TLSP,"Transport Layer Security Protocol
using Kryptonet key management",,[Christer_Oberg]
57,SKIP,SKIP,,[Tom_Markson]
58,IPv6-ICMP,ICMP for IPv6,,[RFC-ietf-6man-rfc2460bis-13]
59,IPv6-NoNxt,No Next Header for IPv6,,[RFC-ietf-6man-rfc2460bis-13]
60,IPv6-Opts,Destination Options for IPv6,Y,[RFC-ietf-6man-rfc2460bis-13]
61,,any host internal protocol,,[Internet_Assigned_Numbers_Authority]
62,CFTP,CFTP,,"[Forsdick, H., ""CFTP"", Network Message, Bolt Beranek and
Newman, January 1982.][Harry_Forsdick]"
63,,any local network,,[Internet_Assigned_Numbers_Authority]
64,SAT-EXPAK,SATNET and Backroom EXPAK,,[Steven_Blumenthal]
65,KRYPTOLAN,Kryptolan,,[Paul Liu]
66,RVD,MIT Remote Virtual Disk Protocol,,[Michael_Greenwald]
67,IPPC,Internet Pluribus Packet Core,,[Steven_Blumenthal]
68,,any distributed file system,,[Internet_Assigned_Numbers_Authority]
69,SAT-MON,SATNET Monitoring,,[Steven_Blumenthal]
70,VISA,VISA Protocol,,[Gene_Tsudik]
71,IPCV,Internet Packet Core Utility,,[Steven_Blumenthal]
72,CPNX,Computer Protocol Network Executive,,[David Mittnacht]
73,CPHB,Computer Protocol Heart Beat,,[David Mittnacht]
74,WSN,Wang Span Network,,[Victor Dafoulas]
75,PVP,Packet Video Protocol,,[Steve_Casner]
76,BR-SAT-MON,Backroom SATNET Monitoring,,[Steven_Blumenthal]
77,SUN-ND,SUN ND PROTOCOL-Temporary,,[William_Melohn]
78,WB-MON,WIDEBAND Monitoring,,[Steven_Blumenthal]
79,WB-EXPAK,WIDEBAND EXPAK,,[Steven_Blumenthal]
80,ISO-IP,ISO Internet Protocol,,[Marshall_T_Rose]
81,VMTP,VMTP,,[Dave_Cheriton]
82,SECURE-VMTP,SECURE-VMTP,,[Dave_Cheriton]
83,VINES,VINES,,[Brian Horn]
84,TTP,Transaction Transport Protocol,,[Jim_Stevens]
84,IPTM,Internet Protocol Traffic Manager,,[Jim_Stevens]
85,NSFNET-IGP,NSFNET-IGP,,[Hans_Werner_Braun]
86,DGP,Dissimilar Gateway Protocol,,"[M/A-COM Government Systems, ""Dissimilar Gateway Protocol
Specification, Draft Version"", Contract no. CS901145,
November 16, 1987.][Mike_Little]"
87,TCF,TCF,,[Guillermo_A_Loyola]
88,EIGRP,EIGRP,,[RFC7868]
89,OSPFIGP,OSPFIGP,,[RFC1583][RFC2328][RFC5340][John_Moy]
90,Sprite-RPC,Sprite RPC Protocol,,"[Welch, B., ""The Sprite Remote Procedure Call System"",
Technical Report, UCB/Computer Science Dept., 86/302,
University of California at Berkeley, June 1986.][Bruce Willins]"
91,LARP,Locus Address Resolution Protocol,,[Brian Horn]
92,MTP,Multicast Transport Protocol,,[Susie_Armstrong]
93,AX.25,AX.25 Frames,,[Brian_Kantor]
94,IPIP,IP-within-IP Encapsulation Protocol,,[John_Ioannidis]
95,MICP (deprecated),Mobile Internetworking Control Pro.,,[John_Ioannidis]
96,SCC-SP,Semaphore Communications Sec. Pro.,,[Howard_Hart]
97,ETHERIP,Ethernet-within-IP Encapsulation,,[RFC3378]
98,ENCAP,Encapsulation Header,,[RFC1241][Robert_Woodburn]
99,,any private encryption scheme,,[Internet_Assigned_Numbers_Authority]
100,GMTP,GMTP,,[[RXB5]]
101,IFMP,Ipsilon Flow Management Protocol,,"[Bob_Hinden][November 1995, 1997.]"
102,PNNI,PNNI over IP,,[Ross_Callon]
103,PIM,Protocol Independent Multicast,,[RFC7761][Dino_Farinacci]
104,ARIS,ARIS,,[Nancy_Feldman]
105,SCPS,SCPS,,[Robert_Durst]
106,QNX,QNX,,[Michael_Hunter]
107,A/N,Active Networks,,[Bob_Braden]
108,IPComp,IP Payload Compression Protocol,,[RFC2393]
109,SNP,Sitara Networks Protocol,,[Manickam_R_Sridhar]
110,Compaq-Peer,Compaq Peer Protocol,,[Victor_Volpe]
111,IPX-in-IP,IPX in IP,,[CJ_Lee]
112,VRRP,Virtual Router Redundancy Protocol,,[RFC5798]
113,PGM,PGM Reliable Transport Protocol,,[Tony_Speakman]
114,,any 0-hop protocol,,[Internet_Assigned_Numbers_Authority]
115,L2TP,Layer Two Tunneling Protocol,,[RFC3931][Bernard_Aboba]
116,DDX,D-II Data Exchange (DDX),,[John_Worley]
117,IATP,Interactive Agent Transfer Protocol,,[John_Murphy]
118,STP,Schedule Transfer Protocol,,[Jean_Michel_Pittet]
119,SRP,SpectraLink Radio Protocol,,[Mark_Hamilton]
120,UTI,UTI,,[Peter_Lothberg]
121,SMP,Simple Message Protocol,,[Leif_Ekblad]
122,SM (deprecated),Simple Multicast Protocol,,[Jon_Crowcroft][draft-perlman-simple-multicast]
123,PTP,Performance Transparency Protocol,,[Michael_Welzl]
124,ISIS over IPv4,,,[Tony_Przygienda]
125,FIRE,,,[Criag_Partridge]
126,CRTP,Combat Radio Transport Protocol,,[Robert_Sautter]
127,CRUDP,Combat Radio User Datagram,,[Robert_Sautter]
128,SSCOPMCE,,,[Kurt_Waber]
129,IPLT,,,[[Hollbach]]
130,SPS,Secure Packet Shield,,[Bill_McIntosh]
131,PIPE,Private IP Encapsulation within IP,,[Bernhard_Petri]
132,SCTP,Stream Control Transmission Protocol,,[Randall_R_Stewart]
133,FC,Fibre Channel,,[Murali_Rajagopal][RFC6172]
134,RSVP-E2E-IGNORE,,,[RFC3175]
135,Mobility Header,,Y,[RFC6275]
136,UDPLite,,,[RFC3828]
137,MPLS-in-IP,,,[RFC4023]
138,manet,MANET Protocols,,[RFC5498]
139,HIP,Host Identity Protocol,Y,[RFC7401]
140,Shim6,Shim6 Protocol,Y,[RFC5533]
141,WESP,Wrapped Encapsulating Security Payload,,[RFC5840]
142,ROHC,Robust Header Compression,,[RFC5858]
143-252,,Unassigned,,[Internet_Assigned_Numbers_Authority]
253,,Use for experimentation and testing,Y,[RFC3692]
254,,Use for experimentation and testing,Y,[RFC3692]
255,Reserved,,,[Internet_Assigned_Numbers_Authority]
*/
zookeeper = {
ingress_rules = ["zookeeper-2181-tcp", "zookeeper-2888-tcp", "zookeeper-3888-tcp", "zookeeper-jmx-tcp"]
ingress_rules_with_self = ["all-all"]
egress_rules = ["all-all"]
}
}
}
#!/usr/bin/env bash #!/usr/bin/env bash
# @todo: generate content of each public module (eg, "http") from the json list. # This script generates each public module (eg, "http-80", "ssh") and specify rules required for each group.
# This script should be run after rules.tf is changed to refresh all related modules.
# outputs.tf and variables.tf for all group modules are the same for all # outputs.tf and variables.tf for all group modules are the same for all
set -e set -e
...@@ -8,13 +9,6 @@ set -e ...@@ -8,13 +9,6 @@ set -e
# Change location to the directory where this script it located # Change location to the directory where this script it located
cd "$(dirname "${BASH_SOURCE[0]}")" cd "$(dirname "${BASH_SOURCE[0]}")"
# Assert that a given binary is installed
function assert_is_installed {
local readonly name="$1"
}
check_dependencies() { check_dependencies() {
if [[ ! $(command -v json2hcl) ]]; then if [[ ! $(command -v json2hcl) ]]; then
echo "ERROR: The binary 'json2hcl' is required by this script but is not installed or in the system's PATH." echo "ERROR: The binary 'json2hcl' is required by this script but is not installed or in the system's PATH."
...@@ -34,17 +28,17 @@ auto_groups_data() { ...@@ -34,17 +28,17 @@ auto_groups_data() {
} }
auto_groups_keys() { auto_groups_keys() {
local readonly data=$1 local data=$1
echo $data | jq -r ".|keys|@sh" | tr -d "'" echo "$data" | jq -r ".|keys|@sh" | tr -d "'"
} }
get_auto_value() { get_auto_value() {
local readonly data=$1 local data=$1
local readonly group=$2 local group=$2
local readonly var=$3 local var=$3
echo $data | jq -rc '.[$group][0][$var]' --arg group "$group" --arg var "$var" echo "$data" | jq -rc '.[$group][0][$var]' --arg group "$group" --arg var "$var"
} }
set_list_if_null() { set_list_if_null() {
...@@ -128,9 +122,9 @@ variable "auto_egress_with_self" { ...@@ -128,9 +122,9 @@ variable "auto_egress_with_self" {
} }
EOF EOF
local list_of_modules=$(echo "$list_of_modules"; echo "* [$group]($group)") list_of_modules=$(echo "$list_of_modules"; echo "* [$group]($group)")
# terraform fmt -diff=true "modules/$group" terraform fmt "modules/$group"
done done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment