#terraform-aws-modules - June 2022

Nikhil Owalekar
Nikhil Owalekarover 4 years ago
Question regarding the RDS module
I’m not able to spin up a cluster with version aurora-mysql8.0
Here is my module invocation
module "rds_cluster_aurora_mysql" {
  source                 = "git::<https://github.com/cloudposse/terraform-aws-rds-cluster.git?ref=tags/0.50.2>"
  name                   = "${var.namespace}-${var.network_env}-db"
  engine                 = "aurora-mysql"
  cluster_family         = "aurora-mysql8.0"
  cluster_size           = 1
  admin_user             = var.master_username
  admin_password         = random_string.master_password.result
  db_port                = var.db_port
  db_name                = var.db_name
  allowed_cidr_blocks    = [data.terraform_remote_state.network.outputs.vpc_cidr]
  vpc_security_group_ids = [aws_security_group.db_sg.id]
  instance_type          = "db.t3.medium"
  maintenance_window     = "sun:14:00-sun:14:30"
  backup_window          = "08:00-08:30"
  storage_encrypted      = true
  vpc_id                 = data.terraform_remote_state.network.outputs.vpc_id
  subnets                = data.terraform_remote_state.network.outputs.private_subnets
  tags = {
    Name        = "${var.namespace}-${var.network_env}-rds"
    Environment = var.network_env
  }
}

And here’s the error
│ Error: error creating RDS cluster: InvalidParameterCombination: The Parameter Group some-service-dev-db-20220608115930742500000001 with DBParameterGroupFamily aurora-mysql8.0 cannot be used for this instance. Please use a Parameter Group with DBParameterGroupFamily aurora-mysql5.7
│ 	status code: 400, request id: 0aab02b6-5175-47b1-9548-61bb89f3a575
│ 
│   with module.rds_cluster_aurora_mysql.aws_rds_cluster.primary[0],
│   on terraform-aws-rds-cluster/main.tf line 60, in resource "aws_rds_cluster" "primary":
│   60: resource "aws_rds_cluster" "primary" {

There is no reference to 5.7 in my code! 🤷‍♂️
Please help 🙏
Ashutosh Verma
Ashutosh Vermaover 4 years ago
@Ashutosh Verma has joined the channel
Jason Gilfoil
Jason Gilfoilover 4 years ago
Hey all 👋 trying to use the elasticache-memcached module to create a "simple" cluster, but getting errors about the cluster_id being invalid. Am I setting something wrong here? Tried tracing it back through the module.this code and got lost in the weeds, and hoping it's something simple.

module "risk-memcached-staging" {
  source  = "cloudposse/elasticache-memcached/aws"
  version = "0.15.1"

  az_mode           = "single-az"
  availability_zone = "us-east-1a"
  vpc_id            = var.legacy_vpc_id
  subnets           = var.legacy_private_subnet_ids
  cluster_size      = "3"
  instance_type     = "cache.t2.micro"
  engine_version    = "1.6.12"
  apply_immediately = true

  elasticache_parameter_group_family = "default.memcached1.6"
}

And the errors:
Error: expected length of cluster_id to be in the range (1 - 50), got 

  on .terraform/modules/risk-memcached-staging/main.tf line 104, in resource "aws_elasticache_cluster" "default":
 104:   cluster_id           = module.this.id



Error: invalid value for cluster_id (must contain only lowercase alphanumeric characters and hyphens)

  on .terraform/modules/risk-memcached-staging/main.tf line 104, in resource "aws_elasticache_cluster" "default":
 104:   cluster_id           = module.this.id



Error: invalid value for cluster_id (must begin with a lowercase letter)

  on .terraform/modules/risk-memcached-staging/main.tf line 104, in resource "aws_elasticache_cluster" "default":
 104:   cluster_id           = module.this.id