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

Added RDS Aurora MySQL blue/green deployment resource and test (testing WIP) #33978

Closed
wants to merge 15 commits into from

Conversation

autotune
Copy link
Contributor

Description

resource "aws_rds_cluster" "default" {
  cluster_identifier = "aurora-cluster-demo-3"
  availability_zones = ["us-east-1b", "us-east-1c", "us-east-1d"]
  database_name      = "mydb"
  master_username    = "foo"
  master_password    = "barbut8chars"
  engine             = "aurora-mysql"
  engine_version     = "5.7.mysql_aurora.2.12.0"
  skip_final_snapshot = true 
  db_cluster_parameter_group_name = "blue57"
}

resource "aws_rds_cluster_instance" "cluster_instances" {
  depends_on         = [aws_rds_cluster.default]
  count              =  2 
  identifier         = "aurora-cluster-${count.index}"
  cluster_identifier = "aurora-cluster-demo-3" 
  engine             = aws_rds_cluster.default.engine
  engine_version     = aws_rds_cluster.default.engine_version
  instance_class     = "db.t3.small"
  db_parameter_group_name = "blue57instance"
}

resource "aws_rds_cluster_blue_green_deployment" "status" {
  cluster_identifier = aws_rds_cluster.default.cluster_identifier
  cleanup_resources = true 
  engine = aws_rds_cluster.default.engine
  switchover_enabled = var.switchover_enabled 
  create_deployment = var.create_deployment
}

Relations

Closes #0000
--->

Closes #28956

Output from Acceptance Testing

WIP

% make testacc TESTS=TestAccXXX PKG=ec2

...

@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/rds Issues and PRs that pertain to the rds service. labels Oct 17, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 17, 2023
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 23, 2023
@autotune
Copy link
Contributor Author

@justinretzolk I have not been able to build a test for this as the parameter group is unable to wait for Aurora DB instance creation. Going to submit what I've finished so far today, if someone else wants to take over and finish building out the test portion that is fine with me.


}
return true, err
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal/service/rds/cluster_blue_green_resource.go:979:7: syntax error: unexpected comma at end of statement

)
}
}
}()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal/service/rds/cluster_blue_green_resource.go:983:3: syntax error: unexpected ( after top level declaration

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @autotune,
In this section of code, there is some funky bracing and indentation issues preventing us from getting past linting to build. I'm trying to debug this issue, but when I fix the braces and indentation I find references to variables that don't exist. Can you fill us in on what you think is going on in this code block?

@gdavison
Copy link
Contributor

gdavison commented Nov 25, 2023

Thanks for the work you've put into this, @autotune. Unfortunately, a stand-alone resource for RDS Blue/Green Deployments does not fit with the Terraform model of declarative infrastructure: Using the resource would require multiple iterations of editing the Terraform configuration, applying the configuration, or importing resources. A separate tool that can manage the orchestration steps would be a better fit.

Blue/Green Deployments work with aws_db_instance because it is a single self-contained resource, whereas an Aurora cluster is made up of one aws_rds_cluster and at least one aws_rds_cluster_instance.

For more details, see #34551

@gdavison gdavison closed this Nov 25, 2023
Copy link

I'm going to lock this pull request 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 related to this change, 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 Dec 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS Aurora Blue/Green Update
5 participants