Skip to content

Basic example of using Terraform for cloud.ca to create a POC environment.

Notifications You must be signed in to change notification settings

cloud-ca/cca-basic-example-terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloud.ca Terraform provider example

Basic environment creation using terraform on cloud.ca This terraform example will create:

  • an environment named "tf-demo" in the compute Quebec region,
  • a VPC service with 2 network tiers as network topology,
  • 2 VM instances of 2vcpu, 1GBram
  • Port forwarding rule for SSH access to one VM.

This example currently work with Terraform 0.12.x.

Install Terraform

How to use

  • generate ssh keys, with ssh-keygen -t rsa -b 4096 -N "" -f ./id_rsa for example
  • create a file terraform.tfvars containing at least the following variables:
    • api_key = your cloud.ca API key
    • organization_name = name used to connect to cloud.ca - <organization_name>.cloud.ca

terraform.tfvars example:

api_key = "<api key>"
organization_name = "demo"

deploy the environment

terraform init
terraform validate
terraform apply

Once the terraform job is completed, you can ssh the web instance thru ssh cca-user@<PUBLIC IP> -i id_rsa

remove the environment from cloud.ca

terraform destroy

Customization

Number of instances and their specs can be changed from the variables.tf and instances.tf files.

About

Basic example of using Terraform for cloud.ca to create a POC environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages