# Using stack forms to simplify the configuration

In this step we will simplify the creation of our stack by adding Cycloid forms view. This feature allow users to create HTML forms on top of samples files. Those can be from pipeline variables, Terraform and Ansible.

Follow those steps to apply all changes described in this step

By adding a .forms.yml file into your stack, at the same level as the .cycloid.yml file, the forms view will be available for stacks users.

 
 
 


 










 
 


 








default:
  pipeline:
      Application-code:
      - name: "Application git public url"
        description: "The url of the public GIT repository containing the source code of the application"
        key: code_git_public_repository
        widget: simple_text
        type: string
        default: "https://github.com/cycloid-community-catalog/docs-step-by-step-stack"
      - name: "Application git repository branch"
        description: "The branch of the public GIT repository containing the source code of the application"
        key: code_git_branch
        widget: simple_text
        type: string
        default: code

  terraform:
    configuration:
      - name: "Azure instance type"
        description: "The type of instance you want to create"
        key: instance_type
        widget: slider_list
        type: string
        values:
        - Standard_DS1_v2
        - Standard_DS2_v2
        - Standard_DS3_v2
        default: Standard_DS1_v2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

A forms file use YAML syntax and have as top level section the use-case name of your stack. If you don't, just put default. Look for use-case in .cycloid.yml doc to know more about it

The second level is the name of the technologie. This is used by Cycloid to know how render your *.sample files with the variables defined into the .forms.yml. In our example we use 2 technologies. We defined one pipeline variable and one Terraform variable.

The third level define visual groups Application-code and configuration. The goal is to simplify the user understanding of the variables of a stack. You would probably create a group for Cloud provider configuration, one for the source code access and one for the actual configuration of the application. It will visually group the widget in Cycloid dashboard making more easy for a user to read.

The last part are widgets. A widget define the name of a variable (key) to replace in your *.sample files and what kind of widget display to the user. To know more about all kind of widget are available in Cycloid you should have a look to our Cycloid forms guide.

Add and commit those changes in Git:

git add .
git commit -m "Step 8"
git push origin stacks
1
2
3

You should be able to test forms right away for any new project or environment created with this stack.

To test it you could try to configure a new demo environment.

demo env

After clicking next, you should see the form view that have been configured:

forms

Get back: We will not create an extra environment right now. Let's click on snowy, our project name on the top menu to get back on our test environment for the next training step.

back