Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Elasticsearch domain deployed through CloudFormation. How to update ES version without replacement?

We have an AWS Elasticsearch domain we created through CloudFormation running version 6.3 of ES. When we update the ElasticsearchVersion property in the template, it replaces the Elasticsearch domain with a new one running the new version instead of updating the existing one.

How does anyone upgrade their Elasticsearch domains that were deployed with CF if it doesn't do an in-place upgrade? I am almost thinking at this point I need to create and manage my ES domains through boto3.

Any insight or ideas would be greatly appreciated.

like image 632
seemach1 Avatar asked Mar 02 '19 13:03

seemach1


People also ask

Can CloudFormation update existing resource?

Update with No Interruption. AWS CloudFormation updates the resource without disrupting operation of that resource and without changing the resource's physical ID. For example, if you update certain properties on an AWS::CloudTrail::Trail resource, AWS CloudFormation updates the trail without disruption.

How do I update an existing stack in AWS CloudFormation?

To update a AWS CloudFormation stack (console)In the AWS CloudFormation console , from the list of stacks, select the running stack that you want to update. In the stack details pane, choose Update. If you haven't modified the stack template, select Use current template, and then choose Next.

What are the two methods for updating an AWS CloudFormation stack?

AWS CloudFormation provides two methods for updating stacks: direct update or creating and executing change sets. When you directly update a stack, you submit changes and AWS CloudFormation immediately deploys them. Use direct updates when you want to quickly deploy your updates.


Video Answer


1 Answers

This is now possible (as of 25/11/2019) by setting an UpdatePolicy with EnableVersionUpgrade: True.

For example:

ElasticSearchDomain:
    Type: AWS::Elasticsearch::Domain
    Properties: ...
    UpdatePolicy:
        EnableVersionUpgrade: true

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-upgradeelasticsearchdomain

like image 200
Tom Dufall Avatar answered Sep 24 '22 06:09

Tom Dufall