The following steps describe the procedures to Instantiate the Azure Standalone SBC or the HA SBC with HFE using IAC:
- Access and Share SBC Image in Azure.
- Create an Ubuntu 18.04 LTS instance in Azure.
- Run az login and sign in as a user with the role 'owner' for the subscription.
Create a Service Principal that contains 'owner' permissions for the subscription.
Example:
az ad sp create-for-rbac -n rbbn-iac --role="owner" --scopes="/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXa511"
- The Service Principle created as 'owner' has sufficient privileges to create and assign roles
- Store the relevant credentials and re-use to prevent continuous creation of Service Principals
- The output includes credentials that you must protect
Make a directory to extract the IAC tarball:
mkdir iac_package
Copy the IAC tarball to the created directory created above and change it to that directory:
cp iac_sustaining_*.tar.gz iac_package/ cd iac_package
Extract the IAC tarball using tar.
tar xvfz iac_sustaining_*.tar.gz
To set up the IAC environment, follow the instructions available in
./iac_package/README.md
- Follow the Azure instructions in ./iac_package/help/REAMDE.azure.md file to create either:
- Standalone SBC
- To setup Standalone, follow the instructions in ./iac_package/orchestration/azure/sbc_stand_alone/README.md
- HA SBC with HFE
- To setup SBC HA with HFE 2.1, follow the instructions in ./iac_package/orchestration/azure/sbc_hfe2.1/README.md
- Create a HFE Storage Account to store the HFE_AZ.sh script
- Standalone SBC
- For either Standalone or HA with HFE, update the "terraform.tfvars" to provide inputs for deployment. Update the following:
- resource_group_names
- resource_group_locations
- hfe_script_url
- remote_ssh_ip
- address_prefix_pkt0Src
- address_prefix_pkt1Src
- image_name
Export the following environment variables, stored from the Service Principal creation:
export ARM_SUBSCRIPTION_ID="<subscription_id>" export ARM_TENANT_ID="<tenant_id>" export ARM_CLIENT_ID="<client_id>" export ARM_CLIENT_SECRET="<client_secret>"
- Use the Terraform commands mentioned below:
Initialize Terraform:
terraform init
Run Terraform plan command, to preview the changes and ensure that "terraform.tfvars" are configured correctly before applying:
terraform plan
Apply the resource configuration:
terraform apply
Ensure to create resources according to deployment needs.
For Standalone SBC, make a note of the following field:
- SBC public IP: sbc_public_ip
For the HA SBC with HFE setup, make a note of the following fields:
- Active SBC public IP: active_sbc_public_ip
- Standby SBC public IP: standby_sbc_public_ip
To destroy all SBC resources from Microsoft Azure:
terraform destroy