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

Has this module been tested with Aurora Serverless? #34

Closed
tharun-allu opened this issue Apr 1, 2019 · 6 comments
Closed

Has this module been tested with Aurora Serverless? #34

tharun-allu opened this issue Apr 1, 2019 · 6 comments

Comments

@tharun-allu
Copy link

instance_type is not required for aurora serverless but the module makes this as required. Is it possible to give an example for how to create a serverless instance?

@mkubenka
Copy link

mkubenka commented Apr 5, 2019

You can set replica_count = 0 to skip aws_rds_cluster_instance creation. In that case instance_type can be any value. Unfortunately, currently there is no option to configure scaling_configuration.

module "db" {
  source = "terraform-aws-modules/rds-aurora/aws"

  name = "test-aurora-serverless"

  engine         = "aurora"
  engine_mode    = "serverless"
  engine_version = "5.6.10a"
  family         = "aurora5.6"

  # Do not create cluster instance for serverless.
  replica_count = 0
  instance_type = "db.t2.micro"

  vpc_id  = "vpc-12345678"
  subnets = ["subnet-12345678", "subnet-87654321"]
}

@antonbabenko
Copy link
Member

Check examples/serverless for serverless usage:

module "aurora" {
source = "../../"
name = "aurora-serverless"
engine = "aurora"
engine_mode = "serverless"
replica_scale_enabled = false
replica_count = 0
backtrack_window = 10 # ignored in serverless
subnets = data.aws_subnet_ids.all.ids
vpc_id = data.aws_vpc.default.id
monitoring_interval = 60
instance_type = "db.r4.large"
apply_immediately = true
skip_final_snapshot = true
storage_encrypted = true
db_parameter_group_name = aws_db_parameter_group.aurora_db_postgres96_parameter_group.id
db_cluster_parameter_group_name = aws_rds_cluster_parameter_group.aurora_cluster_postgres96_parameter_group.id
scaling_configuration = {
auto_pause = true
max_capacity = 256
min_capacity = 2
seconds_until_auto_pause = 300
timeout_action = "ForceApplyCapacityChange"
}
}

@krushnaDash
Copy link

From terraform 0.12 on wards you can write scaling_configuration as https://www.terraform.io/docs/providers/aws/r/rds_cluster.html#scaling_configuration

scaling_configuration {
auto_pause = var.auto_pause
max_capacity = 64
min_capacity = 1
seconds_until_auto_pause = 300
}

@jurgenweber
Copy link
Contributor

jurgenweber commented Dec 16, 2020

I am on tf v14 and aws provider version 3.21.0

Error: error creating RDS cluster: InvalidParameterValue: The engine mode serverless you requested is currently unavailable.

In the plan:

  + resource "aws_rds_cluster" "this" {
      + apply_immediately                   = false
      + arn                                 = (known after apply)
      + availability_zones                  = (known after apply)
      + backtrack_window                    = 0
      + backup_retention_period             = 1
      + cluster_identifier                  = "zxcv"
      + cluster_identifier_prefix           = (known after apply)
      + cluster_members                     = (known after apply)
      + cluster_resource_id                 = (known after apply)
      + copy_tags_to_snapshot               = true
      + database_name                       = (known after apply)
      + db_cluster_parameter_group_name     = "zxcv"
      + db_subnet_group_name                = "zxcv"
      + deletion_protection                 = false
      + enable_http_endpoint                = false
      + endpoint                            = (known after apply)
      + engine                              = "aurora"
      + engine_mode                         = "serverless"
      + engine_version                      = "2.07.1"
      + final_snapshot_identifier           = "zxcv-0014df3f"
      + hosted_zone_id                      = (known after apply)
      + iam_database_authentication_enabled = false
      + id                                  = (known after apply)
      + kms_key_id                          = (known after apply)
      + master_password                     = (sensitive value)
      + master_username                     = "zxcv"
      + port                                = 3306
      + preferred_backup_window             = "08:00-09:00"
      + preferred_maintenance_window        = "sun:10:00-sun:11:00"
      + reader_endpoint                     = (known after apply)
      + skip_final_snapshot                 = true
      + storage_encrypted                   = true
      + tags                                = {
          + "Environment" = "z"
          + "ID"          = "x"
          + "Location"    = "c"
          + "Module"      = "databases"
          + "Provider"    = "v"
        }
      + vpc_security_group_ids              = [
          + "sg-zxcv",
        ]

      + scaling_configuration {
          + auto_pause               = true
          + max_capacity             = 256
          + min_capacity             = 2
          + seconds_until_auto_pause = 300
          + timeout_action           = "ForceApplyCapacityChange"
        }
    }
    ```
    
    thoughts?

@jurgenweber
Copy link
Contributor

ok, so!!!

We created one manually, worked.. check cloudtrail for the requests.

engine_version = "5.7.mysql_aurora.2.07.1"

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants