Skip to content
Closed
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
6 changes: 5 additions & 1 deletion elastio-terraform-deployment/module/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ locals {
disableCustomerManagedIamPolicies = var.disable_customer_managed_iam_policies
disableServiceLinkedRolesCreation = var.service_linked_roles == "tf"
supportRoleExpirationDate = var.support_role_expiration_date
networkConfiguration = var.network_configuration
}

enriched_connectors = [
Expand Down Expand Up @@ -158,7 +159,10 @@ locals {
elastio_cloud_connector_deploy_requests = [
for connector in var.elastio_cloud_connectors : merge(
connector,
{ account_id = data.aws_caller_identity.current.account_id },
{
account_id = data.aws_caller_identity.current.account_id,
network_configuration = var.network_configuration
}
)
]
}
Expand Down
20 changes: 18 additions & 2 deletions elastio-terraform-deployment/module/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ variable "elastio_cloud_connectors" {

type = list(object({
region = string
vpc_id = string
subnet_ids = list(string)
vpc_id = optional(string)
subnet_ids = optional(list(string))

s3_access_logging = optional(object({
target_bucket = string
Expand Down Expand Up @@ -198,3 +198,19 @@ variable "support_role_expiration_date" {
type = string
default = null
}

variable "network_configuration" {
description = <<DESCR
Allow to choose between the Elastio-managed network (`Auto`)
or a manually configured network (`Manual`).
DESCR

type = string
default = "Manual"
nullable = false

validation {
condition = contains(["Auto", "Manual"], var.network_configuration)
error_message = "network_configuration must be one of 'Auto', 'Manual'"
}
}