Skip to content

Commit

Permalink
inboud variable define
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol Nagpal committed Jan 9, 2023
1 parent a940492 commit 3835ceb
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 36 deletions.
64 changes: 35 additions & 29 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,39 @@ usage: |-
### Simple Example
Here is an example of how you can use this module in your inventory structure:
```hcl
module "network_security_group" {
source = "clouddrove/network-security-group/azure"
version = "1.0.0"
name = "example"
environment = "test"
label_order = ["name","environment"]
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
custom_port = [{
name = "ssh"
protocol = "Tcp"
source_port_range = "*"
destination_port_ranges = ["22"]
source_address_prefixes = ["67.23.123.234/32"]
destination_address_prefixes = ["0.0.0.0/0"]
access = "Allow"
priority = 1002
},
{
name = "http-https"
protocol = "Tcp"
source_port_range = "*"
destination_port_ranges = ["80","443"]
source_address_prefixes = ["0.0.0.0/0"]
destination_address_prefixes = ["0.0.0.0/0"]
access = "Allow"
priority = 1003
}]
}
module "network_security_group" {
source = "clouddrove/subnet/network-security-group"
version = "1.0.0"
resource_group_location = module.resource_group.resource_group_location
source = "../"
label_order = ["name", "environment"]
app_name = "app"
environment = "test"
subnet_ids = module.subnet.default_subnet_id
resource_group_name = module.resource_group.resource_group_name
inbound_rules = [
{
name = "ssh"
priority = 101
access = "Allow"
protocol = "Tcp"
source_address_prefix = "67.23.123.234/32"
source_port_range = "*"
destination_address_prefix = "0.0.0.0/0"
destination_port_range = "22"
description = "ssh allowed port"
},
{
name = "https"
priority = 102
access = "Allow"
protocol = "Tcp"
source_address_prefix = "*"
source_port_range = "*"
destination_address_prefix = "0.0.0.0/0"
destination_port_range = "22"
description = "ssh allowed port"
}
]
}
```
38 changes: 31 additions & 7 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module "resource_group" {
source = "clouddrove/resource-group/azure"
version = "1.0.1"
label_order = ["name", "environment", ]
name = "ota"
environment = "staging"
name = "app-name"
environment = "test"
location = "Canada Central"
}

Expand All @@ -18,8 +18,8 @@ module "vnet" {
version = "1.0.0"
label_order = ["name", "environment"]

name = "ota"
environment = "staging"
name = "app"
environment = "test"
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location
address_space = "10.30.0.0/22"
Expand All @@ -44,7 +44,7 @@ module "subnet" {

routes = [
{
name = "rt-ota-staging"
name = "rt-app-test"
address_prefix = "0.0.0.0/0"
next_hop_type = "VirtualAppliance"
next_hop_in_ip_address = "10.20.0.4"
Expand All @@ -58,8 +58,32 @@ module "network_security_group" {
resource_group_location = module.resource_group.resource_group_location
source = "../"
label_order = ["name", "environment"]
app_name = "ota"
environment = "staging"
app_name = "app"
environment = "test"
subnet_ids = module.subnet.default_subnet_id
resource_group_name = module.resource_group.resource_group_name
inbound_rules = [
{
name = "ssh"
priority = 101
access = "Allow"
protocol = "Tcp"
source_address_prefix = "67.23.123.234/32"
source_port_range = "*"
destination_address_prefix = "0.0.0.0/0"
destination_port_range = "22"
description = "ssh allowed port"
},
{
name = "https"
priority = 102
access = "Allow"
protocol = "Tcp"
source_address_prefix = "*"
source_port_range = "*"
destination_address_prefix = "0.0.0.0/0"
destination_port_range = "22"
description = "ssh allowed port"
}
]
}

0 comments on commit 3835ceb

Please sign in to comment.