-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor security-group module (#57)
- Loading branch information
Showing
15 changed files
with
534 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
provider "aws" { | ||
region = "us-east-1" | ||
} | ||
|
||
data "aws_vpc" "default" { | ||
default = true | ||
} | ||
|
||
|
||
################################################### | ||
# Security Group | ||
################################################### | ||
|
||
module "security_group" { | ||
source = "../../modules/security-group" | ||
# source = "tedilabs/ipam/aws//modules/security-group" | ||
# version = "~> 0.30.0" | ||
|
||
vpc_id = data.aws_vpc.default.id | ||
|
||
name = "hello-world" | ||
|
||
tags = { | ||
"project" = "terraform-aws-network-examples" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output "security_group" { | ||
description = "The Security Group." | ||
value = module.security_group | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
terraform { | ||
required_version = "~> 1.5" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 5.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
provider "aws" { | ||
region = "us-east-1" | ||
} | ||
|
||
data "aws_vpc" "default" { | ||
default = true | ||
} | ||
|
||
|
||
################################################### | ||
# Security Group | ||
################################################### | ||
|
||
module "security_group" { | ||
source = "../../modules/security-group" | ||
# source = "tedilabs/ipam/aws//modules/security-group" | ||
# version = "~> 0.30.0" | ||
|
||
vpc_id = data.aws_vpc.default.id | ||
|
||
name = "hello-world-ipv4-cidrs" | ||
description = "Sample Security Group with IPv4 CIDRs." | ||
|
||
revoke_rules_on_delete = true | ||
|
||
ingress_rules = [ | ||
{ | ||
id = "tcp/80" | ||
description = "Allow HTTP from VPC" | ||
from_port = 80 | ||
to_port = 80 | ||
protocol = "tcp" | ||
ipv4_cidrs = ["192.168.0.0/16", "10.0.0.0/8", "172.168.0.0/24"] | ||
}, | ||
] | ||
egress_rules = [ | ||
{ | ||
id = "all/all" | ||
description = "Allow all traffics to the internet" | ||
from_port = 0 | ||
to_port = 0 | ||
protocol = "-1" | ||
ipv4_cidrs = ["0.0.0.0/0"] | ||
}, | ||
] | ||
|
||
tags = { | ||
"project" = "terraform-aws-network-examples" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output "security_group" { | ||
description = "The Security Group." | ||
value = module.security_group | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
terraform { | ||
required_version = "~> 1.5" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 5.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.