-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding public ip for Application gateway
- Loading branch information
1 parent
abe5881
commit 65e892f
Showing
4 changed files
with
170 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
resource "azurerm_public_ip" "this" { | ||
count = var.create_app_gateway ? 1 : 0 | ||
|
||
name = var.pip_name | ||
resource_group_name = var.resource_group_name | ||
location = var.location | ||
allocation_method = var.allocation_method | ||
zones = var.zones | ||
ddos_protection_mode = var.ddos_protection_mode | ||
ddos_protection_plan_id = var.ddos_protection_plan_id | ||
domain_name_label = var.domain_name_label | ||
edge_zone = var.edge_zone | ||
idle_timeout_in_minutes = var.idle_timeout_in_minutes | ||
ip_tags = var.ip_tags | ||
ip_version = var.ip_version | ||
public_ip_prefix_id = var.public_ip_prefix_id | ||
reverse_fqdn = var.reverse_fqdn | ||
sku = var.sku | ||
sku_tier = var.sku_tier | ||
|
||
tags = var.tags | ||
} | ||
|
||
|
||
/* resource "azurerm_application_gateway" "this" { | ||
count = var.create_app_gateway ? 1 : 0 | ||
} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
output "pip_id" { | ||
description = "The ID of this Public IP." | ||
value = try(azurerm_public_ip.this[0].id, "") | ||
} | ||
|
||
output "ip_address" { | ||
description = "The IP address value that was allocated." | ||
value = try(azurerm_public_ip.this[0].ip_address, "") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
variable "create_app_gateway" { | ||
type = bool | ||
description = "description" | ||
default = true | ||
} | ||
|
||
variable "pip_name" { | ||
type = string | ||
description = "(Required) Specifies the name of the Public IP. Changing this forces a new Public IP to be created." | ||
} | ||
|
||
variable "resource_group_name" { | ||
type = string | ||
description = "(Required) The name of the Resource Group where this Public IP should exist. Changing this forces a new Public IP to be created." | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
description = "(Required) Specifies the supported Azure location where the Public IP should exist. Changing this forces a new resource to be created." | ||
} | ||
|
||
variable "allocation_method" { | ||
type = string | ||
description = "Required) Defines the allocation method for this IP address. Possible values are Static or Dynamic." | ||
default = "Static" | ||
} | ||
|
||
variable "zones" { | ||
type = list(string) | ||
description = "(Optional) A collection containing the availability zone to allocate the Public IP in. Changing this forces a new resource to be created." | ||
default = [] | ||
} | ||
|
||
variable "ddos_protection_mode" { | ||
type = string | ||
description = "(Optional) The DDoS protection mode of the public IP. Possible values are Disabled, Enabled, and VirtualNetworkInherited. Defaults to VirtualNetworkInherited." | ||
default = "VirtualNetworkInherited" | ||
} | ||
|
||
variable "ddos_protection_plan_id" { | ||
type = string | ||
description = "(Optional) The ID of DDoS protection plan associated with the public IP." | ||
default = null | ||
} | ||
|
||
variable "domain_name_label" { | ||
type = string | ||
description = "(Optional) Label for the Domain Name. Will be used to make up the FQDN. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system." | ||
default = null | ||
} | ||
|
||
variable "edge_zone" { | ||
type = string | ||
description = "(Optional) Specifies the Edge Zone within the Azure Region where this Public IP should exist. Changing this forces a new Public IP to be created." | ||
default = null | ||
} | ||
|
||
variable "idle_timeout_in_minutes" { | ||
type = number | ||
description = "(Optional) Specifies the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes." | ||
default = 4 | ||
} | ||
|
||
variable "ip_tags" { | ||
type = map(string) | ||
description = "(Optional) A mapping of IP tags to assign to the public IP. Changing this forces a new resource to be created." | ||
default = {} | ||
} | ||
|
||
variable "ip_version" { | ||
type = string | ||
description = "(Optional) The IP Version to use, IPv6 or IPv4. Changing this forces a new resource to be created." | ||
default = "IPv4" | ||
} | ||
|
||
variable "public_ip_prefix_id" { | ||
type = string | ||
description = "(Optional) If specified then public IP address allocated will be provided from the public IP prefix resource. Changing this forces a new resource to be created." | ||
default = null | ||
} | ||
|
||
variable "reverse_fqdn" { | ||
type = string | ||
description = "(Optional) A fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN." | ||
default = null | ||
} | ||
|
||
variable "sku" { | ||
type = string | ||
description = "(Optional) The SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Standard. Changing this forces a new resource to be created." | ||
default = "Standard" | ||
} | ||
|
||
variable "sku_tier" { | ||
type = string | ||
description = "(Optional) The SKU Tier that should be used for the Public IP. Possible values are Regional and Global. Defaults to Regional. Changing this forces a new resource to be created." | ||
default = "Regional" | ||
} | ||
|
||
variable "tags" { | ||
type = map(string) | ||
description = "(Optional) A mapping of tags to assign to the resource." | ||
default = {} | ||
} |