Skip to content
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

[DOP-2325] Increase module version and add variables for the buckets module #339

Closed
wants to merge 11 commits into from
24 changes: 14 additions & 10 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,20 @@ module "security-group" {


module "s3-storage" {
source = "app.terraform.io/indico/indico-aws-buckets/mod"
version = "3.3.1"
force_destroy = true # allows terraform to destroy non-empty buckets.
label = var.label
kms_key_arn = module.kms_key.key.arn
submission_expiry = var.submission_expiry
uploads_expiry = var.uploads_expiry
include_rox = var.include_rox
enable_backup = var.enable_s3_backup
enable_access_logging = var.enable_s3_access_logging
source = "app.terraform.io/indico/indico-aws-buckets/mod"
version = "4.0.0"
force_destroy = true # allows terraform to destroy non-empty buckets.
label = var.label
kms_key_arn = module.kms_key.key.arn
submission_expiry = var.submission_expiry
uploads_expiry = var.uploads_expiry
include_rox = var.include_rox
enable_backup = var.enable_s3_backup
enable_access_logging = var.enable_s3_access_logging
bucket_type = var.bucket_type
data_s3_bucket_name = var.data_s3_bucket_name
api_models_s3_bucket_name = var.api_models_s3_bucket_name
pgbackup_s3_bucket_name = var.pgbackup_s3_bucket_name
}


Expand Down
6 changes: 5 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ output "data_s3_bucket_name" {
value = module.s3-storage.data_s3_bucket_name
}

output "pgbackup_s3_bucket_name" {
description = "Name of the pgbackup s3 bucket"
value = module.s3-storage.pgbackup_s3_bucket_name
}

output "s3_role_id" {
description = "ID of the S3 role"
value = module.cluster.s3_role_id
}


output "efs_filesystem_id" {
description = "ID of the EFS filesystem"
value = var.include_efs == true ? module.efs-storage[0].efs_filesystem_id : ""
Expand Down
59 changes: 43 additions & 16 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -824,50 +824,50 @@ variable "harness_mount_path" {
}

variable "lambda_sns_forwarder_enabled" {
type = bool
default = false
type = bool
default = false
description = "If enabled a lamda will be provisioned to forward sns messages to an external endpoint."
}

variable "lambda_sns_forwarder_destination_endpoint" {
type = string
default = ""
type = string
default = ""
description = "destination URL for the lambda sns forwarder"
}

variable "lambda_sns_forwarder_topic_arn" {
type = string
default = ""
type = string
default = ""
description = "SNS topic to triger lambda forwarder."
}

variable "lambda_sns_forwarder_github_organization" {
type = string
default = "IndicoDataSolutions"
type = string
default = "IndicoDataSolutions"
description = "The github organization containing the lambda_sns_forwarder code to use"
}

variable "lambda_sns_forwarder_github_repository" {
type = string
default = ""
type = string
default = ""
description = "The github repository containing the lambda_sns_forwarder code to use"
}

variable "lambda_sns_forwarder_github_branch" {
type = string
default = "main"
type = string
default = "main"
description = "The github branch / tag containing the lambda_sns_forwarder code to use"
}

variable "lambda_sns_forwarder_github_zip_path" {
type = string
default = "zip/lambda.zip"
type = string
default = "zip/lambda.zip"
description = "Full path to the lambda zip file"
}

variable "lambda_sns_forwarder_function_variables" {
type = map
default = {}
type = map(any)
default = {}
description = "A map of variables for the lambda_sns_forwarder code to use"
}

Expand Down Expand Up @@ -1043,3 +1043,30 @@ variable "instance_volume_type" {
default = "gp2"
description = "The type of EBS volume to attach to the cluster nodes"
}

variable "bucket_type" {
type = string
default = "create"
validation {
condition = var.bucket_type == "create" || var.bucket_type == "load"
error_message = "${var.bucket_type} not valid. Type must be either create or load"
}
}

variable "data_s3_bucket_name" {
type = string
default = ""
description = "The name of the existing S3 bucket to be loaded and used as the data bucket"
}

variable "api_models_s3_bucket_name" {
type = string
default = ""
description = "The name of the existing S3 bucket to be loaded and used as the API model bucket"
}

variable "pgbackup_s3_bucket_name" {
type = string
default = ""
description = "The name of the existing S3 bucket to be loaded and used as the postgres backup bucket"
}