page_title | subcategory | description |
---|---|---|
morpheus_rest_option_list Resource - terraform-provider-morpheus |
Provides a Morpheus rest option list resource. |
Provides a Morpheus rest option list resource.
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="
}
}
name
(String) The name of the option list
description
(String) The description of the option listignore_ssl_errors
(Boolean) Whether to ignore SSL errors with the REST API endpointinitial_dataset
(String) The initial dataset used to populate the option listlabels
(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 requestedrequest_script
(String) A js script to prepare the API requestsource_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 requestsource_url
(String) The HTTP URL used for the API requesttranslation_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
id
(String) The ID of the rest option list
Optional:
name
(String) The name of the source headervalue
(String) The value of the source header
Import is supported using the following syntax:
terraform import morpheus_rest_option_list.tf_example_rest_option_list 1