Start the Terraform Runtime Service

This topic guides you through the steps required to start the Terraform Runtime Service.

To start the Terraform runtime service, complete the following setup steps:
  1. Change the directory to ibm-ucd-patterns-install/docker-install/terraform-service.
  2. Review the docker-compose.yaml file. You may want to specify different paths to the various volumes that are mounted in the containers.
    For example:
    
        ...
        volumes:
          - /volumes/mongo:/data/db
        ...
        volumes:
          - /volumes/terraform:/stacks
          - /volumes/logs:/var/camlog
        ...
    where:
    • cam-mongo (/data/db): volume used for persistent Mongo DB storage of Terraform stack information

    • cam-provider-terraform (/stacks): runtime location for terraform execution
    • cam-provider-terraform (/var/camlog): log output from terraform execution
    Note: The compose files are provided only as an example. You may manually need to change the files to fit your need.
  3. Run the following commands to set the permissions on the base directories. The paths used in the commands are an example.
    mkdir -p /volumes/mongo
    mkdir -p /volumes/terraform
    mkdir -p /volumes/logs
    chmod -R 2775 /volumes/mongo /volumes/terraform /volumes/logs
    chown -R 1000:1000 /volumes/mongo
    chown -R 1111:1111 /volumes/terraform /volumes/logs
  4. Run the following command to start the Terraform Runtime Service:
    docker-compose up -d
  5. Run the following command to verify if the Terraform Runtime Service containers are running:
    docker ps
  6. Run the following command to verify if the Terraform Runtime Service is running:
    curl http://<vm_ip>:7000
    The output should resemble:
    {"started":"2018-09-07T19:30:59.755Z","uptime":165.544}