This section explains how to install the CSC GRE AWS for Zscaler using Terraform.
Please, follow this steps:
- Unzip the shared folder (unzip csc-aws-zscaler-terraform.zip, attached at the botton of this article).
- Ensure Terraform is installed on the system; if not installed, please download the binary and set the path as mentioned in the official documents. (Reference URL - https://www.terraform.io/downloads).
- Ensure that "aws cli" is installed on the system. (See https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
- Open the unzipped directory (csc-aws-zscaler-terraform) and update the following files:
1 - Update file "provider.tf" file with your AWS access and secret keys. (Generate these keys for the IAM user from AWS console and ensure required permissions are granted to the keys).
Note: If you already have the keys provisioned via "aws configure" command, comment the lines:
2 - Update the file "terraform.auto.tfvars" with the required network and instance values, including VPC ID, Subnet IDs, Stack name, region, instance name, instance type and keyname of SSH Key. (Please ensure the stack name is unique since it will be used for creating security groups and other components. We recommend to put the same name to "stack name" and "instance name")
3 - (optional) Update configUserData.json with the JSON used as userdata within the provisioned Instance. Terraform will automatically pick the JSON and convert it to base64.
- Once required changes are made, trigger the following commands to provision the Virtual machine. Please ensure all the below-mentioned commands are triggered from the base module directory. (In our case csc-aws-zscaler-terraform):
1. Trigger "terraform init" command to initialize the AWS provider. Each time we add a new module, we will need to rerun this command.
2. Trigger "terraform plan" command to check what all will get provisioned. This command will not provision the resources but will just show what will get provisioned.
3. Trigger "terraform apply" command to create the resources. This will prompt you for approval, type "yes" once prompted.
Use the following reference links to know more about terraform commands - https://www.terraform.io/cli/commands