Skip to content

Commit

Permalink
v2.3.1 bugfix issue 59
Browse files Browse the repository at this point in the history
  • Loading branch information
knowbase committed May 3, 2023
1 parent 688fd2a commit 269827e
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 24 deletions.
2 changes: 2 additions & 0 deletions arcadia/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ data "tfe_outputs" "eks" {
workspace = "eks"
}
data "tfe_outputs" "nap" {
count = data.tfe_outputs.infra.values.nap ? 1 : 0
organization = var.tf_cloud_organization
workspace = "nap"
}
data "tfe_outputs" "nic" {
count = data.tfe_outputs.infra.values.nic ? 1 : 0
organization = var.tf_cloud_organization
workspace = "nic"
}
Expand Down
3 changes: 2 additions & 1 deletion arcadia/ingress.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ resource "kubernetes_ingress_v1" "arcadia-ingress" {
spec {
ingress_class_name = "nginx"
rule {
host = try(data.tfe_outputs.nap.values.external_name, data.tfe_outputs.nic.values.external_name, "arcadia-cd-demo.sr.f5-cloud-demo.com")
#host = try(data.tfe_outputs.nap.values.external_name, data.tfe_outputs.nic.values.external_name, "arcadia-cd-demo.sr.f5-cloud-demo.com")
host = try(data.tfe_outputs.nap[0].values.external_name, data.tfe_outputs.nic[0].values.external_name)
http {
path {
path = "/"
Expand Down
3 changes: 2 additions & 1 deletion arcadia/locals.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
locals {
project_prefix = data.tfe_outputs.infra.values.project_prefix
external_name = try(data.tfe_outputs.nap.values.external_name, data.tfe_outputs.nic.values.external_name, "arcadia-cd-demo.sr.f5-cloud-demo.com")
#external_name = try(data.tfe_outputs.nap.values.external_name, data.tfe_outputs.nic.values.external_name, "arcadia-cd-demo.sr.f5-cloud-demo.com")
external_name = try(data.tfe_outputs.nap[0].values.external_name, data.tfe_outputs.nic[0].values.external_name)
aws_region = data.tfe_outputs.infra.values.aws_region
host = data.tfe_outputs.eks.values.cluster_endpoint
cluster_ca_certificate = data.tfe_outputs.eks.values.kubeconfig-certificate-authority-data
Expand Down
2 changes: 1 addition & 1 deletion bigip-awaf/awaf.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module "postbuild-config-awaf" {
source = "f5devcentral/postbuild-config/bigip//as3"
version = "0.6.3"
count = var.create_awaf_config ? 1 : 0
#count = var.create_awaf_config ? 1 : 0
bigip_user = var.f5_username
bigip_password = var.aws_secretmanager_auth ? "" : random_string.password.result
bigip_address = module.bigip.mgmtPublicIP
Expand Down
4 changes: 0 additions & 4 deletions bigip-awaf/terraform.tfvars

This file was deleted.

4 changes: 3 additions & 1 deletion bigip-awaf/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ variable "f5_password" {
}

#AWAF Config
/*
variable "create_awaf_config" {
type = bool
default = false
description = "Set to true to create AWAF config"
}
*/
variable "awaf_config_payload" {
type = string
description = "AWAF Policy AS3"
default = "/path/to/as/file"
default = "awaf-config.json"
}

#App Server
Expand Down
14 changes: 12 additions & 2 deletions infra/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,15 @@ output "internal_sg_id" {
value = aws_security_group.internal.id
}



output "nap" {
value = var.nap
}
output "nic" {
value = var.nic
}
output "bigip" {
value = var.bigip
}
output "bigip-cis" {
value = var.bigip-cis
}
5 changes: 5 additions & 0 deletions infra/terraform.tfvars.examples
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ resource_owner = "You"
#AWS INFRA
aws_region = "us-east-1"
azs = ["us-east-1a", "us-east-1b"]

#Assets
nic = false
nap = false
bigip = false
13 changes: 12 additions & 1 deletion infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,15 @@ variable "int_address_prefixes" {
default = ["10.1.20.0/24", "10.1.120.0/24"]
description = "Internal subnet address prefixes"
}

variable "nap" {
type = bool
}
variable "nic" {
type = bool
}
variable "bigip" {
type = bool
}
variable "bigip-cis" {
type = bool
}
13 changes: 3 additions & 10 deletions nap/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ data "tfe_outputs" "eks" {
workspace = "eks"
}
data "tfe_outputs" "bigip-base" {
count = data.tfe_outputs.infra.values.bigip ? 1 : 0
organization = var.tf_cloud_organization
workspace = "bigip-base"
}
data "tfe_outputs" "bigip-cis" {
count = data.tfe_outputs.infra.values.bigip-cis ? 1 : 0
organization = var.tf_cloud_organization
workspace = "bigip-cis"
}
Expand All @@ -22,13 +24,4 @@ data "kubernetes_service_v1" "nginx-service" {
name = try(format("%s-%s", helm_release.nginx-plus-ingress.0.name, helm_release.nginx-plus-ingress.0.chart), format("%s-%s", helm_release.nginx-plus-ingresslink.0.name, helm_release.nginx-plus-ingresslink.0.chart))
namespace = try(helm_release.nginx-plus-ingress[0].namespace, helm_release.nginx-plus-ingresslink[0].namespace)
}
}
/*
data "kubernetes_service_v1" "nginx-service-link" {
count = local.bigip_cis ? 1 : 0
metadata {
name = try(format("%s-%s", helm_release.nginx-plus-ingresslink[0].name, helm_release.nginx-plus-ingresslink[0].chart), "")
namespace = try(helm_release.nginx-plus-ingresslink[0].namespace, "")
}
}
*/
}
2 changes: 2 additions & 0 deletions nic/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ data "tfe_outputs" "eks" {
workspace = "eks"
}
data "tfe_outputs" "bigip-base" {
count = data.tfe_outputs.infra.values.bigip ? 1 : 0
organization = var.tf_cloud_organization
workspace = "bigip-base"
}
data "tfe_outputs" "bigip-cis" {
count = data.tfe_outputs.infra.values.bigip-cis ? 1 : 0
organization = var.tf_cloud_organization
workspace = "bigip-cis"
}
Expand Down
3 changes: 3 additions & 0 deletions xc/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ data "tfe_outputs" "infra" {
workspace = "infra"
}
data "tfe_outputs" "bigip" {
count = data.tfe_outputs.infra.values.bigip ? 1 : 0
organization = var.tf_cloud_organization
workspace = "bigip-base"
}
data "tfe_outputs" "nap" {
count = data.tfe_outputs.infra.values.nap ? 1 : 0
organization = var.tf_cloud_organization
workspace = "nap"
}
data "tfe_outputs" "nic" {
count = data.tfe_outputs.infra.values.nic ? 1 : 0
organization = var.tf_cloud_organization
workspace = "nic"
}
9 changes: 6 additions & 3 deletions xc/locals.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
locals {
project_prefix = data.tfe_outputs.infra.values.project_prefix
build_suffix = data.tfe_outputs.infra.values.build_suffix
origin_bigip = try(data.tfe_outputs.bigip.values.bigip_public_vip, "")
origin_nginx = try(data.tfe_outputs.nap.values.external_name, data.tfe_outputs.nic.values.external_name, "")
#59origin_bigip = try(data.tfe_outputs.bigip.values.bigip_public_vip, "")
#59origin_nginx = try(data.tfe_outputs.nap.values.external_name, data.tfe_outputs.nic.values.external_name, "")
origin_bigip = try(data.tfe_outputs.bigip[0].values.bigip_public_vip, "")
origin_nginx = try(data.tfe_outputs.nap[0].values.external_name, data.tfe_outputs.nic[0].values.external_name, "")
origin_server = "${coalesce(local.origin_bigip, local.origin_nginx)}"
origin_port = try(data.tfe_outputs.nap.values.external_port, data.tfe_outputs.nic.values.external_port, "80")
#59origin_port = try(data.tfe_outputs.nap.values.external_port, data.tfe_outputs.nic.values.external_port, "80")
origin_port = try(data.tfe_outputs.nap[0].values.external_port, data.tfe_outputs.nic[0].values.external_port, "80")
dns_origin_pool = local.origin_nginx != "" ? true : false
}

0 comments on commit 269827e

Please sign in to comment.