*[EC2-VPC Security Group Rule](https://www.terraform.io/docs/providers/aws/r/security_group_rule.html)
## Features
This module aims to implement **ALL** combinations of arguments supported by AWS and latest stable version of Terraform:
...
...
@@ -18,7 +13,7 @@ This module aims to implement **ALL** combinations of arguments supported by AWS
* Access from self
* Named rules ([see the rules here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/rules.tf))
* Named groups of rules with ingress (inbound) and egress (outbound) ports open for common scenarios (eg, [ssh](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/ssh), [http-80](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/http-80), [mysql](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/modules/mysql), see the whole list [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/README.md))
* Conditionally create security group and all required security group rules ("single boolean switch").
* Conditionally create security group and/or all required security group rules.
Ingress and egress rules can be configured in a variety of ways. See [inputs section](#inputs) for all supported arguments and [complete example](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/examples/complete) for the complete use-case.
...
...
@@ -26,7 +21,7 @@ If there is a missing feature or a bug - [open an issue](https://github.com/terr
## Terraform versions
For Terraform 0.12 use version `v3.*` of this module or newer.
For Terraform 0.12 use version `v4.*` of this module or newer.
If you are using Terraform 0.11 you can use versions `v2.*`.
...
...
@@ -143,6 +138,7 @@ module "vote_service_sg" {
## Examples
*[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.
*[Security Group "Rules Only" example](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/examples/complete) shows how to manage just rules of a security group that is created outside.
*[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.
*[Disable creation of Security Group example](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/examples/disabled) shows how to disable creation of security group.
*[Dynamic values inside Security Group rules example](https://github.com/terraform-aws-modules/terraform-aws-security-group/tree/master/examples/dynamic) shows how to specify values inside security group rules (data-sources and variables are allowed).
...
...
@@ -217,6 +213,7 @@ No modules.
| <aname="input_computed_ingress_with_self"></a>[computed\_ingress\_with\_self](#input\_computed\_ingress\_with\_self) | List of computed ingress rules to create where 'self' is defined | `list(map(string))` | `[]` | no |
| <aname="input_computed_ingress_with_source_security_group_id"></a>[computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no |
| <aname="input_create"></a>[create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no |
| <aname="input_create_sg"></a>[create\_sg](#input\_create\_sg) | Whether to create security group | `bool` | `true` | no |
| <aname="input_description"></a>[description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no |
| <aname="input_egress_cidr_blocks"></a>[egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
| <aname="input_egress_ipv6_cidr_blocks"></a>[egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` | <pre>[<br> "::/0"<br>]</pre> | no |
...
...
@@ -234,7 +231,7 @@ No modules.
| <aname="input_ingress_with_ipv6_cidr_blocks"></a>[ingress\_with\_ipv6\_cidr\_blocks](#input\_ingress\_with\_ipv6\_cidr\_blocks) | List of ingress rules to create where 'ipv6\_cidr\_blocks' is used | `list(map(string))` | `[]` | no |
| <aname="input_ingress_with_self"></a>[ingress\_with\_self](#input\_ingress\_with\_self) | List of ingress rules to create where 'self' is defined | `list(map(string))` | `[]` | no |
| <aname="input_ingress_with_source_security_group_id"></a>[ingress\_with\_source\_security\_group\_id](#input\_ingress\_with\_source\_security\_group\_id) | List of ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no |
| <aname="input_name"></a>[name](#input\_name) | Name of security group | `string` | n/a | yes |
| <aname="input_name"></a>[name](#input\_name) | Name of security group - not required if create\_group is false | `string` | `null` | no |
| <aname="input_number_of_computed_egress_rules"></a>[number\_of\_computed\_egress\_rules](#input\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no |
| <aname="input_number_of_computed_egress_with_cidr_blocks"></a>[number\_of\_computed\_egress\_with\_cidr\_blocks](#input\_number\_of\_computed\_egress\_with\_cidr\_blocks) | Number of computed egress rules to create where 'cidr\_blocks' is used | `number` | `0` | no |
| <aname="input_number_of_computed_egress_with_ipv6_cidr_blocks"></a>[number\_of\_computed\_egress\_with\_ipv6\_cidr\_blocks](#input\_number\_of\_computed\_egress\_with\_ipv6\_cidr\_blocks) | Number of computed egress rules to create where 'ipv6\_cidr\_blocks' is used | `number` | `0` | no |
...
...
@@ -247,9 +244,10 @@ No modules.
| <aname="input_number_of_computed_ingress_with_source_security_group_id"></a>[number\_of\_computed\_ingress\_with\_source\_security\_group\_id](#input\_number\_of\_computed\_ingress\_with\_source\_security\_group\_id) | Number of computed ingress rules to create where 'source\_security\_group\_id' is used | `number` | `0` | no |
| <aname="input_revoke_rules_on_delete"></a>[revoke\_rules\_on\_delete](#input\_revoke\_rules\_on\_delete) | Instruct Terraform to revoke all of the Security Groups attached ingress and egress rules before deleting the rule itself. Enable for EMR. | `bool` | `false` | no |
| <aname="input_security_group_id"></a>[security\_group\_id](#input\_security\_group\_id) | ID of existing security group whose rules we will manage | `string` | `null` | no |
| <aname="input_tags"></a>[tags](#input\_tags) | A mapping of tags to assign to security group | `map(string)` | `{}` | no |
| <aname="input_use_name_prefix"></a>[use\_name\_prefix](#input\_use\_name\_prefix) | Whether to use name\_prefix or fixed name. Should be true to able to update security group name after initial creation | `bool` | `true` | no |
| <aname="input_vpc_id"></a>[vpc\_id](#input\_vpc\_id) | ID of the VPC where to create security group | `string` | n/a | yes |
| <aname="input_vpc_id"></a>[vpc\_id](#input\_vpc\_id) | ID of the VPC where to create security group | `string` | `null` | no |
| [aws_security_group.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/security_group) | data source |
| [aws_vpc.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source |
## Inputs
No inputs.
## Outputs
| Name | Description |
|------|-------------|
| <aname="output_service_one_security_group_id"></a>[service\_one\_security\_group\_id](#output\_service\_one\_security\_group\_id) | The ID of the security group for service one |
| <aname="output_service_two_security_group_id"></a>[service\_two\_security\_group\_id](#output\_service\_two\_security\_group\_id) | The ID of the security group for service two |