-
-
Notifications
You must be signed in to change notification settings - Fork 108
Add VPC Connectivity SASL Scram and IAM #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Important Cloud Posse Engineering Team Review RequiredThis pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes. To expedite this process, reach out to us on Slack in the |
/terratest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to #136 my only fears are if the block does not work when no value is supplied.
We also need to get tests working.
vpc_connectivity { | ||
client_authentication { | ||
sasl { | ||
iam = var.vpc_connectivity_client_authentication_sasl_iam_enabled | ||
scram = var.vpc_connectivity_client_authentication_sasl_scram_enabled | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vpc_connectivity { | |
client_authentication { | |
sasl { | |
iam = var.vpc_connectivity_client_authentication_sasl_iam_enabled | |
scram = var.vpc_connectivity_client_authentication_sasl_scram_enabled | |
} | |
} | |
} | |
dynamic "vpc_connectivity" { | |
for_each = var.vpc_connectivity == null ? [] : [var.vpc_connectivity] | |
content { | |
client_authentication { | |
dynamic "sasl" { | |
for_each = ( | |
try(vpc_connectivity.value.sasl_iam_enabled, null) != null || | |
try(vpc_connectivity.value.sasl_scram_enabled, null) != null | |
) ? [1] : [] | |
content { | |
iam = try(vpc_connectivity.value.sasl_iam_enabled, null) | |
scram = try(vpc_connectivity.value.sasl_scram_enabled, null) | |
} | |
} | |
} | |
} | |
} |
variable "vpc_connectivity_client_authentication_sasl_iam_enabled" { | ||
type = bool | ||
default = false | ||
description = "Enables SASL/IAM authentication for VPC connectivity" | ||
nullable = false | ||
} | ||
|
||
variable "vpc_connectivity_client_authentication_sasl_scram_enabled" { | ||
type = bool | ||
default = false | ||
description = "Enables SASL/SCRAM authentication for VPC connectivity." | ||
nullable = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable "vpc_connectivity_client_authentication_sasl_iam_enabled" { | |
type = bool | |
default = false | |
description = "Enables SASL/IAM authentication for VPC connectivity" | |
nullable = false | |
} | |
variable "vpc_connectivity_client_authentication_sasl_scram_enabled" { | |
type = bool | |
default = false | |
description = "Enables SASL/SCRAM authentication for VPC connectivity." | |
nullable = false | |
} | |
variable "vpc_connectivity" { | |
description = <<-EOT | |
Optional VPC connectivity settings. Set to null to omit the entire `vpc_connectivity` block. | |
Provide booleans for SASL IAM and/or SCRAM. | |
Example: | |
vpc_connectivity = { | |
sasl_iam_enabled = true | |
sasl_scram_enabled = true | |
} | |
EOT | |
type = object({ | |
sasl_iam_enabled = optional(bool) | |
sasl_scram_enabled = optional(bool) | |
}) | |
default = null | |
nullable = true | |
validation { | |
condition = var.vpc_connectivity == null | |
|| try(var.vpc_connectivity.sasl_iam_enabled, false) | |
|| try(var.vpc_connectivity.sasl_scram_enabled, false) | |
error_message = "When vpc_connectivity is set, enable at least one of sasl_iam_enabled or sasl_scram_enabled." | |
} | |
} |
/terratest |
what
why
references