Skip to content

Commit

Permalink
Modified Code
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-das committed Jan 10, 2020
1 parent 9b8d062 commit 4eacf41
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ This module deploys aws services details are in respective feature branches.

Below we are able to check the resources that are being created as part of this module call:

From branch : **_terrform-12/master_**

- **_Security Group (Terraform 12 supported code)_**
- **_Security Group_**



Expand Down Expand Up @@ -51,7 +49,7 @@ module "<layer>-security-group-<AccountID>" {
}
# Tags
common_tags = merge(
tags = merge(
var.common_tags,
{
"Name" = "service-sg"
Expand Down Expand Up @@ -94,17 +92,15 @@ module "<layer>-security-group-<AccountID>" {
The variables required in order for the module to be successfully called from the deployment repository are the following:


| **_Variable_** | **_Description_** | **_Type_** |
|-------------------------------|---------------------------------------------|-----------------|
| name_prefix | Name prefix | string |
| description | description | string |
| vpc_id | VPC ID | String |
| common_tags | Tag | map(string) |
| revoke_rules_on_delete | Instruct Terraform to revoke | string |
| ingress_rules | Ingress Rules | any |
| egress_rules | Egress Rules | any |


|**_Variable_** | **_Description_** | **_Type_** | **_Argument Status_** |
|:----|:----|-----:|-----:|
| **_name\_prefix_** | Name prefix | _string_ | **_Required_** |
| **_description_** | description | _string_ | **_Required_** |
| **_vpc\_id_** | VPC ID | _string_ | **_Required_** |
| **_tags_** | Resource Tag | _map(string)_ | **_Required_** |
| **_revoke\_rules\_on\_delete_** | Instruct Terraform to revoke | _string_ | **_Optional_** *(Default - **false**)* |
| **_ingress\_rules_** | Ingress Rules | _any_ | **_Optional_** *(Default - **[]**)* |
| **_egress\_rules_** | Egress Rules | _any_ | **_Optional_** *(Default - **[]**)* |



Expand Down
2 changes: 1 addition & 1 deletion security-groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "aws_security_group" "security_group" {
description = var.description
vpc_id = var.vpc_id
revoke_rules_on_delete = var.revoke_rules_on_delete
tags = var.common_tags
tags = var.tags

lifecycle {
create_before_destroy = true
Expand Down
6 changes: 5 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@ variable "description" {

variable "revoke_rules_on_delete" {
description = "Instruct Terraform to revoke all of the Security Groups attached ingress and egress rules before deleting the rule itself."
type = bool
default = false
}

variable "vpc_id" {
description = "The VPC ID."
}

variable "common_tags" {
variable "tags" {
description = "A mapping of tags to assign to the resource."
type = map(string)
}

variable "ingress_rules" {
description = "Ingress rules for security group"
type = any
default = []
}

variable "egress_rules" {
description = "Egress rules for security group"
type = any
default = []
}

0 comments on commit 4eacf41

Please sign in to comment.