tf-azurerm-module_primitive-network_security_group

module
v0.0.0-...-43b988c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: Apache-2.0

README

tf-azurerm-module_primitive-network_security_group

License

Overview

This module deploys a network security group.

Usage

See examples/nsg for a full working example.

Module Development

Pre-Requisites

The following commands should be available on your system:

  • asdf or mise
  • make
  • python3 (for pre-commit)

Additionally, your git user and email must be configured. Run the make configure command from the root of the repository to ensure that you meet these requirements.

Pre-Commit hooks

The .pre-commit-config.yaml file defines pre-commit hooks for Terraform formatting, validation, documentation generation, and detect-secrets. Hooks are installed when you run make configure. Go linting runs via make lint in local development and CI, not via pre-commit.

Terratest examples

Post-deploy tests in tests/post_deploy_functional/ and tests/post_deploy_functional_readonly/ target examples/nsg via an explicit folder constant in each main_test.go. Adding another example requires a new test entry point or updating that constant; it is not picked up automatically.

Local Validation

You should validate the changes you make to any module locally, prior to pushing your changes in a branch to GitHub.

  1. Ensure that you have run make configure successfully.
  2. Ensure you are signed into the appropriate cloud provider (e.g. Azure) for the module under test in your current console session.
  3. Run the Terraform and Golang linters:
make lint
  1. Once linters pass, run integration tests (apply, test, destroy):
make test

The pre-commit validations, as well as the make lint and make test targets, are performed in CI. Running them locally before opening a PR helps ensure a smooth review.

Review & Merge Process

Open a Pull Request to the default (main) branch. The PR title must follow Conventional Commits format to merge and to drive semantic versioning.

Ensure CI workflows pass, address review feedback, and obtain approvals required by CODEOWNERS.

Automatic Updates

Shared configuration and workflow files are largely managed through launch-terraform-skeleton. Avoid one-off edits to copied skeleton files in this repository unless necessary (for example .gitignore entries for generated artifacts). Use copier check-update / copier update when refreshing from the skeleton.

Requirements

Name Version
terraform ~> 1.3
azurerm ~> 3.77

Modules

No modules.

Resources

Name Type
azurerm_network_security_group.network_security_group resource

Inputs

Name Description Type Default Required
location (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. string n/a yes
name (Required) Specifies the name of the network security group. Changing this forces a new resource to be created. string n/a yes
resource_group_name (Required) The name of the resource group in which to create the network security group. Changing this forces a new resource to be created. string n/a yes
security_rules (Optional) A list of security rules associated with the network security group.
list(object({
name = string
protocol = string
access = string
priority = number
direction = string
description = optional(string)
source_port_range = optional(string)
source_port_ranges = optional(list(string))
destination_port_range = optional(string)
destination_port_ranges = optional(list(string))
source_address_prefix = optional(string)
source_address_prefixes = optional(list(string))
source_application_security_group_ids = optional(list(string))
destination_address_prefix = optional(string)
destination_address_prefixes = optional(list(string))
destination_application_security_group_ids = optional(list(string))
}))
null no
tags (Optional) A mapping of tags to assign to the resource. map(string) {} no

Outputs

Name Description
network_security_group_id value of the network security group id.

Directories

Path Synopsis
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL