Skip to content

Commit

Permalink
Use json file as input
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirrezaNasiri committed Dec 30, 2023
1 parent 600f0a7 commit c15073f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 36 deletions.
38 changes: 38 additions & 0 deletions example/input_processed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"zones": [
"pashmak.guru"
],
"origin_groups": [
"argocd-admin-pashmak-guru"
],
"public_ip_origins": {
"argocd-admin-pashmak-guru-kubernetes-cluster": {
"origin_group_name": "argocd-admin-pashmak-guru",
"pip_resource_group_name": "module-azure-administrative-kubernetes-cluster-nodes",
"pip_name_prefix": "kubernetes-",
"origin_host_header": "argocd-admin.pashmak.guru"
}
},
"endpoints": [
"argocd-admin-pashmak-guru"
],
"rule_sets": [
"argocdadminpashmakguru"
],
"routes": {
"argocd-admin-pashmak-guru": {
"endpoint_name": "argocd-admin-pashmak-guru",
"origin_group_name": "argocd-admin-pashmak-guru",
"origin_names": [
"argocd-admin-pashmak-guru-kubernetes-cluster"
],
"rule_set_names": [
"argocdadminpashmakguru"
],
"patterns_to_match": [
"/*"
],
"use_azure_domain": true
}
}
}
46 changes: 10 additions & 36 deletions example/instance.tf
Original file line number Diff line number Diff line change
@@ -1,45 +1,19 @@
locals {
data = jsondecode(file("${path.module}/input_processed.json"))
}

module "front_hub" {
source = "./../"

resource_group_name = "front-hub-solution_example-testing"
resource_group_location = "West US"

zones = [
"pashmak.guru"
]
origin_groups = [
"argocd-admin-pashmak-guru"
]
public_ip_origins = {
"argocd-admin-pashmak-guru-kubernetes-cluster" = {
origin_group_name = "argocd-admin-pashmak-guru"
pip_resource_group_name = "module-azure-administrative-kubernetes-cluster-nodes"
pip_name_prefix = "kubernetes-"
origin_host_header = "argocd-admin.pashmak.guru"
}
}
endpoints = [
"argocd-admin-pashmak-guru"
]
rule_sets = [
"argocdadminpashmakguru"
]
routes = {
"argocd-admin-pashmak-guru" = {
endpoint_name = "argocd-admin-pashmak-guru",
origin_group_name = "argocd-admin-pashmak-guru",
origin_names = [
"argocd-admin-pashmak-guru-kubernetes-cluster"
],
rule_set_names = [
"argocdadminpashmakguru"
],
patterns_to_match = [
"/*"
],
use_azure_domain = true
}
}
zones = local.data.zones
origin_groups = local.data.origin_groups
public_ip_origins = local.data.public_ip_origins
endpoints = local.data.endpoints
rule_sets = local.data.rule_sets
routes = local.data.routes
}

output "name_servers" {
Expand Down

0 comments on commit c15073f

Please sign in to comment.