Skip to content

Commit

Permalink
Merge pull request #14 from segateway/next-major
Browse files Browse the repository at this point in the history
Next major
  • Loading branch information
ryanfaircloth authored Feb 22, 2024
2 parents 06a43f8 + a9ca52b commit 54e46a6
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 0 deletions.
94 changes: 94 additions & 0 deletions _envcommon/infra/k8s/segway/source-box.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# ---------------------------------------------------------------------------------------------------------------------
# COMMON TERRAGRUNT CONFIGURATION
# This is the common component configuration for mysql. The common variables for each environment to
# deploy mysql are defined here. This configuration will be merged into the environment configuration
# via an include block.
# ---------------------------------------------------------------------------------------------------------------------

# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
# working directory, into a temporary folder, and execute your Terraform commands in that folder. If any environment
# needs to deploy a different module version, it should redefine this block with a different ref to override the
# deployed version.
terraform {
source = "tfr:///segateway/argocd-applicationset/kubernetes?version=1.0.0"
}

# ---------------------------------------------------------------------------------------------------------------------
# Locals are named constants that are reusable within the configuration.
# ---------------------------------------------------------------------------------------------------------------------
locals {
box_values = yamldecode(file(find_in_parent_folders("box_values.yaml")))
}

dependency "k8s" {
config_path = "${get_terragrunt_dir()}/../../../infra/k8s/"
}

dependencies {
paths = [
"${get_terragrunt_dir()}/../../../infra/k8s-system/argocd/projects/segway",
]
}
generate "provider" {
path = "provider_k8s.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
provider "kubernetes" {
host = "${dependency.k8s.outputs.exec_host}"
cluster_ca_certificate = base64decode("${dependency.k8s.outputs.ca_certificate}")
exec {
api_version = "${dependency.k8s.outputs.exec_api}"
command = "${dependency.k8s.outputs.exec_command}"
args = ${jsonencode(dependency.k8s.outputs.exec_args)}
}
}
EOF
}
# ---------------------------------------------------------------------------------------------------------------------
# MODULE PARAMETERS
# These are the variables we have to pass in to use the module. This defines the parameters that are common across all
# environments.
# ---------------------------------------------------------------------------------------------------------------------
inputs = {
name = "box"


repository = "https://segateway.github.io/charts"

release = "box"
chart = "segway-sys-source-box-enterprise"
chart_version = "v1.1.11"
namespace = "segateway"
create_namespace = true
project = "segateway"
skipCrds = false


values = yamldecode(<<YAML
image:
repository: ghcr.io/segateway/containers/segway-connect-system-source-box-enterprise
resources:
requests:
cpu: 50m
memory: 128Mi
podAnnotations:
reloader.stakater.com/auto: "true"
nexthop:
name: ls-cloud-segateway-destination-logscale
secret:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
data:
box.json: ${jsonencode(local.box_values.boxjson)}
YAML
)

ignoreDifferences = [
]
}
27 changes: 27 additions & 0 deletions _modules/global/segway/box/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ---------------------------------------------------------------------------------------------------------------------
# TERRAGRUNT CONFIGURATION
# This is the configuration for Terragrunt, a thin wrapper for Terraform that helps keep your code DRY and
# maintainable: https://github.com/gruntwork-io/terragrunt
# ---------------------------------------------------------------------------------------------------------------------

# ---------------------------------------------------------------------------------------------------------------------
# Include configurations that are common used across multiple environments.
# ---------------------------------------------------------------------------------------------------------------------

# Include the root `terragrunt.hcl` configuration. The root configuration contains settings that are common across all
# components and environments, such as how to configure remote state.
include "root" {
path = find_in_parent_folders()
}

# Include the envcommon configuration for the component. The envcommon configuration contains settings that are common
# for the component across all environments.
include "envcommon" {
path = "${dirname(find_in_parent_folders())}/_envcommon/infra/k8s/segway/source-box.hcl"
expose = true
}


# ---------------------------------------------------------------------------------------------------------------------
# We don't need to override any of the common parameters for this environment, so we don't specify any inputs.
# ---------------------------------------------------------------------------------------------------------------------
4 changes: 4 additions & 0 deletions deployments/box_vars.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
boxjson: |
{
}
14 changes: 14 additions & 0 deletions deployments/segway_values.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ config:
- name: f_intune
condition: |-
tags('vendor:microsoft') and tags('suite:intune');
- name: f_box
condition: |-
tags('vendor:box') and tags('suite:enterprise');
- name: f_mimecast_cloudgateway_siem
condition: |-
tags('vendor:mimecast') and tags('suite:cloudgateway');
Expand Down Expand Up @@ -102,6 +105,17 @@ config:
# value: mimecast
# sourcetype: mimecast
# repo: saas-mimecast-cloud-gateway
# - name: box
# filters:
# - filter(f_box)
# flags: [catchall, final]
# template: t_logscale_parsed
# tags:
# - name: Vendor
# value: box
# # If using market place package
# sourcetype: box/box:boxenterprise
# repo: saas-box
- name: fallback
template: t_logscale_parsed
sourcetype: segway-unknown
Expand Down

0 comments on commit 54e46a6

Please sign in to comment.