Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion fast/stages-aw/0-bootstrap/kms.tf

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consolidate, can you move the local declaration of local.kms_protection_level from main.tf into kms.tf? I think this will make it easier to track

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
# limitations under the License.

locals {
kms_protection_level = coalesce(var.kms_protection_level, var.assured_workloads.regime == "FEDRAMP_MODERATE" ? "SOFTWARE" : "HSM")
version_template = {
algorithm = "GOOGLE_SYMMETRIC_ENCRYPTION"
protection_level = var.kms_protection_level
protection_level = local.kms_protection_level

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we even use local.protection_level anywhere, would suggest removing this altogether if that is the case

}
}
module "logging-kms" {
Expand Down
3 changes: 1 addition & 2 deletions fast/stages-aw/0-bootstrap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ locals {
kms = var.regions.primary
}
# naming: environment used in most resource names
prefix = join("-", compact([var.prefix, "prod"]))
kms_protection_level = coalesce(var.kms_protection_level, var.assured_workloads.regime == "FEDRAMP_MODERATE" ? "SOFTWARE" : "HSM")
prefix = join("-", compact([var.prefix, "prod"]))
}
3 changes: 2 additions & 1 deletion fast/stages-aw/0-bootstrap/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ locals {
}
assured_workloads = merge(var.assured_workloads, { "folder" = local.assured_workload_folder })
common_services_folder = module.branch-common-services-folder.folder.name
kms_protection_level = local.kms_protection_level
regions = var.regions
}

Expand Down Expand Up @@ -165,7 +166,7 @@ output "custom_roles" {

output "kms_protection_level" {
description = "KMS protection level."
value = var.kms_protection_level
value = local.kms_protection_level
}

output "outputs_bucket" {
Expand Down
5 changes: 5 additions & 0 deletions fast/stages-aw/0-bootstrap/terraform.tfvars.sample
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ assured_workloads = {
bootstrap_project = "<bootstrap_project_id>"

alert_email = "<alert_email>"

# KMS protection level for CMEK keys. Leave unset to get a regime-aware default:
# SOFTWARE for FEDRAMP_MODERATE, HSM for all other regimes (including FEDRAMP_HIGH and IL5).
# Explicitly set to "SOFTWARE" or "HSM" to override the default.
# kms_protection_level = "HSM"
2 changes: 2 additions & 0 deletions fast/stages-aw/1-resman/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,11 @@ variable "groups" {
}

variable "kms_protection_level" {
# tfdoc:variable:source 0-bootstrap
description = "KMS protection level."
type = string
nullable = true
default = null
}

variable "organization" {
Expand Down
2 changes: 2 additions & 0 deletions fast/stages-aw/2-networking-a-fedramp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,11 @@ variable "groups" {
}

variable "kms_protection_level" {
# tfdoc:variable:source 0-bootstrap
description = "KMS protection level."
type = string
nullable = true
default = null
}

variable "regime_mapping" {
Expand Down
2 changes: 2 additions & 0 deletions fast/stages-aw/3-security/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ variable "kms_keys" {
}

variable "kms_protection_level" {
# tfdoc:variable:source 0-bootstrap
description = "Protection level (HSM or SOFTWARE) applied to every key in kms_keys that does not set its own version_template."
type = string
nullable = true
default = null
}
variable "logging" {
# tfdoc:variable:source 0-bootstrap
Expand Down