The following steps describe the procedures to Instantiate the Azure Standalone SBC or the HA SBC with HFE using IAC. The Azure CLI version used for this document is 2.24.
If you haven't created one already, 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"
Copy the IAC tarball to the Azure instance.
scp -i <pem_file> <iac_tarball> <username>@<ip_azure_instance>:/home/<username>
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
image_name
image_name = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxa31/resourceGroups/mage_RBBN-SBC-RG/providers/Microsoft.Compute/images/rbbn-sbc-v10.01.11.img
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="<appId>" export ARM_CLIENT_SECRET="<password>"
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:
For the HA SBC with HFE setup, make a note of the following fields:
To destroy all SBC resources from Microsoft Azure:
terraform destroy