This section explains how to install CSC AWS PriCPA using Terraform.


Before installation, please:


Installation Steps:

Inside the Terraform template folder, open and update the three following files: configUserData.json provider.tf terraform.auto.tfvars

Edit Files: configUserData.json, provider.tf, terraform.auto.vars


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).
Edit variables inside provider.tf:  access_key and secret_key


Note: If you already have the keys provisioned via "aws configure" command or via environment variables, modify these keys' lines in the file so Terraform ignores them:

Remove access_key and secret_key from provider.tf

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 as it will be used for the creation of security groups and other components. We recommend using the same name on "stack name" and "instance name").

Edit terraform.auto.tfvars


3 - (Optional) Update configUserData.json with the userdata in JSON format for the instance to be provisioned. Terraform will automatically read the JSON and convert it to base64.


4 - (Deployment) Once all required changes are made, trigger the following commands to provision the Terraform template’s Virtual machine. Please ensure all the below-mentioned commands are triggered from the base module directory (the same directory as “configUserData.json” and “terraform.auto.tfvars”):


4.1 - Trigger "terraform init" command to initialize the AWS provider. Each time a new module is added, it’s necessary to rerun this command.

4.2 - Trigger "terraform plan" command to check what will get provisioned. This command will not provision the resources but will just show what will get provisioned.

4.3 - Trigger "terraform apply" command to create the resources. This will prompt you for approval, type "yes" once prompted.


Use the following reference link to know more about terraform commands – https://www.terraform.io/cli/commands