Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 2.65 KB

rest_option_list.md

File metadata and controls

85 lines (67 loc) · 2.65 KB
page_title subcategory description
morpheus_rest_option_list Resource - terraform-provider-morpheus
Provides a Morpheus rest option list resource.

morpheus_rest_option_list

Provides a Morpheus rest option list resource.

Example Usage

resource "morpheus_rest_option_list" "tf_example_rest_option_list" {
  name               = "tf_example_rest_option_list"
  description        = "Terraform REST option list example"
  visibility         = "private"
  source_url         = "https://api.github.com/repos/hashicorp/consul/releases"
  real_time          = true
  ignore_ssl_errors  = true
  source_method      = "GET"
  initial_dataset    = <<POLICY
  [{"name": "Level 1","value":"level1"},
  {"name": "Level 2","value":"level2"},
  {"name": "Level 3","value":"level3"}
  ]
  POLICY
  translation_script = <<POLICY
      for(var x=0;x < 5; x++) {
          results.push({name: data[x].name,value:data[x].name});
        }
  POLICY
  source_headers {
    name  = "Accept"
    value = "application/json"
  }

  source_headers {
    name  = "Authorization"
    value = "Basic YWRtaW46YWRtaW4="
  }
}

Schema

Required

  • name (String) The name of the option list

Optional

  • description (String) The description of the option list
  • ignore_ssl_errors (Boolean) Whether to ignore SSL errors with the REST API endpoint
  • initial_dataset (String) The initial dataset used to populate the option list
  • labels (Set of String) The organization labels associated with the option list (Only supported on Morpheus 5.5.3 or higher)
  • real_time (Boolean) Whether the list is refreshed every time an associated option type is requested
  • request_script (String) A js script to prepare the API request
  • source_headers (Block List) An array of source headers to use when requesting data (see below for nested schema)
  • source_method (String) The HTTP method used for the API request
  • source_url (String) The HTTP URL used for the API request
  • translation_script (String) A js script to translate the result data object into an Array containing objects with properties 'name’ and 'value’.
  • visibility (String) Whether the option list is visible in sub-tenants or not

Read-Only

  • id (String) The ID of the rest option list

Nested Schema for source_headers

Optional:

  • name (String) The name of the source header
  • value (String) The value of the source header

Import

Import is supported using the following syntax:

terraform import morpheus_rest_option_list.tf_example_rest_option_list 1