Skip to content

Commit

Permalink
Merge pull request #7 from gsoft-inc/azure-search
Browse files Browse the repository at this point in the history
add search services
  • Loading branch information
yohanb authored Apr 4, 2022
2 parents 1086d4b + 5a4c133 commit 54ca638
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 1 deletion.
12 changes: 12 additions & 0 deletions modules/search/search_service/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module "search_service" {
source = "../../../."
name = var.name
prefixes = var.prefixes
suffixes = var.suffixes
separator = var.separator != null ? var.separator : "-"
max_length = 64
}

locals {
result = regex("^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$", module.search_service.result)
}
4 changes: 4 additions & 0 deletions modules/search/search_service/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "result" {
description = "The generated Search Service name."
value = local.result
}
21 changes: 21 additions & 0 deletions modules/search/search_service/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
variable "name" {
description = "Search Service name."
type = string
}

variable "separator" {
description = "Separator string use to delimit resource name segments."
type = string
default = null
}

variable "prefixes" {
description = "List of prefixes to append in front of the resource name."
type = list(string)
}

variable "suffixes" {
description = "List of suffixes to append at the end of the resource name."
type = list(string)
default = null
}
3 changes: 3 additions & 0 deletions modules/search/search_service/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = ">= 0.13"
}
11 changes: 10 additions & 1 deletion templating/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,15 @@
"max_length": 130,
"separator": "-",
"regex": "^[a-zA-Z0-9]{1}[a-zA-Z0-9-][^-]*$"
}
},
{
"source": "../../../.",
"name": "search_service",
"long_name": "Search Service",
"category": "search",
"max_length": 64,
"separator": "-",
"regex": "^[a-zA-Z0-9]{1}[a-zA-Z0-9-_.]*$"
}
]
}
1 change: 1 addition & 0 deletions templating/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 54ca638

Please sign in to comment.