Can you show me how to use terraform variables for the urlcategories ? resource…
- User
Can you show me how to use terraform variables for the url_categories ?
resource "zia_url_filtering_rules" "terraform_managed_resource" { action = "BLOCK" block_override = false ciparule = false description = "Block all inappropriate content for all users." enforce_time_validity = false name = "Block Inappropriate Content" order = 2 protocols = ["ANY_RULE"] rank = 7 request_methods = ["OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", "OTHER"] state = "ENABLED" url_categories = ["OTHER_ADULT_MATERIAL", "ADULT_THEMES", "LINGERIE_BIKINI", "NUDITY", "PORNOGRAPHY", "SEXUALITY", "ADULT_SEX_EDUCATION", "K_12_SEX_EDUCATION", "OTHER_DRUGS", "GAMBLING", "OTHER_ILLEGAL_OR_QUESTIONABLE", "COPYRIGHT_INFRINGEMENT", "COMPUTER_HACKING", "QUESTIONABLE", "PROFANITY", "MATURE_HUMOR", "ANONYMIZER", "SOCIAL_ADULT"] labels { id = [87085] } }
- Assistant
Yes, I can help you with that.
In the
url_categoriesattribute of thezia_url_filtering_rulesresource, you can use Terraform variables to define the list of URL categories. Here's an example:variable "url_categories" { type = list(string) default = [ "OTHER_ADULT_MATERIAL", "ADULT_THEMES", "LINGERIE_BIKINI", "NUDITY", "PORNOGRAPHY", "SEXUALITY", "ADULT_SEX_EDUCATION", "K_12_SEX_EDUCATION", "OTHER_DRUGS", "GAMBLING", "OTHER_ILLEGAL_OR_QUESTIONABLE", "COPYRIGHT_INFRINGEMENT", "COMPUTER_HACKING", "QUESTIONABLE", "PROFANITY", "MATURE_HUMOR", "ANONYMIZER", "SOCIAL_ADULT" ] } resource "zia_url_filtering_rules" "terraform_managed_resource" { action = "BLOCK" block_override = false ciparule = false description = "Block all inappropriate content for all users." enforce_time_validity = false name = "Block Inappropriate Content" order = 2 protocols = ["ANY_RULE"] rank = 7 request_methods = ["OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", "OTHER"] state = "ENABLED" url_categories = var.url_categories }In this example, we define a Terraform variable called
url_categoriesas a list of strings. We use thevarkeyword in theurl_categoriesattribute of thezia_url_filtering_rulesresource to reference this variable.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.