Skip to content

Commit 6cdd595

Browse files
committed
fix: update variables; use single cert in container
1 parent 2c8ef06 commit 6cdd595

5 files changed

Lines changed: 24 additions & 5 deletions

File tree

m365/README.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ Advanced::
9797
`create_app` (bool) [default=True]::: If true, the app will be created. If false, the app will be imported
9898
`prefix_override` (string) [default=None]::: Prefix for resource names. If null, one will be generated from app_name
9999
`input_storage_container_url` (string) [default=None]::: If not null, input container to read configs from (must give permissions to service account). Otherwise by default will create storage container. Expect an https url pointing to a container
100-
`output_storage_container_url` (string) [default=None]::: If not null, output container to put results in (must give permissions to service account or use SAS). Otherwise by default will create storage container. Expect an https url pointing to a container
101-
`output_storage_container_sas` (string) [default=None]::: If not null, shared access signature token (query string) to use when writing results to the output storage container. Set this when the container is in an external tenant (the owner of that container will provide the value).
100+
`output_storage_container_url` (string) [default=None]::: If not null, output container to put results in (must give permissions to service account). Otherwise by default will create storage container. Expect an https url pointing to a container
102101
`tenants_dir_path` (string) [default=./tenants]::: Relative path to directory containing tenant configuration files in yaml
103-
`container_registry` (object) [default={'server': 'ghcr.io'}]::: Credentials for logging into registry with container image
102+
`container_registry` (object) [default=None]::: Credentials for logging into registry with container image
104103
`container_image` (string) [default=ghcr.io/cisagov/scubaconnect-m365:latest]::: Docker image to use for running ScubaGear.
105104
`container_memory_gb` (number) [default=3]::: Amount of memory to allocate for ScubaGear container. Due to memory leaks in some dependencies, this may need to be increased if running on many tenants
105+
`secondary_app_info` (object) [default=None]::: Information for a secondary app. This can be used for one ScubaConnect instance to handle multiple environments (e.g., GCC and GCC High).
106+
To use, manually create an app in the other environment and add the certificate created for the primary app to it.
107+
Set `environment_to_use` to the environment the manual app is in, either "commericial" or "gcchigh"
106108

107109
[#onboard]
108110
=== Onboarding a Tenant

m365/image/run_container.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Foreach ($tenantConfig in $(Get-ChildItem 'input\')) {
7373
Write-Output "Running ScubaGear for $($tenantConfig.BaseName)"
7474

7575
$params = @{
76-
CertificateThumbPrint = if ($null -ne $Env:SECONDARY_APP_ID -and $org.EndsWith($Env:SECONDARY_APP_TLD)) {$CertificateThumbPrintSecondary} else {$CertificateThumbPrint};
76+
CertificateThumbPrint = $CertificateThumbPrint;
7777
AppID = if ($null -ne $Env:SECONDARY_APP_ID -and $org.EndsWith($Env:SECONDARY_APP_TLD)) {$Env:SECONDARY_APP_ID} else {$Env:APP_ID};
7878
Organization = $org;
7979
OutPath = ".\reports\$($org)"; # The folder path where the output will be stored

m365/terraform/env/example/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ module "scuba_connect" {
1515
input_storage_container_url = var.input_storage_container_url
1616
output_storage_container_url = var.output_storage_container_url
1717
tags = var.tags
18+
secondary_app_info = var.secondary_app_info
1819
}

m365/terraform/env/example/variables.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,20 @@ variable "container_memory_gb" {
135135
condition = var.container_memory_gb <= 16 && var.container_memory_gb >= 2
136136
error_message = "Container memory must be between 2GB and 16GB"
137137
}
138+
}
139+
variable "secondary_app_info" {
140+
description = <<EOF
141+
Information for a secondary app. This can be used for one ScubaConnect instance to handle multiple environments (e.g., GCC and GCC High).
142+
To use, manually create an app in the other environment and add the certificate created for the primary app to it.
143+
Set `environment_to_use` to the environment the manual app is in, either "commericial" or "gcchigh"
144+
EOF
145+
type = object({
146+
app_id = string
147+
environment_to_use = string
148+
})
149+
default = null
150+
validation {
151+
condition = var.secondary_app_info == null ? true : contains(["commercial", "gcchigh"], var.secondary_app_info.environment_to_use)
152+
error_message = "Valid values for create_mode are (Default, PointInTimeRestore, Replica)"
153+
}
138154
}

utils/tf_vars_to_adoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
t = "object"
1717
default = f"[default={v[name]['default']}]" if "default" in v[name] else ""
1818
desc = v[name]["description"]
19-
print(f"`{name}` ({t}) {default}::: {desc}")
19+
print(f"`{name}` ({t}) {default}::: {desc.strip()}")

0 commit comments

Comments
 (0)