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
Copy file name to clipboardExpand all lines: articles/virtual-network/ip-services/create-public-ip-terraform.md
+27-73Lines changed: 27 additions & 73 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,11 @@ In this article, you learn how to:
33
33
> * Create a standard static public IPv4 address named **myRoutingPreferenceStandardPublicIP** that supports the Routing Preference feature
34
34
> * Create a standard static public IPv4 address named **myGlobalTierStandardPublicIP** that supports the Global Tier feature
35
35
36
+
> [!NOTE]
37
+
> The sample code for this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/quickstart/101-virtual-network-public-ip). You can view the log file containing the [test results from current and previous versions of Terraform](https://github.com/Azure/terraform/tree/master/quickstart/101-virtual-network-public-ip/TestRecord.md).
38
+
>
39
+
> See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform)
40
+
36
41
## Create a resource group
37
42
38
43
An Azure resource group is a logical container into which Azure resources are deployed and managed.
@@ -46,20 +51,10 @@ An Azure resource group is a logical container into which Azure resources are de
46
51
>[!NOTE]
47
52
>Standard SKU public IP is recommended for production workloads. For more information about SKUs, see **[Public IP addresses](public-ip-addresses.md)**.
48
53
>
49
-
>The following command works for API version **2020-08-01** or **later**. For more information about the API version currently being used, see [Resource Providers and Types](../../azure-resource-manager/management/resource-providers-and-types.md).
50
-
51
-
Use [az network public-ip create](/cli/azure/network/public-ip#az-network-public-ip-create) to create a standard zone-redundant public IPv4 address named **myStandardPublicIP** in **QuickStartCreateIP-rg**.
54
+
>The following command snippet works for API version **2020-08-01** or **later**. For more information about the API version currently being used, see [Resource Providers and Types](../../azure-resource-manager/management/resource-providers-and-types.md).
52
55
53
-
To create an IPv6 address, modify the `--version` parameter to **IPv6**.
> For versions of the API older than 2020-08-01, execute the command without specifying a `--zone` parameter to create a zone-redundant IP address.
65
60
>
@@ -68,19 +63,11 @@ To create an IPv6 address, modify the `--version` parameter to **IPv6**.
68
63
69
64
In this section, you create a basic IP. Basic public IPs don't support availability zones.
70
65
71
-
Use [az network public-ip create](/cli/azure/network/public-ip#az-network-public-ip-create) to create a basic static public IPv4 address named **myBasicPublicIP** in **QuickStartCreateIP-rg**.
66
+
The followingcode snippet creates an IPv6 address, modify the `--version` parameter to **IPv6**.
72
67
73
-
To create an IPv6 address, modify the `--version` parameter to **IPv6**.
If it's acceptable for the IP address to change over time, **Dynamic** IP assignment can be selected by changing the **`--allocation-method`** to **Dynamic**.
70
+
If it's acceptable for the IP address to change over time, **Dynamic** IP assignment can be selected by changing the `allocation_method` value to **Dynamic**.
84
71
85
72
>[!NOTE]
86
73
> A basic IPv6 address must always be `Dynamic`.
@@ -93,18 +80,11 @@ In this section, you learn how to create a zonal or no-zone public IP address.
93
80
94
81
# [**Zonal**](#tab/create-public-ip-zonal)
95
82
96
-
To create a standard zonal public IPv4 address in Zone 2 named **myStandardPublicIP** in **QuickStartCreateIP-rg**, use the following command.
83
+
The following code snippet creates a standard zonal public IPv4 address in Zone 2 named **myZonalStandardPublicIP**.
97
84
98
-
To create an IPv6 address, modify the `--version`parameter to **IPv6**.
85
+
To create an IPv6 address, set the `version`value to **IPv6**.
>The above options for zones are only valid selections in regions with [Availability Zones](../../reliability/availability-zones-overview.md?toc=%2fazure%2fvirtual-network%2ftoc.json).
@@ -116,20 +96,15 @@ In this section, you create a non-zonal IP address.
116
96
>[!NOTE]
117
97
>The following command works for API version 2020-08-01 or later. For more information about the API version currently being used, see [Resource Providers and Types](../../azure-resource-manager/management/resource-providers-and-types.md).
118
98
119
-
Use [az network public-ip create](/cli/azure/network/public-ip#az-network-public-ip-create) to create a standard public IPv4 address as a non-zonal resource named **myStandardPublicIP-nozone** in **QuickStartCreateIP-rg**.
99
+
The following code snippet creates a standard public IPv4 address as a non-zonal resource named **myNonZonalStandardPublicIP**.
120
100
121
-
To create an IPv6 address, modify the `--version`parameter to **IPv6**.
101
+
To create an IPv6 address, set the `version`value to **IPv6**.
122
102
123
-
```azurecli-interactive
124
-
az network public-ip create \
125
-
--resource-group QuickStartCreateIP-rg \
126
-
--name myStandardPublicIP-nozone \
127
-
--version IPv4 \
128
-
--sku Standard
129
-
```
130
-
The removal of the `--zone` parameter in the command is valid in all regions.
The removal of the `--zone` parameter is the default selection for standard public IP addresses in regions without [Availability Zones](../../reliability/availability-zones-overview.md?toc=%2fazure%2fvirtual-network%2ftoc.json).
105
+
The removal of the `zone` field is valid in all regions.
106
+
107
+
The removal of the `zone` field is the default selection for standard public IP addresses in regions without [Availability Zones](../../reliability/availability-zones-overview.md?toc=%2fazure%2fvirtual-network%2ftoc.json).
133
108
134
109
---
135
110
@@ -145,55 +120,34 @@ The selection of **Internet** minimizes travel on Microsoft's network, instead u
145
120
146
121
For more information on routing preference, see [What is routing preference (preview)?](routing-preference-overview.md).
147
122
148
-
The command creates a new standard zone-redundant public IPv4 address with a routing preference of type **Internet**:
123
+
The following code snippet creates a new standard zone-redundant public IPv4 address with a routing preference of type **Internet**:
Public IP addresses are associated with a single region. The **Global** tier spans an IP address across multiple regions. **Global** tier is required for the frontends of cross-region load balancers.
163
130
164
131
For more information, see [Cross-region load balancer](../../load-balancer/cross-region-overview.md).
165
132
166
-
The following command creates a global IPv4 address. This address can be associated with the frontend of a cross-region load balancer.
133
+
The following code snippet creates a global IPv4 address. This address can be associated with the frontend of a cross-region load balancer.
0 commit comments