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

[Docs]: aws_rds_cluster add section for Major version upgrades and parameter db_instance_parameter_group_name #27617

Open
carlosjgp opened this issue Nov 3, 2022 · 5 comments
Labels
documentation Introduces or discusses updates to documentation. examples Introduces or discusses updates to examples. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/rds Issues and PRs that pertain to the rds service.

Comments

@carlosjgp
Copy link

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/rds_cluster#db_instance_parameter_group_name

Description

Looks like the way to perform a major version upgrade of an RDS cluster with instances is to specify the instance parameter group on the cluster resource which is counter-intuitive.

This is not clearly explained anywhere on the AWS API docs, AWS documentation, AWS CLI or Terraform AWS provider

It seemed something that you have to know because you have suffered it 😅

I think a simple section explaining just a little bit better what is that parameter for and why you might need to use it whenever you are not using the default parameter groups would be incredibly helpful

References

Would you like to implement a fix?

Yes

@carlosjgp carlosjgp added documentation Introduces or discusses updates to documentation. needs-triage Waiting for first response or review from a maintainer. labels Nov 3, 2022
@github-actions
Copy link

github-actions bot commented Nov 3, 2022

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@justinretzolk justinretzolk added good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/rds Issues and PRs that pertain to the rds service. examples Introduces or discusses updates to examples. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 3, 2022
@bennylu2
Copy link
Contributor

bennylu2 commented Jan 1, 2023

@carlosjgp could you provide some sample terraform code for performing an upgrade? I believe it also requires instance

@carlosjgp
Copy link
Author

Sorry for the delay

variable "allow_major_version_upgrade" {
  description = "Enable to allow major engine version upgrades when changing engine versions"
  type        = bool
  default     = false
}

variable "db_parameter_group_name" {
  description = "The name of a DB parameter group to use for each instance"
  type        = string
}

variable "db_cluster_parameter_group_name" {
  description = "The name of a DB Cluster parameter group to use"
  type        = string
}

resource "aws_rds_cluster" "this" {
  <...>
  db_cluster_parameter_group_name  = var.db_cluster_parameter_group_name
  allow_major_version_upgrade      = var.allow_major_version_upgrade
  db_instance_parameter_group_name = var.allow_major_version_upgrade ? var.db_parameter_group_name : null

}

resource "aws_rds_cluster_instance" "this" {
  <...>
  db_parameter_group_name = var.db_parameter_group_name
}

@carlosjgp
Copy link
Author

Here is our documentation about engine upgrades


Engine upgrades

AWS documentation

Automated minor upgrades

AWS auto minor upgrades only trigger for versions that AWS itself consider contains necessary security patches

Minor

  • Ensure auto_minor_version_upgrade = false.
  • Update the engine_version value to the desired version.
  • Set apply_immediately = true or leave false to be updated over the next RDS maintenance window
  • Terraform Apply
  • Set back auto_minor_version_upgrade = true, leave only the major verisonon engine_version and apply_immediately = false if you want
  • Terraform Apply

Major

  • Set allow_major_version_upgrade = true.
  • Update the engine_version value to the desired version following AWS documentation
  • Set apply_immediately = true or left false to be updated over the next RDS maintenance window
  • Terraform Apply
  • Set back allow_major_version_upgrade = false and apply_immediately = false
  • Terraform Apply

PostGIS

PostGIS

When upgrading major PG version check if PostGIS extension is installed.

Upgrade version 2 to 3

Upgrade guide

@arianvp
Copy link

arianvp commented Jun 17, 2024

The provider already handles this in the code it seems:

input.DBInstanceParameterGroupName = nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. examples Introduces or discusses updates to examples. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

No branches or pull requests

4 participants