You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
unless a module is constructed in a different way, variables.tf should start with these vars in this particular order:
name
resource_group_name
locations
tags
keep vars related to the same type of resource next to each other, i.e. create_subnets should be next to subnets
order the variables, either:
based on decision steps when designing infrastructure, i.e. create_subnets 1st, then subnets definition (you have to decide if you create subnets, or do you source them, then you provide the specs, which will differ based on your decision)
based on dependencies between resources, i.e. you define NSGs and RTs 1st, then Subnets, as in subnets variable we point to already defined NSGs and RTs.
if no other criteria matches, based on importance or usage frequency.
Keep in mind that his order will be retained in a README.md.
Description format
Follow the example below:
description=<<-EOFA short, one sentence description of the variable.Some more detailed description, can be multiple lines.List of either required or important properties:- `name` - (`string`, required) name of the Network Security Group.- `some_optional_value` - (`string`, optional, defaults to `null`) some description- `some_complex_property` - (`map`, optional) A list of objects representing something. - `name` - (`string`, required) name of the something - `some_number` - (`number`, optional, defaults to `5`) numeric value - `some_value_1` - (`string`, required, mutually exclusive with `some_value_2`) some description - `some_value_2` - (`string`, required, mutually exclusive with `some_value_1`) some description - `some_optional_value` - (`bool`, optional, defaults to `false`)List of other, optional properties:- `less_important_1` - (`string`, optional, defaults to `null`) some description- `less_important_2` - (`string`, optional, defaults Azure defaults) some description- `less_important_3` - (`string`, optional, defaults to `""`) some description- `less_important_4` - (`list(string)`, optional, defaults to `[]`) some descriptionExample:```hcl{ "object_1" = { name = "name of object 1" ..... }}```EOF
Common variables
Replace the following variables with this definitions:
variable"name" {
description="The name of the Azure Virtual Network."type=string
}
variable"resource_group_name" {
description="The name of the Resource Group to use."type=string
}
variable"location" {
description="The name of the Azure region to deploy the resources in."type=string
}
variable"tags" {
description="The map of tags to assign to all created resources."default={}
type=map(string)
}
The text was updated successfully, but these errors were encountered:
A NOTE: I think we should add these guidelines to somewhere like CONTRIBUTING before closing this issue; in order to follow the same conventions in the future.
An issue tracker for modules (and example) refactor.
Introduction
The key points to address when refactoring the modules:
optional
keyword.header.md
.
) should contain a summaryvariables.tf
in order that makes sense (see below)name
ortags
(see below for a copy&paste pattern to follow)lookup
/try
statements where possible -> relay on default values (for complex variables as well)enable_zones
- use smart defaults insteadadd tests to you module (follow vnet refactor #337)TBDIssues per module
Variables ordering
Some basic principals:
variables.tf
should start with these vars in this particular order:name
resource_group_name
locations
tags
create_subnets
should be next tosubnets
create_subnets
1st, thensubnets
definition (you have to decide if you create subnets, or do you source them, then you provide the specs, which will differ based on your decision)subnets
variable we point to already defined NSGs and RTs.Keep in mind that his order will be retained in a
README.md
.Description format
Follow the example below:
Common variables
Replace the following variables with this definitions:
The text was updated successfully, but these errors were encountered: