variable "database_password" { type = "string" } variable "subnet_ids" { description = "Comma-delimited string of subnet ids" type = "string" } variable "security_group_id" { type = "string" } provider "archive" { version = "~> 1.1" } provider "aws" { version = "~> 1.23" } locals { # Solution from this comment to open issue on non-relative paths # https://github.com/hashicorp/terraform/issues/8204#issuecomment-332239294 # +1 for removing the "/" creation_filename = "${substr(data.archive_file.rds_creation_zip.output_path, length(path.cwd) + 1, -1)}" setup_filename = "${substr(data.archive_file.rds_setup_zip.output_path, length(path.cwd) + 1, -1)}" } data "archive_file" "rds_creation_zip" { type = "zip" output_path = "${path.module}/rds_creation.zip" source_dir = "${path.module}/rds_creation/" } data "archive_file" "rds_setup_zip" { type = "zip" output_path = "${path.module}/rds_setup.zip" source_dir = "${path.module}/rds_setup/" } # The SQL script that gets evaluated on new database instances. # Clearly, you will want to change this! data "template_file" "sql_script" { template = <