This step may have been previously completed
-
Create an SAP Automation root directory and descend into the newly created <automation_root>
mkdir <automation_root> && cd $_
-
Clone the Repository.
-
HTTPS
git clone https://github.com/Azure/sap-hana.git
-
SSH
git clone [email protected]:Azure/sap-hana.git
-
-
Create a Workspace Container under the <automation_root> and descend into the newly created Workspace Container.
mkdir -p <automation_root>/Terraform/workspace/SAP_Library && cd $_
-
Create a Workspace within the newly created Workspace Container and descend into the newly created Workspace.
- We recommend an easily identifiable naming convention that uniquely and globally identify the deployment.
For example:PROTO-SCUS-SAP_Library
- The first field represents the subscription.
- The second field represents the region.
- The third field represents the deployment unit.
mkdir PROTO-SCUS-SAP_LIBRARY && cd $_
- We recommend an easily identifiable naming convention that uniquely and globally identify the deployment.
-
Copy the parameter template
cp <automation_root>/sap-hana/deploy/terraform-units/workspace/SAP_Library/TFE/variables.auto.tfvars .
-
Edit the parameter file
Parameter | Description |
---|---|
deployZone | Subscription identifyer for environment partitioning |
region | Azure Region in which to deploy resources |
tags | A map of keys and values with which resources are to be tagged |
-
Initialize - Initialize the Terraform Workspace
-
Plan - Plan it. Terraform performs a deployment check.
-
Apply - Execute deployment.
- From the Workspace directory that you created.
-
Initializes the Workspace by linking in the path to the runtime code and downloading execution Providers.
terraform init <automation_root>/sap-hana/deploy/terraform-units/workspace/SAP_Library/TFE
-
To re-initialize, add the
--upgrade=true
switch.terraform init --upgrade=true <automation_root>/sap-hana/deploy/terraform-units/workspace/SAP_Library/TFE
- A plan tests the code to see what changes will be made.
- If a Statefile exists, it will compare the code, the statefile, and the resources in Azure in order to detect drift and will display any changes or corrections that will result, and the actions that will be performed.
terraform plan <automation_root>/sap-hana/deploy/terraform-units/workspace/SAP_Library/TFE
-
Apply executes the work identified by the Plan.
-
A Plan is also an implicit step in the Apply that will ask for confirmation.
terraform apply <automation_root>/sap-hana/deploy/terraform-units/workspace/SAP_Library/TFE
-
To automatically confirm, add the
--auto-approve
switch.terraform apply --auto-approve <automation_root>/sap-hana/deploy/terraform-units/workspace/SAP_Library/TFE
-
If you don't need the deployment anymore, you can remove it just as easily.
From the Workspace directory, run the following command to remove all deployed resources:terraform destroy <automation_root>/sap-hana/deploy/terraform-units/workspace/SAP_Library/TFE
-
To automatically confirm, add the
--auto-approve
switch.xsterraform destroy --auto-approve <automation_root>/sap-hana/deploy/terraform-units/workspace/SAP_Library/TFE