Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db_name field doesn't work for AWS Custom SQL Server databases #143

Closed
metronlab-it opened this issue Aug 9, 2022 · 2 comments · Fixed by #144
Closed

db_name field doesn't work for AWS Custom SQL Server databases #143

metronlab-it opened this issue Aug 9, 2022 · 2 comments · Fixed by #144
Labels
bug 🐛 An issue with the system

Comments

@metronlab-it
Copy link

Describe the Bug

Trying to create an MSSQL RDS gives terraform error in hashistack aws_db_instance code.

Expected Behavior

Module can create Amazon RDS Custom for SQL Server instance

Steps to Reproduce

Try to create module as follows:

module "rds_instance" {
  source                      = "cloudposse/rds/aws"
  version                     = "v0.38.8"
  namespace                   = "${var.namespace}"
  stage                       = var.stage
  dns_zone_id                 = data.terraform_remote_state.server.outputs.aws_zone_id
  host_name                   = "msssql.${var.stage}"
  security_group_ids          = [ "${aws_security_group.mssql.id}" ]
  database_name               = "SQL_Master"
  database_user               = "sql_master"
  database_password           = var.password
  database_port               = 1433
  multi_az                    = true
  storage_type                = "io1"
  iops                        = 1500
  allocated_storage           = 100
  storage_encrypted           = true
  engine                      = "custom-sqlserver-se"
  engine_version              = "15.00.4073.23.v1"
  major_engine_version        = "15"
  instance_class              = "db.m5.large"
  db_parameter_group          = ""
  publicly_accessible         = true
  subnet_ids                  = module.db_dynamic_subnets.availability_zones
  vpc_id                      = module.db_vpc.vpc_id
  auto_minor_version_upgrade  = false
  allow_major_version_upgrade = false
  skip_final_snapshot         = true
  backup_retention_period     = 7
  backup_window               = "02:00-05:00"
  maintenance_window          = "Mon:00:00-Mon:01:30"
}

This gives the following :

│ Error: Unsupported argument
│ 
│   on .terraform/modules/rds_instance/main.tf line 31, in resource "aws_db_instance" "default":
│   31:   db_name               = var.database_name
│ 
│ An argument named "db_name" is not expected here.

whether or not the database_name is specified or not

Additional Context

Looking at the AWS documentation at https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/create-db-instance.html, we see:

Options¶
--db-name (string)
...
Amazon RDS Custom for SQL Server

Not applicable. Must be null.
@metronlab-it metronlab-it added the bug 🐛 An issue with the system label Aug 9, 2022
@0xCiBeR
Copy link

0xCiBeR commented Aug 30, 2022

Is there an ETA with this? Current state breaks the creation of new mysql databases

@VersusF
Copy link

VersusF commented Sep 19, 2022

Same for postgres in Terraform 1.2.9.
Current workaround is to use name instead of db_name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants