Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
NLB module (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Puneeth-n authored Dec 6, 2021
1 parent 7ea133d commit 7b73044
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
36 changes: 36 additions & 0 deletions nlb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_lb.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_enable_cross_zone_load_balancing"></a> [enable\_cross\_zone\_load\_balancing](#input\_enable\_cross\_zone\_load\_balancing) | Whether the loadbalancer should have cross zone load balancing enabled | `bool` | `true` | no |
| <a name="input_enable_delete_protection"></a> [enable\_delete\_protection](#input\_enable\_delete\_protection) | Whether the loadbalancer should have delete protection enabled | `bool` | `true` | no |
| <a name="input_internal"></a> [internal](#input\_internal) | Whether the loadbalancer is internal or not | `bool` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | The name of the loadbalancer | `string` | n/a | yes |
| <a name="input_subnets"></a> [subnets](#input\_subnets) | The subnets to attach to the loadbalancer | `list(string)` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to apply to the loadbalancer | `map(string)` | `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_output"></a> [output](#output\_output) | Loadbalancer attributes |
47 changes: 47 additions & 0 deletions nlb/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
variable "name" {
type = string
description = "The name of the loadbalancer"
}

variable "internal" {
type = bool
description = "Whether the loadbalancer is internal or not"
}

variable "subnets" {
type = list(string)
description = "The subnets to attach to the loadbalancer"
}

variable "enable_delete_protection" {
type = bool
description = "Whether the loadbalancer should have delete protection enabled"
default = true
}

variable "enable_cross_zone_load_balancing" {
type = bool
description = "Whether the loadbalancer should have cross zone load balancing enabled"
default = true
}

variable "tags" {
type = map(string)
description = "Tags to apply to the loadbalancer"
default = {}
}

resource "aws_lb" "this" {
name = var.name
internal = var.internal
load_balancer_type = "network"
enable_deletion_protection = var.enable_delete_protection
enable_cross_zone_load_balancing = var.enable_cross_zone_load_balancing
subnets = var.subnets
tags = var.tags
}

output "output" {
value = aws_lb.this
description = "Loadbalancer attributes"
}

0 comments on commit 7b73044

Please sign in to comment.