Skip to content

Instantly share code, notes, and snippets.

@diogoaurelio

diogoaurelio/locals.tf

Last active Sep 16, 2018
Embed
What would you like to do?
lambda_locals_env_vars.tf
################################################################################
# Locals used for different Lambdas Environmental Variables
################################################################################
locals {
redshift_loader_lambda_env_vars = {
ENVIRONMENT = "${var.environment}"
REGION = "${var.aws_region}"
IAM_ROLE = "${var.redshift_data_loader_lambda_iam_role}"
DB_HOST = "${var.redshift_data_loader_lambda_db_host}"
DB_PORT = "${var.redshift_data_loader_lambda_db_port}"
DB_NAME = "${var.redshift_data_loader_lambda_db_name}"
DB_USER = "${var.redshift_data_loader_lambda_db_user}"
DB_PW_PARAM = "${aws_ssm_parameter.redshift_lambda_db_password.name}"
DB_SCHEMA = "${var.redshift_data_loader_lambda_db_schema}"
DB_TABLE = "${var.redshift_data_loader_lambda_db_table}"
}
redshift_loader_lambda_dir = "${path.cwd}/../../../etl/lambda/redshift/"
}
################################################################################
# AWS SSM secret for Redshift user password
################################################################################
resource "aws_ssm_parameter" "redshift_lambda_db_password" {
name = "${var.environment}-${var.project}-redshift-lambda-password"
description = "${var.environment} redshift lambda user password"
type = "SecureString"
value = "${var.redshift_data_loader_lambda_db_password}"
key_id = "${aws_kms_key.redshift_secrets_key.arn}"
tags {
Environment = "${var.environment}"
Project = "${var.project}"
Name = "redshift-lambda-password"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.