2. Terraform Cloud/EP driver

2.1. Introduction

This document aims to explains the Terraform Cloud/EP driver function and how to use it.
For more information regarding the Terraform CLI driver common functions and Terraform & Terraform driver overviews, see Terraform driver Common.

2.2. Console menu structure

This section explains the Terraform Cloud/EP driver menu ustructure.

2.3. Terraform Cloud/EP driver procedure

This section explains how to use the different Terraform Cloud/EP menus

2.3.1. Terraform Cloud/EP workflow

A standard workflow using the different Terraform Cloud/EP menus can be seen below.
See the following sections for more detailed information regarding each of the steps.
Workflow
  • Workflow details and references

    1. Register Input operation name
      From the basic console's Operation list menu, register an input operation name.
      For more information, see Operation list.
    2. Register Interface information
      Configure information for the execution.
      For more information, see Interface information.
    3. Register and link Organization
      Register inforamtion for the Terraform Organization and link with Terraform.
      For information, see Organization management
    4. Register and link Workspace
      Register information for the Terraform workspace.
      For more information, see Workspace management.
    5. Register Movement
      Register a movement.
      For more information, see Movement list.
    6. Register Module files
      Register a Module file that will be executed..
      For more information, see Module file collection.
    7. **Register Policy (if required) **
      Register a Policy file that will execute Policy check before executing the operation.
      For more information, see Policy management.
    8. **Register Policy set (if required) **
      Register a Policy set for linking with the Workspace that applies the Policy.
      For more information, see Policy Set management.
    9. **Link Policy set with Policy (if required) **
      Register a link between the Policy set and the Policy.
      For more information, see Policy set-Policy link.
    10. **Link Policy set with Workspace (if required) **
      Register a link between the Policy set and the Workspace.
      For more information, see PolicySet-Workspace list.
    11. Specify Module file to Movement
      Configure the registered module file to the registered Movement.
      For more information, see Movement-Module link.
    12. Configure maximum cycles (if required)
      Configure maximum amount of cycles for the Member variable.
      For more information, see Variable nest management.
    13. Create Parameter sheet (if required)
      From the Parameter sheet creation's "Define/Create parameter sheets" menu, create a parameter sheet where the user can register data that will be used to configure the target server.
      For more information, see Parameter sheet creation function.
    14. Register data to the Parameter sheet (if required)
      In the Input menu group, access the Parameter sheet created in the previous step.From there, register data that will be used to configure the target server.
      For more information, see Parameter sheet creation function.
    15. Configure substitute value auto registration settings (if required)
      From the Substitute value auto registration settings menu, link the all the operation items and setting values registered to the Parameter sheet and the Movement variables.
    16. Execute operation
      From the Execution menu, select the previously created Movement and Input operation and execute them.
      For more information, see Execute.
    17. Confirm operation status
      In the Execution status confirmation menu, the status of all previously executed operations will be updated in realtime. Users can also monitor error logs and execution logs as well as stop them with an emergency stop.
      For more information, see Check operation status.
    18. Confirm operation history
      In the Execution management page, users can check the history of all previously executed operations.
      For more information, see Execution management.

2.4. Apply Policy

2.4.1. Linking Policy/PolicySet/Workspace

**In order to use the Policy function, the Link Terraform must be either Terraform Enterprise or Terraform Cloud and the "Policy & Security" function must be active.

In order to apply Policies, they must be linked after the Policy settings are registered.
First, link the Policy registered in Policy management and the Policy set registered in Policy Set management in the
Next, link the Terraform Workspace Workspace management and the Policy set registered in Policy Set management in the
When the operation is executed, The Policy and the Policy set it is linked to will be applied to the Workspace linked to the selected Movement.
Applying Policy

2.5. Function

This section explains the different functions of the menus used by the Terraform Cloud/EP driver.

2.5.1. Basic console

This section explains how to operate the Basic console menus.
For this workflow, refer to Basic console while operating the Basic console menus.

Operation list

In the Basic console▶Operation list menu, users can manage the operations executed by the different orchestrators.
For more information regarding registering Operations, see Basic console.
Submenu (Operation list)

図 2.34 Submenu (Operation list)

2.5.2. Terraform Cloud/EP menu

This section explains how to operate the Terraform Cloud/EP driver menus.

Interface information

  1. In the Terraform Cloud/EP ▶Interface information menu, users can maintain (view/edit) execution information.
    Users must have a UserToken issued from the Terraform and a Terraform Hostname.
    Submenu (Interface information)

    図 2.35 Submenu (Interface information)

  2. Press the Edit button to register Interface information.
    images/ja/terraform_cloud_ep_driver/operation_method_explanation/interface_information_register.gif:width:800px:alt:Registrationpage(Interfaceinformation)

    図 2.36 Registration page (Interface information)

  3. The items in the Interface information menu are as following.
    If there is no Interface information registered, the operation execution will meet an unexpected error when multiple records are registered.

Organization management

  1. In the Terraform Cloud/EP▶Organization management menu, users can maintain (view/register/update/delete discarded) Organizations used in Terraform.
    Users can link (register/edit/delete) Organizations registered to ITA to Terraform.
    Submenu (Organization management)

    図 2.37 Submenu (Organization management)

  2. Press the + Register button to register Organization informationn.
    Registration page (Organization management)

    図 2.38 Registration page (Organization management)

  3. After an Organization is registered, users can click the "Check status" button to check the Link status with the Terraform linked in Interface information.
    By clicking the "Register", "Edit" or the "Delete" button in the "Terraform link" column group, users register, edit and delete Organizations for the linked Terraform
    If an operation is executed while no Organization is linked to Terraform, the execution will end in an unexpected error.
    If hostname and User Token registered in "6.2.1 Interface Information" are incorrect, the link with Terraform will fail, and the following message will be displayed in the link status:
    "Failed to connect to Terraform. Check the interface information”.
    Terraform link (Organization management)

    図 2.39 Terraform link (Organization management)

  4. The items found in the Organization management menu are as following.

Workspace management

  1. In the Terraform Cloud/EP▶Workspace management menu, users can maintain (view/register/update/delete discarded) Workspaces used by Terraform.
    It is also possible to link (register/edit/delete) Workspaces registered to ITA to Terraform as well as delete resources(terraform destroy).
    Submenu (Workspace management)

    図 2.40 Submenu (Workspace management)

  2. Press the + Register button to register Workspace information.
    Submenu (Workspace management)

    図 2.41 Submenu (Workspace management)

  3. After an Workspace is registered, users can click the "Check status" button to check the Link status with the Terraform linked in Interface information.
    By clicking the "Register", "Edit" or the "Delete" button in the "Terraform link" column group, users register, edit and delete Workspaces for the linked Terraform
    If an operation is executed while no Workspace is linked to Terraform, the execution will end in an unexpected error.
    If hostname and User Token registered in "6.2.1 Interface Information" are incorrect, the link with Terraform will fail, and the following message will be displayed in the link status:
    "Failed to connect to Terraform. Check the interface information”.』
    The same message will be displayed if the selected Organizatio nis not linked to Terraform.
    Terraform link (Workspace Management)

    図 2.42 Terraform link (Workspace Management)

  4. Click the "Delete resource" button moves the user to "Check operation status" where the target workspace will have their resources deleted (terraform destroy).
  5. The items found in the Workspace management menu are as following.

Movement list

  1. In the Terraform Cloud/EP▶Movement list menu, users can maintain (view/register/edit/discard) Movement names.
    As Movements needs to be linked to the Workspace and Organization as Terraform use information, The user will first have to register a target in Workspace management and Organization management.
    Submenu (Movement list)

    図 2.43 Submenu (Movement list)

  2. Check the + Register button to register Movement information.
    Registration page (Movement list)

    図 2.44 Registration page (Movement list)

  3. The items found in the Movement list are as following.

Module file collection

  1. In the Terraform Cloud/EP▶Module file collection menu, users can maintain (view/register/edit/discard) user created modules.
    For more inforamtion regarding writing Modules, see Describing Module.
    Submenu (Module file collection)

    図 2.45 Submenu (Module file collection)

  2. Press the + Register button to register Movement information.
    images/ja/terraform_cloud_ep_driver/operation_method_explanation/module_list_register.gif:width:800px:alt:Registrationpage(Modulefilecollection)

    図 2.46 Registration page (Module file collection)

  3. The items found in the Module file collection menu are as following.

警告

When variables defined within the Module files (.tf format files) are extracted.
The variables defined within the Module files (.tf format files) are extracted by internal processes.
The variables can have specific values registered to them in "Substitute value auto registration settings".
The variables are not extracted in realtime, meaning that it may take time before they can be used in "Substitute value auto registration settings".。

Policy management

  1. In the Terraform Cloud/EP▶Policy management menu, users can maintain (view/register/update/delete discarded) user created Policies.
    For more information writing Modules, see Describing Policy.
    Submenu (Policy management)

    図 2.47 Submenu (Policy management)

  2. Press the + Register button to register a Policy.
    Registration page (Policy management)

    図 2.48 Registration page (Policy management)

  3. The items found in the Policy management menu are as following.
    表 2.56 Registration page Item list (Policy management)

    Item

    Description

    Input required

    Input method

    Restrictions

    Policy name

    Input a name for the Policy
    Policies can contain half-width alphanumeric charactesr and the following symbols: _ - (Underbar and hyphen).

    Manual

    Maximum length 255 bytes

    Policy file

    Upload a created Policy file.

    File selection

    Maximum size 100 mb

    Remarks

    Free description field

    Manual

    Maximum length 4000 bytes

Policy Set management

  1. In the Terraform Cloud/EP▶Policy set management menu, users can maintain (view/register/update/delete discarded) Policy sets.
    Policy Sets applies Policies to the Workspace when executed by linking with Policies and Workspaces in "Policy set-Policy link" and "PolicySet-Workspace list".
    Submenu (Policy set management)

    図 2.49 Submenu (Policy set management)

  2. Press the + Register button to register a Policy set.
    Registration page (Policy set management)

    図 2.50 Registration page (Policy set management)

  3. The items found in the Policy set management menu are as following.
    表 2.57 Registration page Item list (Policy set management)

    Item

    Description

    Input required

    Input method

    Restrictions

    Policy set name

    Input a name for the Policy set.
    Policy sets can contain half-width alphanumeric charactesr and the following symbols: _ - (Underbar and hyphen).

    Manual

    Maximum 255 bytes

    Remarks

    Free description field

    Manual

    Maximum length 4000 bytes

PolicySet-Workspace list

  1. In the Terraform Cloud/EP▶Policy set-Workspace list menu, users can maintain (view/register/update/delete discarded) links between Policy sets registered in "Policy Set management" and Workspaces registered in "Workspace management".
    Submenu (Policy set-Workspace list)

    図 2.53 Submenu (Policy set-Workspace list)

  2. Press the + Register button to register a Policy set-Policy link.
    Registration page (Policy set-Workspace list)

    図 2.54 Registration page (Policy set-Workspace list)

  3. The items found in the Policy set-Workspace list menu are as following.
    表 2.59 Registration page Item list (Policy set-Workspace list)

    Item

    Description

    Input required

    Input method

    Restrictions

    Policy set name

    Select a Policy set name registered in Policy Set management.

    List selection

    Workspace name

    Select a Workspace name (Linked to an Organization) registered in Workspace management.

    List selection

    Remarks

    Free description field

    Manual

    Maximum length 4000 bytes

Variable nest management

  1. In the Terraform Cloud/EP▶Variable nest management menu, if the variable type defined in the tf file is "list" or "set" and the "list", "set," "tuple" or "object" is defined, the user can view and edit the Member variable's maximum number of cycles.
    The items in this menu cannot be registered, discarded or restored as BackYard manages the records based on the Module file collection.
    For more information with examples of Variable nest management, see "Variable nest management flow example".
    Submenu (Variable nest management)

    図 2.57 Submenu (Variable nest management)

  2. Press the + Edit button to edit the maximum cycle number.
    images/ja/terraform_cloud_ep_driver/operation_method_explanation/nested_variable_list_register.gif:width:800px:alt:Registrationpage(Variablenestmanagement)

    図 2.58 Registration page (Variable nest management)

  3. The items found in the Variable nest management menu are as following.

警告

※Initial registrations and repetition updates are not happening in real-time, so it might take a couple of minutes before the variables can be used in "Substitute value auto registration settings".

Substitute value auto registration settings

  1. In the Terraform Cloud/EP▶Substitute value auto registration settings menu, users can link parameter sheets (with operation) created with the Menu creation tool and Movement variables.
    The registered information is displayed in Susbtitute value management
    Submenu (Substitute value auto registration settings)

    図 2.59 Submenu (Substitute value auto registration settings)

  2. Press the + Register button to register Substitute value auto registration settings.
    images/ja/terraform_cloud_ep_driver/operation_method_explanation/substitution_value_auto_registration_register.gif:width:800px:alt:Registrationpage(Substitutevalueautoregistrationsettings)

    図 2.60 Registration page (Substitute value auto registration settings)

  3. The items found in the Registration page are as following.
※1:Only required if the Parammeter sheet has Bundles active.
※2:Required if the selected "Movement name:Variable name" has a member variable and if the HCL settings are set to "False".
※3:Only required if the selected "Movement name:Variable name" and "Movement name:Variable name:Member variable" is a format that requires a substitute order.

注釈

For Parameter sheets with bundles
In order to link Movement variables with Parameter sheets with bundles, the user must input a substitute order for the Parameter sheet (From) in Terraform Cloud/EP▶Substitute value auto registration settings
See the following figure for more information regarding the relationship between bundled parameter sheets and Substitute value auto registration settings.
Register Substitute value auto registration settings when using Bundled parameter sheets.

図 2.61 Register Substitute value auto registration settings when using Bundled parameter sheets.

注釈

Configuring IaC variable(To) member variables
Must be configured if the variable type is object or tuple.
When configuring member variables, all the member variables of the same variable must also be configured.
If there are member variables without configured substitute values, they will not be used, even with default values.
For more information, see "※1 …Member variable targets" in "Types of variables".

注釈

IaC variable(To) substitute order
Must be configured if the variable type is either list or set.
For more information, see "※2 …Susbtitute order targets" in "Types of variables".

Execute

In the Terraform Cloud/EP▶Execute menu, users can execute operations.
Select a Movement and Operation from the Movement list and Operation list and press the Execute button to move to the Check operation status where the execution will be processed.
Submenu (Execute)

図 2.62 Submenu (Execute)

  1. Specify reservation date
    By inputting a "Reservation date", the user can book executions and plan checks.
    Only future dates can be specified.
  2. Specify Movement
    Select a Movement registered in "Movement list".
  3. Specify Operation
    Select an Operation registered in "Operation list".
  4. Execute
    Press the Execute button to move to the "5.2.10 Execution status confirmation" menu where the execution processed will start.
    Terraform Apply will automatically be executed after Terraform Plan ends.
  5. Confirm Plan
    Click the "Check Plan" button operates similarly as the "Execute" button as it start the execution process. However, it will only execute, and not Terraform Apply.
  6. Confirm parameters
    Click the "Check parameters" button allows users to check the input parameter values. Neither Terraform Plan nor Terraform Apply will be executed.

Tip

Output block
If a module with an output block is Executed with Conductor, the contents of the output block will be saved to the deta relay storage path(shared movement directory) as a json file.
This file allows users to use a value output by Terraform from a different Movement (in the same conductor).
File path
[Conductor Operation directory path]/[Conductor Instance ID]/terraform_output_[Execution No.].json
Conductor Operation directory path・・・Ansible ITA original variable data link's Conductor Operation directory path
Conductor Instance ID・・・ "Conductor history" のconductor Instance ID
Execution No.・・・ "Execution management" Execution No.
Description example

variable "VAR_sample" {

 type = string

 default = "sample_string"

}

output "output_sample" {

 value = "${var.VAR_sample}"

}

Output example

{

 "output_sample": {

  "sensitive": false,

  "type": "string",

  "value": "sample_string"

 }

}

Check operation status

In the Terraform Cloud/EP▶Check operation status menu, users can monitor execution statuses.
Submenu (Check operation status)

図 2.63 Submenu (Check operation status)

  1. Execution status display
    The status matching the Execution status is displayed.
    The execution log and error log also displays detailed information regarding the execution status.
    If the "Execution type" is set to "Check Plan", "Check Plan" will be displayed. If it is set to delete workspace resources (Executed from "Workspace management".), it will display "Delete resource". For everything else, "Standard".
    If the status ends in an unexpected error, and error log will be displayed in the message if there is something wrong with the registration in the "Interface information" or other web contents.
    For other errors, no message will be displayed in the error log. For those cases, the error information will be displayed in the application log.
    "Call Conductor" displays which Conductor was executed. This field will be blank if directly executed from Terraform Cloud/EP driver.
    "Execution user" displays the user that was logged in when the "Execute" button was pressed.
    The "RUN-ID" displayed in the "Terraform use information" is an ID used to manage executions from the Terraform side. It is used for the internal Terraform link process.
    ※ If "Execution type" is set to "Delete resources", the following items will not be configured.
    • Called Conductor

    • Movement

    • Operation

    • Input data

  2. Check substitute value
    Press the Check Susbtitute button to display "Susbtitute value management" where the Substitute values narrowed down to the target Operation and Movements are displayed.
  3. Emergency stop/Delete reservation
    Users can press the Emergency stop button to stop the operation.
    If the status was "Reserved execution", the Delete reservation button will be displayed. Check the Delete reservation button to delete the reservation
  4. Display execution log
    The log file names displayed in the execution log's pulldown menu are as following.
    plan.log: Terraform Plan execution log
    policyCheck.log: Terraform Policy Check execution log
    apply.log: Terraform Apply execution log
  5. Search log
    Users can filter information to narrow down information in the execution log and the error log.
    Input the string the user wants to search for and tick the "Corresponding lines only" checkbox to view only the lines corresponding to the string.
    The refresh interval and maximum display lines can be configured by changing the "Status monitoring cycle item" and "Progress status display lines" items in the "Interface information" menu.
  6. Input data
    Users can download executed module files and a zip file containing a list of policy materials and the configured substitute values in Json format.
    The files are as following:
    表 2.60 Input data storing file

    Folder name

    File name

    Description

    (Input Module file name)
    Stores all input Module files within a zip file.

    (Input Policy file name)
    Stores all Module files within a zip file.

    variables

    variables.json
    File that contains the configured substitute value's "Variable name(key)", "Specific value (value)", "HCL settings" and "Sensitive settings" settings value in JSON format.
    The specific values will be NULL if the Sensitive settings are set to ON (true).
  7. Result data
    User can download execution logs, error logs, and state files generated by Terraform.
    The files are as following:
    表 2.61 Result data storing file

    Folder name

    File name

    Description

    plan.log
    Log file that contains the contents output to the progress log(plan.log).

    policyCheck.log
    Log file that contains the contents output to the execution log(policyCheck.log).

    apply.log
    Log file that contains the contents output to the progress log(apply.log).

    error.log
    Log file that contains the contents output to the progress (apply.log).

    sv-XXXXXX.tfstate
    State file generated by Terraform. The file name is also generated by Terraform, meaning that the name is different for every execution.
    The file is saved in an encoded state.

Execution management

  1. In the Terraform Cloud/EP▶Execution management menu, the user can view execution histories.
    Specify search conditions and press the Filter button to view a table of executions.
    Pressing the Details button moves the user to Check operation status where they can view detailed information regarding the execution status.
    Submenu (Execution management)

    図 2.64 Submenu (Execution management)

  2. The items found in the Execution management menu are as following.
    表 2.62 Item list (Execution management)

    Item

    Description

    Execution No.

    Displays an automatically given unique ID (36 characters)

    Details

    Press this button to move to the "Check operation status" menu where users can see more detailed information.

    Execution type

    Displays what type of execution was executed.

    The following types exists: "Normal" "Plan check" "Parameter sheet check"

    Status

    Displays the status of the execution. The following exists:

    "Not executed" "Not executed(Reserved)" "Preparing" "Executing" "Exe

    cuting(Delayed)" "Complete" "Complete(Error)" "Unexpected error" "Emergency stop" "Reservation deleted".

    Execution user

    Displays the name that executed the operation.

    Registration time

    Displays the time when the operation was registered.

    Movement

    ID

    Displays the ID of the Movement.

    Name

    Displays the name of the Movement.

    Delay timer

    Displays the delay timer value configured to the Movement.

    Terraform use information

    WorkspaceID

    Displays the Terraform Workspace ID configured to the Movement.

    Workspace Name

    Displays the name of the Terraform Workspace configured to the Movement.

    Operation

    No.

    Dispalys the Operation No.

    Name

    Displays the name of the Operation.

    Input data

    Allows users to download the input data in a Zip file.

    Result data

    Allows users to download the result data in a Zip file.

    Execution status

    Reservation date

    Displays the reservation date if the execution is reserved.

    Start date

    Displays when the execution will start.

    End date

    Displays when the execution will end.

    Remarks

    Free description field

Susbtitute value management

  1. In the Terraform Cloud/EP▶Susbtitute value management menu, userse can view the specific value that substitues the variables in the Module files used by the Movement linked to the Operaration.
    Submenu (Susbtitute value management)

    図 2.65 Submenu (Susbtitute value management)

  2. The items found in the Susbtitute value management menu are as following.
    表 2.63 Item list (Susbtitute value management)

    Item

    Description

    Execution No.

    Displays an automatically given unique ID (36 characters).

    Operation

    Displays the selected Operation.

    Movement name

    Displays the selected Movement.

    Movement name:Variable name

    Displays the variable name attached to the Movement selected in ":ref:

    terraform_cloud_ep_substitution_value_auto_registration_setting".

    HCL settings

    Displays whether the HCL settings configured in "Substitute value auto registration settings" are set to False or True. Variables with hierarchies containing member variables and substitute order are set to "True".

    Movement name:Member name:Member variable

    Displays the Member variable attached to the Movement selected in ":ref

    :terraform_cloud_ep_substitution_value_auto_registration_setting".

    Susbtitute order

    Displays the substitute order of the Member variable or Variable name at

    tached to the Movement selected in "Substitute value auto registration settings".

    Specific value

    Sensitive settings

    Displays either "True" or "False".

    If "True", the data will not be stored in the input data fetched from

    "Check operation status".

    Value

    Displays the Specific value of the variable used by the Operation/Movement.

    Remarks

    Free description field