This Terraform project will deploy a Windows Server 2016 in Google Cloud Platform (GCP). Qlik Sense Enterprise February 2019 will then be downloaded, installed and enabled through a startup PS1 script.
- Valid Qlik Sense license
- Terraform
- Google Cloud SDK
- Billing enabled GCP account
The deployment requires a service account with correct associated roles. This can be setup manually in GCP Console or through Google Cloud SDK as show below.
- Login to GCP
gcloud auth login [email protected]
- Create project with a new unique project id
gcloud projects create --name='QSEfW Single Node'
- Take note of the project id. Use it instead of PROJECT_ID in all following commands.
- Set new project as active
gcloud config set project qsefw-single-node-238003
- Add service account qsefw-sa to project
gcloud iam service-accounts create qsefw-sa --display-name='QSEfW Service Account'
- Create GCP account file for the service account, and store in .secrets folder
gcloud iam service-accounts keys create ./.secrets/account.json --iam-account [email protected]
- Bind service account to required roles
- Compute Engine Admin
gcloud projects add-iam-policy-binding qsefw-single-node-238003 --member serviceAccount:[email protected] --role roles/compute.admin
- Compute Network Admin
gcloud projects add-iam-policy-binding qsefw-single-node-238003 --member serviceAccount:[email protected] --role roles/compute.networkAdmin
- Compute Engine Admin
- Enable required APIs. Following billing enablement link if required.
- Compute Engine API
gcloud services enable compute.googleapis.com
- Compute Engine API
Terraform prompts for undefined variables during validation and execution.
.tfvars files can be used to define variabel values, prior to Terrafrom validation and execution. variables.tpl.tfvars contains a template for required variables for this project.
.tfvars can be picked up automatically by Terraform, if file is renamed as .auto.tfvars.
mv variables.tpl.tfvars variables.auto.tfvars
If not automated, .tfvars file is applied by reference through command parameter.
terraform plan -var-file="variables.tfvars"
terraform apply -var-file="variables.tfvars"
- Login to GCP
gcloud auth login [email protected]
- Initiate Terraform
terraform init
- Validate config
terraform plan
- Deploy GCP infrastructure and install Qlik Sense for Windows
terraform apply
- Total deployment time is 20-30 minutes with a n1-highmem-2 instance. Configuration passwords are generated by Terraform, and presented after successful deployment.
- Connect to Windows server through central-node.rdp using the Windows administrator credentials.
Note, it can take several minutes before RDP has been enabled in the GCE instance.
- Completely remove current deployment
terraform destroy
This project is provided "AS IS", without any warranty, under the MIT License - see the LICENSE file for details