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
@@ -34,292 +34,44 @@ In this article, you learn how to:
34
34
35
35
## Prerequisites
36
36
37
-
-**Azure subscription**: If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
-[Install and configure Terraform](/azure/developer/terraform/quickstart-configure)
39
40
41
+
## Implement the Terraform code
42
+
40
43
> [!NOTE]
41
44
> The example code in this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/). See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/developer/terraform/)
42
45
43
-
## Implement the Terraform code
44
-
45
46
1. Create a directory in which to test and run the sample Terraform code and make it the current directory.
46
47
47
48
1. Create a file named `providers.tf` and insert the following code:
Run [terraform init](https://www.terraform.io/cli/commands/init) to initialize the Terraform deployment. This command downloads the Azure modules required to manage your Azure resources.
Run [terraform plan](https://www.terraform.io/cli/commands/plan) to create an execution plan.
301
-
302
-
```cmd
303
-
terraform plan -out main.tfplan
304
-
```
305
-
306
-
The `terraform plan` command creates an execution plan, but doesn't execute it. Instead, it determines what actions are necessary to create the configuration specified in your configuration files. This pattern allows you to verify whether the execution plan matches your expectations before making any changes to actual resources.
307
-
308
-
The optional `-out` parameter allows you to specify an output file for the plan. Using the `-out` parameter ensures that the plan you reviewed is exactly what is applied.
309
-
310
-
To read more about persisting execution plans and security, see the [security warning section](https://www.terraform.io/cli/commands/plan#security-warning).
Run [terraform apply](https://www.terraform.io/cli/commands/apply) to apply the execution plan to your cloud infrastructure.
315
-
316
-
```cmd
317
-
terraform apply main.tfplan
318
-
```
319
-
320
-
The `terraform apply` command above assumes you previously ran `terraform plan -out main.tfplan`.
321
-
322
-
If you specified a different filename for the `-out` parameter, use that same filename in the call to `terraform apply`. If you didn't use the `-out` parameter, call `terraform apply` without any parameters.
@@ -345,21 +97,7 @@ The names of the resource group and the DPS instance are displayed in the terraf
345
97
346
98
## Clean up resources
347
99
348
-
Other articles build upon the resources that you created in this quickstart. If you plan to continue on to subsequent quickstart or to the tutorials, keep the resources created in this quickstart.
349
-
350
-
If you want to delete the resources created in this quickstart, use the following commands:
351
-
352
-
1. Run [terraform plan](https://www.terraform.io/cli/commands/plan) and specify the `destroy` flag.
353
-
354
-
```cmd
355
-
terraform plan -destroy -out main.destroy.tfplan
356
-
```
357
-
358
-
2. Run [terraform apply](https://www.terraform.io/cli/commands/apply) to apply the execution plan.
0 commit comments