-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #424 from Azure/101-virtual-network-public-ip
101-virtual-network-public-ip
- Loading branch information
Showing
5 changed files
with
117 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
resource "random_pet" "rg_name" { | ||
prefix = var.resource_group_name_prefix | ||
} | ||
|
||
resource "azurerm_resource_group" "example" { | ||
location = var.resource_group_location | ||
name = random_pet.rg_name.id | ||
} | ||
|
||
resource "azurerm_public_ip" "myStandardPublicIP" { | ||
name = "myStandardPublicIP" | ||
resource_group_name = azurerm_resource_group.example.name | ||
location = azurerm_resource_group.example.location | ||
allocation_method = "Static" | ||
sku = "Standard" | ||
ip_version = "IPv4" | ||
zones = ["1", "2", "3"] | ||
} | ||
|
||
resource "azurerm_public_ip" "myBasicPublicIP" { | ||
name = "myBasicPublicIP" | ||
resource_group_name = azurerm_resource_group.example.name | ||
location = azurerm_resource_group.example.location | ||
allocation_method = "Static" | ||
sku = "Basic" | ||
ip_version = "IPv4" | ||
} | ||
|
||
resource "azurerm_public_ip" "myZonalStandardPublicIP" { | ||
name = "myZonalStandardPublicIP" | ||
resource_group_name = azurerm_resource_group.example.name | ||
location = azurerm_resource_group.example.location | ||
allocation_method = "Static" | ||
sku = "Standard" | ||
ip_version = "IPv4" | ||
zones = ["2"] | ||
} | ||
|
||
resource "azurerm_public_ip" "myNonZonalStandardPublicIP" { | ||
name = "myNonZonalStandardPublicIP" | ||
resource_group_name = azurerm_resource_group.example.name | ||
location = azurerm_resource_group.example.location | ||
allocation_method = "Static" | ||
sku = "Standard" | ||
ip_version = "IPv4" | ||
} | ||
|
||
resource "azurerm_public_ip" "myRoutingPreferenceStandardPublicIP" { | ||
name = "myRoutingPreferenceStandardPublicIP" | ||
resource_group_name = azurerm_resource_group.example.name | ||
location = azurerm_resource_group.example.location | ||
allocation_method = "Static" | ||
sku = "Standard" | ||
ip_version = "IPv4" | ||
|
||
ip_tags = { | ||
RoutingPreference = "Internet" | ||
} | ||
|
||
zones = ["1", "2", "3"] | ||
} | ||
|
||
resource "azurerm_public_ip" "myGlobalTierStandardPublicIP" { | ||
name = "myGlobalTierStandardPublicIP-Global" | ||
resource_group_name = azurerm_resource_group.example.name | ||
location = azurerm_resource_group.example.location | ||
allocation_method = "Static" | ||
sku = "Standard" | ||
sku_tier = "Global" | ||
ip_version = "IPv4" | ||
} |
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,3 @@ | ||
output "resource_group_name" { | ||
value = azurerm_resource_group.example.name | ||
} |
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,16 @@ | ||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~>3.0" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = "~>3.0" | ||
} | ||
} | ||
} | ||
|
||
provider "azurerm" { | ||
features {} | ||
} |
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,16 @@ | ||
# Azure Public IP Address | ||
|
||
This template deploys several Azure public IP addresses with different settings. | ||
|
||
## Terraform resource types | ||
|
||
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | ||
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | ||
- [azurerm_public_ip](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip) | ||
|
||
## Variables | ||
|
||
| Name | Description | Default | | ||
|-|-|-| | ||
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg | | ||
| `resource_group_location` | Location of the resource group. | eastus | |
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,11 @@ | ||
variable "resource_group_location" { | ||
type = string | ||
default = "West Europe" | ||
description = "Location of the resource group." | ||
} | ||
|
||
variable "resource_group_name_prefix" { | ||
type = string | ||
default = "rg" | ||
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription." | ||
} |