Skip to content

Commit

Permalink
Merge pull request #25 from babbel/unify-variables
Browse files Browse the repository at this point in the history
Unify structure of module variables
  • Loading branch information
jansiwy authored Sep 23, 2024
2 parents 9dbbafc + b629cf8 commit 1218a0f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 19 deletions.
2 changes: 1 addition & 1 deletion _test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ provider "aws" {
}

module "nlb" {
source = "./.."
source = "./.."

name = "example"

Expand Down
30 changes: 20 additions & 10 deletions subnet/variables.tf
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
variable "availability_zone" {
description = "Availability zone of the subnet"

type = string

description = <<EOS
Availability zone of the subnet.
EOS
}

variable "cidr_block" {
description = "Subnet CIDR"

type = string

description = <<EOS
Subnet CIDR.
EOS
}

variable "name" {
description = "Name of the NLB"

type = string

description = <<EOS
Name of the NLB.
EOS
}

variable "tags" {
description = "Map of tags to assign to all resources supporting tags (in addition to the `Name` tag)"

type = map(string)

description = <<EOS
Map of tags assigned to all AWS resources created by this module.
EOS
}

variable "vpc" {
description = "VPC where the subnet will be created"

type = object({
id = string
})

description = <<EOS
VPC where the subnet will be created.
EOS
}
24 changes: 16 additions & 8 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
variable "cidr_blocks" {
description = "Map of subnet CIDRs by availability zone used by the NLB"

type = map(string)

description = <<EOS
Map of subnet CIDRs by availability zone used by the NLB.
EOS
}

variable "name" {
description = "Name of the NLB"

type = string

description = <<EOS
Name of the NLB.
EOS
}

variable "tags" {
description = "Map of tags to assign to all resources supporting tags (in addition to the `Name` tag)"

type = map(string)
default = {}

description = <<EOS
Map of tags assigned to all AWS resources created by this module.
EOS
}

variable "vpc" {
description = "VPC where the NLB and the subnets will be created"

type = object({
id = string
})

description = <<EOS
VPC where the NLB and the subnets will be created.
EOS
}

0 comments on commit 1218a0f

Please sign in to comment.