Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
tajewole-moj committed Oct 18, 2023
1 parent ca5a4c3 commit 73638ef
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
12 changes: 6 additions & 6 deletions terraform/environments/apex/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ module "lambda_backup" {
source = "./module/lambda"

backup_policy_name = "${local.application_name}-lambda-instance-policy"
source_file = ["dbsnapshot.js","deletesnapshots.py","dbconnect.js"]
output_path = ["snapshotDBFunction.zip","deletesnapshotFunction.zip","connectDBFunction.zip"]
filename = ["snapshotDBFunction.zip", "deletesnapshotFunction.zip","connectDBFunction.zip"]
function_name = ["snapshotDBFunction","deletesnapshotFunction","connectDBFunction"]
handler = ["snapshot/dbsnapshot.handler","deletesnapshots.lambda_handler","ssh/dbconnect.handler"]
source_file = local.dbsourcefiles
output_path = local.zipfiles
filename = local.zipfiles
function_name = local.functions
handler = [local.local.dbsnaphandler, local.local.deletesnaphandler, local.local.connecthandler]
role = module.iambackup.backuprole
runtime = [ "nodejs18.x","python3.8","nodejs18.x"]
runtime = [ local.nodejsversion, local.local.pythonversion, local.local.nodejsversion ]



Expand Down
24 changes: 24 additions & 0 deletions terraform/environments/apex/locals.tf
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
#### This file can be used to store locals specific to the member account ####
locals {
#js FIles
dbsourcefiles = var.source_file


#ZIP FILES Below
zipfiles = var.output_path

#Functions
functions = var.function_name

#Handlers
dbsnaphandler= "snapshot/dbsnapshot.handler"
deletesnaphandler= "deletesnapshots.lambda_handler"
connecthandler= "ssh/dbconnect.handler"

#Runtime
nodejsversion= "nodejs18.x"
pythonversion= "python3.8"




}
19 changes: 19 additions & 0 deletions terraform/environments/apex/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
variable "source_file" {
type = list(any)
default = ["dbsnapshot.js","deletesnapshots.py","dbconnect.js"]
}

variable "output_path" {
type = list(any)
default = ["snapshotDBFunction.zip","deletesnapshotFunction.zip","connectDBFunction.zip"]
}

variable "filename" {
type = list(any)
default = ["snapshotDBFunction.zip", "deletesnapshotFunction.zip","connectDBFunction.zip"]
}

variable "function_name" {
type = list(string)
default = ["snapshotDBFunction","deletesnapshotFunction","connectDBFunction"]
}

0 comments on commit 73638ef

Please sign in to comment.