Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
terraform-aws-security-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Terraform Modules
terraform-aws-security-group
Commits
677a64ff
Commit
677a64ff
authored
Feb 06, 2019
by
Mikhail Vasilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rule for rabbitmq
parent
6f304068
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
534 additions
and
0 deletions
+534
-0
README.md
modules/README.md
+1
-0
README.md
modules/rabbitmq/README.md
+16
-0
auto_values.tf
modules/rabbitmq/auto_values.tf
+77
-0
main.tf
modules/rabbitmq/main.tf
+116
-0
outputs.tf
modules/rabbitmq/outputs.tf
+24
-0
variables.tf
modules/rabbitmq/variables.tf
+288
-0
rules.tf
rules.tf
+12
-0
No files found.
modules/README.md
View file @
677a64ff
...
@@ -24,6 +24,7 @@ List of Security Groups implemented as Terraform modules
...
@@ -24,6 +24,7 @@ List of Security Groups implemented as Terraform modules
*
[
openvpn
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/openvpn
)
*
[
openvpn
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/openvpn
)
*
[
oracle-db
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/oracle-db
)
*
[
oracle-db
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/oracle-db
)
*
[
postgresql
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/postgresql
)
*
[
postgresql
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/postgresql
)
*
[
rabbitmq
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/rabbitmq
)
*
[
rdp
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/rdp
)
*
[
rdp
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/rdp
)
*
[
redis
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/redis
)
*
[
redis
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/redis
)
*
[
redshift
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/redshift
)
*
[
redshift
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/redshift
)
...
...
modules/rabbitmq/README.md
0 → 100644
View file @
677a64ff
# rabbitmq - AWS EC2-VPC Security Group Terraform module
## Usage
```
hcl
module
"rabbitmq_security_group"
{
source
=
"terraform-aws-modules/security-group/aws//modules/rabbitmq"
# omitted...
}
```
All automatic values
**rabbitmq module**
is using are available
[
here
](
https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/rabbitmq/auto_values.tf
)
.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
modules/rabbitmq/auto_values.tf
0 → 100644
View file @
677a64ff
# 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
=
[
"rabbitmq-5671-tcp"
,
"rabbitmq-5672-tcp"
,
"rabbitmq-15672-tcp"
,
"rabbitmq-25672-tcp"
]
}
variable
"auto_ingress_with_self"
{
description
=
"List of maps defining ingress rules with self to add automatically"
type
=
"list"
default
=
[{
"rule"
=
"all-all"
}]
}
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 maps defining egress rules with self to add automatically"
type
=
"list"
default
=
[]
}
# Computed
variable
"auto_computed_ingress_rules"
{
description
=
"List of ingress rules to add automatically"
type
=
"list"
default
=
[]
}
variable
"auto_computed_ingress_with_self"
{
description
=
"List of maps defining computed ingress rules with self to add automatically"
type
=
"list"
default
=
[]
}
variable
"auto_computed_egress_rules"
{
description
=
"List of computed egress rules to add automatically"
type
=
"list"
default
=
[]
}
variable
"auto_computed_egress_with_self"
{
description
=
"List of maps defining computed egress rules with self to add automatically"
type
=
"list"
default
=
[]
}
# Number of computed rules
variable
"auto_number_of_computed_ingress_rules"
{
description
=
"Number of computed ingress rules to create by name"
default
=
0
}
variable
"auto_number_of_computed_ingress_with_self"
{
description
=
"Number of computed ingress rules to create where 'self' is defined"
default
=
0
}
variable
"auto_number_of_computed_egress_rules"
{
description
=
"Number of computed egress rules to create by name"
default
=
0
}
variable
"auto_number_of_computed_egress_with_self"
{
description
=
"Number of computed egress rules to create where 'self' is defined"
default
=
0
}
modules/rabbitmq/main.tf
0 → 100644
View file @
677a64ff
module
"sg"
{
source
=
"../../"
create
=
"
${
var
.
create
}
"
name
=
"
${
var
.
name
}
"
use_name_prefix
=
"
${
var
.
use_name_prefix
}
"
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 IPv4 cidr blocks
ingress_with_cidr_blocks
=
[
"
${
var
.
ingress_with_cidr_blocks
}
"
]
# Open to IPv6 cidr blocks
ingress_with_ipv6_cidr_blocks
=
[
"
${
var
.
ingress_with_ipv6_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
}
"
]
###################
# Computed Ingress
###################
# Rules by names - open for default CIDR
computed_ingress_rules
=
[
"
${
sort
(
distinct
(
concat
(
var
.
auto_computed_ingress_rules
,
var
.
computed_ingress_rules
)))
}
"
]
# Open for self
computed_ingress_with_self
=
[
"
${
concat
(
var
.
auto_computed_ingress_with_self
,
var
.
computed_ingress_with_self
)
}
"
]
# Open to IPv4 cidr blocks
computed_ingress_with_cidr_blocks
=
[
"
${
var
.
computed_ingress_with_cidr_blocks
}
"
]
# Open to IPv6 cidr blocks
computed_ingress_with_ipv6_cidr_blocks
=
[
"
${
var
.
computed_ingress_with_ipv6_cidr_blocks
}
"
]
# Open for security group id
computed_ingress_with_source_security_group_id
=
[
"
${
var
.
computed_ingress_with_source_security_group_id
}
"
]
#############################
# Number of computed ingress
#############################
number_of_computed_ingress_rules
=
"
${
var
.
auto_number_of_computed_ingress_rules
+
var
.
number_of_computed_ingress_rules
}
"
number_of_computed_ingress_with_self
=
"
${
var
.
auto_number_of_computed_ingress_with_self
+
var
.
number_of_computed_ingress_with_self
}
"
number_of_computed_ingress_with_cidr_blocks
=
"
${
var
.
number_of_computed_ingress_with_cidr_blocks
}
"
number_of_computed_ingress_with_ipv6_cidr_blocks
=
"
${
var
.
number_of_computed_ingress_with_ipv6_cidr_blocks
}
"
number_of_computed_ingress_with_source_security_group_id
=
"
${
var
.
number_of_computed_ingress_with_source_security_group_id
}
"
#########
# 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 IPv4 cidr blocks
egress_with_cidr_blocks
=
[
"
${
var
.
egress_with_cidr_blocks
}
"
]
# Open to IPv6 cidr blocks
egress_with_ipv6_cidr_blocks
=
[
"
${
var
.
egress_with_ipv6_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
}
"
]
##################
# Computed Egress
##################
# Rules by names - open for default CIDR
computed_egress_rules
=
[
"
${
sort
(
distinct
(
concat
(
var
.
auto_computed_egress_rules
,
var
.
computed_egress_rules
)))
}
"
]
# Open for self
computed_egress_with_self
=
[
"
${
concat
(
var
.
auto_computed_egress_with_self
,
var
.
computed_egress_with_self
)
}
"
]
# Open to IPv4 cidr blocks
computed_egress_with_cidr_blocks
=
[
"
${
var
.
computed_egress_with_cidr_blocks
}
"
]
# Open to IPv6 cidr blocks
computed_egress_with_ipv6_cidr_blocks
=
[
"
${
var
.
computed_egress_with_ipv6_cidr_blocks
}
"
]
# Open for security group id
computed_egress_with_source_security_group_id
=
[
"
${
var
.
computed_egress_with_source_security_group_id
}
"
]
#############################
# Number of computed egress
#############################
number_of_computed_egress_rules
=
"
${
var
.
auto_number_of_computed_egress_rules
+
var
.
number_of_computed_egress_rules
}
"
number_of_computed_egress_with_self
=
"
${
var
.
auto_number_of_computed_egress_with_self
+
var
.
number_of_computed_egress_with_self
}
"
number_of_computed_egress_with_cidr_blocks
=
"
${
var
.
number_of_computed_egress_with_cidr_blocks
}
"
number_of_computed_egress_with_ipv6_cidr_blocks
=
"
${
var
.
number_of_computed_egress_with_ipv6_cidr_blocks
}
"
number_of_computed_egress_with_source_security_group_id
=
"
${
var
.
number_of_computed_egress_with_source_security_group_id
}
"
}
modules/rabbitmq/outputs.tf
0 → 100644
View file @
677a64ff
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
}
"
}
modules/rabbitmq/variables.tf
0 → 100644
View file @
677a64ff
#################
# Security group
#################
variable
"create"
{
description
=
"Whether to create security group and all rules"
default
=
true
}
variable
"vpc_id"
{
description
=
"ID of the VPC where to create security group"
}
variable
"name"
{
description
=
"Name of security group"
}
variable
"use_name_prefix"
{
description
=
"Whether to use name_prefix or fixed name. Should be true to able to update security group name after initial creation"
default
=
true
}
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_ipv6_cidr_blocks"
{
description
=
"List of ingress rules to create where 'ipv6_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
=
[]
}
variable
"ingress_ipv6_cidr_blocks"
{
description
=
"List of IPv6 CIDR ranges to use on all ingress rules"
default
=
[]
}
variable
"ingress_prefix_list_ids"
{
description
=
"List of prefix list IDs (for allowing access to VPC endpoints) to use on all ingress rules"
default
=
[]
}
###################
# Computed Ingress
###################
variable
"computed_ingress_rules"
{
description
=
"List of computed ingress rules to create by name"
default
=
[]
}
variable
"computed_ingress_with_self"
{
description
=
"List of computed ingress rules to create where 'self' is defined"
default
=
[]
}
variable
"computed_ingress_with_cidr_blocks"
{
description
=
"List of computed ingress rules to create where 'cidr_blocks' is used"
default
=
[]
}
variable
"computed_ingress_with_ipv6_cidr_blocks"
{
description
=
"List of computed ingress rules to create where 'ipv6_cidr_blocks' is used"
default
=
[]
}
variable
"computed_ingress_with_source_security_group_id"
{
description
=
"List of computed ingress rules to create where 'source_security_group_id' is used"
default
=
[]
}
variable
"computed_ingress_cidr_blocks"
{
description
=
"List of IPv4 CIDR ranges to use on all computed ingress rules"
default
=
[]
}
variable
"computed_ingress_ipv6_cidr_blocks"
{
description
=
"List of IPv6 CIDR ranges to use on all computed ingress rules"
default
=
[]
}
variable
"computed_ingress_prefix_list_ids"
{
description
=
"List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed ingress rules"
default
=
[]
}
###################################
# Number of computed ingress rules
###################################
variable
"number_of_computed_ingress_rules"
{
description
=
"Number of computed ingress rules to create by name"
default
=
0
}
variable
"number_of_computed_ingress_with_self"
{
description
=
"Number of computed ingress rules to create where 'self' is defined"
default
=
0
}
variable
"number_of_computed_ingress_with_cidr_blocks"
{
description
=
"Number of computed ingress rules to create where 'cidr_blocks' is used"
default
=
0
}
variable
"number_of_computed_ingress_with_ipv6_cidr_blocks"
{
description
=
"Number of computed ingress rules to create where 'ipv6_cidr_blocks' is used"
default
=
0
}
variable
"number_of_computed_ingress_with_source_security_group_id"
{
description
=
"Number of computed ingress rules to create where 'source_security_group_id' is used"
default
=
0
}
variable
"number_of_computed_ingress_cidr_blocks"
{
description
=
"Number of IPv4 CIDR ranges to use on all computed ingress rules"
default
=
0
}
variable
"number_of_computed_ingress_ipv6_cidr_blocks"
{
description
=
"Number of IPv6 CIDR ranges to use on all computed ingress rules"
default
=
0
}
variable
"number_of_computed_ingress_prefix_list_ids"
{
description
=
"Number of prefix list IDs (for allowing access to VPC endpoints) to use on all computed ingress rules"
default
=
0
}
#########
# 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_ipv6_cidr_blocks"
{
description
=
"List of egress rules to create where 'ipv6_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
=
[]
}
##################
# Computed Egress
##################
variable
"computed_egress_rules"
{
description
=
"List of computed egress rules to create by name"
default
=
[]
}
variable
"computed_egress_with_self"
{
description
=
"List of computed egress rules to create where 'self' is defined"
default
=
[]
}
variable
"computed_egress_with_cidr_blocks"
{
description
=
"List of computed egress rules to create where 'cidr_blocks' is used"
default
=
[]
}
variable
"computed_egress_with_ipv6_cidr_blocks"
{
description
=
"List of computed egress rules to create where 'ipv6_cidr_blocks' is used"
default
=
[]
}
variable
"computed_egress_with_source_security_group_id"
{
description
=
"List of computed egress rules to create where 'source_security_group_id' is used"
default
=
[]
}
variable
"computed_egress_cidr_blocks"
{
description
=
"List of IPv4 CIDR ranges to use on all computed egress rules"
default
=
[
"0.0.0.0/0"
]
}
variable
"computed_egress_ipv6_cidr_blocks"
{
description
=
"List of IPv6 CIDR ranges to use on all computed egress rules"
default
=
[
"::/0"
]
}
variable
"computed_egress_prefix_list_ids"
{
description
=
"List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules"
default
=
[]
}
##################################
# Number of computed egress rules
##################################
variable
"number_of_computed_egress_rules"
{
description
=
"Number of computed egress rules to create by name"
default
=
0
}
variable
"number_of_computed_egress_with_self"
{
description
=
"Number of computed egress rules to create where 'self' is defined"
default
=
0
}
variable
"number_of_computed_egress_with_cidr_blocks"
{
description
=
"Number of computed egress rules to create where 'cidr_blocks' is used"
default
=
0
}
variable
"number_of_computed_egress_with_ipv6_cidr_blocks"
{
description
=
"Number of computed egress rules to create where 'ipv6_cidr_blocks' is used"
default
=
0
}
variable
"number_of_computed_egress_with_source_security_group_id"
{
description
=
"Number of computed egress rules to create where 'source_security_group_id' is used"
default
=
0
}
variable
"number_of_computed_egress_cidr_blocks"
{
description
=
"Number of IPv4 CIDR ranges to use on all computed egress rules"
default
=
0
}
variable
"number_of_computed_egress_ipv6_cidr_blocks"
{
description
=
"Number of IPv6 CIDR ranges to use on all computed egress rules"
default
=
0
}
variable
"number_of_computed_egress_prefix_list_ids"
{
description
=
"Number of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules"
default
=
0
}
rules.tf
View file @
677a64ff
...
@@ -99,6 +99,12 @@ variable "rules" {
...
@@ -99,6 +99,12 @@ variable "rules" {
# Puppet
# Puppet
puppet
-
tcp
=
[
8140
,
8140
,
"tcp"
,
"Puppet"
]
puppet
-
tcp
=
[
8140
,
8140
,
"tcp"
,
"Puppet"
]
# RabbitMQ
rabbitmq
-
5671
-
tcp
=
[
5671
,
5671
,
"tcp"
,
"RabbitMQ"
]
rabbitmq
-
5672
-
tcp
=
[
5672
,
5672
,
"tcp"
,
"RabbitMQ"
]
rabbitmq
-
15672
-
tcp
=
[
15671
,
15671
,
"tcp"
,
"RabbitMQ"
]
rabbitmq
-
25672
-
tcp
=
[
25672
,
25672
,
"tcp"
,
"RabbitMQ"
]
# RDP
# RDP
rdp
-
tcp
=
[
3389
,
3389
,
"tcp"
,
"Remote Desktop"
]
rdp
-
tcp
=
[
3389
,
3389
,
"tcp"
,
"Remote Desktop"
]
rdp
-
udp
=
[
3389
,
3389
,
"udp"
,
"Remote Desktop"
]
rdp
-
udp
=
[
3389
,
3389
,
"udp"
,
"Remote Desktop"
]
...
@@ -296,6 +302,12 @@ variable "auto_groups" {
...
@@ -296,6 +302,12 @@ variable "auto_groups" {
egress_rules
=
[
"all-all"
]
egress_rules
=
[
"all-all"
]
}
}
rabbitmq
=
{
ingress_rules
=
[
"rabbitmq-5671-tcp"
,
"rabbitmq-5672-tcp"
,
"rabbitmq-15672-tcp"
,
"rabbitmq-25672-tcp"
]
ingress_with_self
=
[
"all-all"
]
egress_rules
=
[
"all-all"
]
}
rdp
=
{
rdp
=
{
ingress_rules
=
[
"rdp-tcp"
,
"rdp-udp"
]
ingress_rules
=
[
"rdp-tcp"
,
"rdp-udp"
]
ingress_with_self
=
[
"all-all"
]
ingress_with_self
=
[
"all-all"
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment