Skip to content

Commit

Permalink
refactor to two projects
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismarget-j committed Aug 13, 2023
1 parent 827c924 commit 6a48d4c
Show file tree
Hide file tree
Showing 22 changed files with 124 additions and 32 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions fabric/.terraform.lock.hcl

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

30 changes: 30 additions & 0 deletions fabric/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# the initial fabric construction happens in here
module "fabric" {
source = "../_modules/fabric"
}

# the null resource "disappears", forcing replacement whenever a
# trigger value is changed.
resource "null_resource" "force_redeploy" {
depends_on = [module.fabric]
triggers = {
// replace this resource whenever staging blueprint is revised
fabric_staging_revision = module.fabric.staging_revision
}
}

#// deploy resource depends on the null resource which vanishes with each new
#// blueprint revision. This way the blueprint is redeployed after every change
#resource "apstra_blueprint_deployment" "dc_1" {
# blueprint_id = module.fabric.blueprint_id
# comment = "Deployment by Terraform {{.TerraformVersion}}, Apstra provider {{.ProviderVersion}}, User $USER."
## depends_on = [module.fabric, module.vpn_routing, null_resource.force_redeploy]
#}

#module "vpn_routing" {
# source = "./_vpn_routing"
# blueprint_id = module.fabric.blueprint_id
# routing_zone_id = module.fabric.routing_zone_id
# vpn_edge_router_ip = local.vpn_edge_router_ip
# vpn_routing_policies = local.vpn_routing_policies
#}
2 changes: 2 additions & 0 deletions fabric/output.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
output blueprint_id { value = module.fabric.blueprint_id }
output routing_zone_id { value = module.fabric.routing_zone_id }
2 changes: 1 addition & 1 deletion provider.tf → fabric/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}
backend "s3" {
bucket = "inform-demo"
key = "inform-demo/terraform.tfstate"
key = "fabric/terraform.tfstate"
region = "us-east-1"
}
}
Expand Down
31 changes: 0 additions & 31 deletions main.tf

This file was deleted.

19 changes: 19 additions & 0 deletions vpn/.terraform.lock.hcl

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

8 changes: 8 additions & 0 deletions vpn/data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
data "terraform_remote_state" "fabric" {
backend = "s3"
config = {
bucket = "inform-demo"
key = "fabric/terraform.tfstate"
region = "us-east-1"
}
}
7 changes: 7 additions & 0 deletions vpn/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module "vpn_routing" {
source = "../_modules/vpn_routing"
blueprint_id = data.terraform_remote_state.fabric.outputs.blueprint_id
routing_zone_id = data.terraform_remote_state.fabric.outputs.routing_zone_id
vpn_edge_router_ip = local.vpn_edge_router_ip
vpn_routing_policies = local.vpn_routing_policies
}
File renamed without changes.
19 changes: 19 additions & 0 deletions vpn/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
terraform {
required_providers {
apstra = {
source = "Juniper/apstra"
version = "0.27.2"
}
}
backend "s3" {
bucket = "inform-demo"
key = "vpn/terraform.tfstate"
region = "us-east-1"
}
}

provider "apstra" {
tls_validation_disabled = true
blueprint_mutex_enabled = false
api_timeout = 0
}

0 comments on commit 6a48d4c

Please sign in to comment.