terraform-provider-aws icon indicating copy to clipboard operation
terraform-provider-aws copied to clipboard

AWS OpenSearch terraform provider should notice in the planning phase when a blue-green deployment is required

Open barthel opened this issue 3 years ago • 4 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

AWS provides a API to determine whether a change will cause a OpenSearch domain blue/green deployment. https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-configuration-changes.html#dryrun

The AWS OpenSearch terraform provider should notice in the planning phase when a blue-green deployment is required.

New or Affected Resource(s)

  • aws_elasticsearch_domain
  • aws_opensearch_domain

Potential Terraform Configuration

References

  • https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-configuration-changes.html

barthel avatar Sep 13 '22 10:09 barthel

Out of interest, what should the provider do when a blue/green deployment is required? Or should this be user configurable, i.e. something like this:

resource "aws_elasticsearch_domain" "example" {
  domain_name           = "example"
  elasticsearch_version = "7.10"

  cluster_config {
    instance_type = "r4.large.elasticsearch"
  }

  allowed_deployment_types = ["Blue/Green", "DynamicUpdate"]

  tags = {
    Domain = "TestDomain"
  }
}

And then, by omitting "Blue/Green" from that list of allowed_deployment_types the provider will error instead of proceeding with the update. If that is your desired behaviour, then can I ask why? Are blue/green deployments causing you particular issues, and if so what are those?

mattburgess avatar Sep 13 '22 19:09 mattburgess

Just a hint should be enough for the first step to be aware of.

In the last weeks we had to realize that there were problems with the reconfiguration of our OpenSearch domain. As soon as a blue-green deployment becomes necessary, it is a matter of luck whether the deployment works or not.

The problem is that it was/is difficult to get the required instances of the desired instance type made available by AWS in our region.

barthel avatar Sep 14 '22 05:09 barthel

A very interesting addition could be the verification of offered instance types in the planning phase, as soon as a blue-green deployment becomes necessary.

And if currently no instances can be provided by AWS, then the provider could exit with an error instead of performing the update.

As it is already implemented for the EC2 instances: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ec2_instance_type_offering

barthel avatar Sep 14 '22 06:09 barthel

No traction on this issue yet, having IAC to trigger blue/green is very much a necessity instead of the replace resource if the cloud provider supports it.

amareshb avatar Aug 28 '24 20:08 amareshb