rds-lambda-db-provisioner

aleks-fofanov/rds-lambda-db-provisioner/aws

Terraform Module HCL AWS

Terraform module to provision database in AWS RDS instance in a VPC

Install
module "rds-lambda-db-provisioner" {
source = "aleks-fofanov/rds-lambda-db-provisioner/aws"
version = "2.0.0"
}
plain text: /constructs/tfmod-aleks-fofanov-rds-lambda-db-provisioner-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

AWS RDS Lambda database provisioner Introduction This module provisions an AWS lambda function which creates a new database and optionally a new user in RDS instance within a VPC. Supported engines are postgres and mysql. A newly created user or a master user (in case when you don't need a new user) will be granted all permissions to the created database. This module is aim to solve a cold-start problem - when you execute terraform apply and all your infrastructure is provisioned in one run. If are trying to solve a different problem, then you should be optimizing for Day 2 operations and provision a database by other means (e.g. using terraform postrgres provider). Features: - Master user password as well as new user password can be passed to the module either via - Module variables - Par

Inputs (25)
NameTypeDescriptionDefault
logs_kms_key_idstringKMS Key Id for Lambda function logs encryption required
logs_retention_daysnumberLambda function logs retentions in days required
db_instance_idstringDB Instance Identifier required
db_instance_security_group_idstringDB instance security group to add rules to. Rules will allow communication betwe required
vpc_configobject({ vpc_id VPC configuration for Lambda function required
db_master_password_ssm_paramstringName of SSM Parameter that stores password for master user. This param takes pre required
db_user_password_ssm_param_kms_keystringIdentifier of KMS key used for encryption of SSM Parameter that stores password required
kms_keystringKMS key identifier. Accepts the same format as KMS key data source (https://www. required
db_namestringDatabase name that should be created required
db_userstringName of user that should be created and own (has all permission to) the provisio required
db_user_password_ssm_paramstringName of SSM Parameter that stores password for provisioned user. This param take required
db_master_password_ssm_param_kms_keystringIdentifier of KMS key used for encryption of SSM Parameter that stores password required
db_master_passwordstringDB Instance master password. The usage of this parameter is discouraged. Conside required
db_user_passwordstringPassword for the user that should be created and own (has all permission to) the required
namespacestringNamespace (e.g. `cp` or `cloudposse`)""
delimiterstringDelimiter to be used between `namespace`, `name`, `stage` and `attributes`"-"
stagestringStage (e.g. `prod`, `dev`, `staging`)""
attributeslist(string)Additional attributes, e.g. `1`[]
tagsmap(string)Additional tags (e.g. `map(`BusinessUnit`,`XYZ`){}
namestringSolution name, e.g. 'app' or 'jenkins'"rds"
enabledboolDefines whether this module should create resourcestrue
memorynumberAmount of memory in MB your Lambda Function can use at runtime256
timeoutnumberThe amount of time your Lambda Function has to run in seconds30
invokeboolDefines whether lambda function should be invoked immediately after provisioningtrue
allowed_egress_cidr_blockslist(string)A list of CIDR blocks allowed to be reached from Lambda. Remember that Lambda ne[ "0.0.0.0/0" ]
Outputs (8)
lambda_iam_role_id — Lambda IAM Role ID
lambda_iam_role_name — Lambda IAM Role name
lambda_iam_role_arn — Lambda IAM Role ARN
lambda_function_arn — Lambda Function ARN
lambda_function_name — Lambda Function name
lambda_iam_policy_id — Lambda IAM Policy ID
lambda_iam_policy_name — Lambda IAM Policy name
lambda_iam_policy_arn — Lambda IAM Policy ARN
Resources (8)
aws_cloudwatch_log_groupaws_iam_policyaws_iam_roleaws_iam_role_policy_attachmentaws_lambda_aliasaws_lambda_functionaws_security_groupaws_security_group_rule
Details
FrameworkTerraform Module
LanguageHCL
Version2.0.0
Cloud AWS
★ Stars15
Forks15
Total downloads7.0k
Inputs25
Outputs8
Resources8
LicenseApache-2.0
Namespacealeks-fofanov
Updated