To allow CloudFormation to perform an in-place upgrade, set EnableVersionUpgrade to true and set ElasticsearchVersion to the value of your version.
-or-
To replace the AWS::Elasticsearch::Domain resource with a new AWS::Elasticsearch::Domain resource, set EnableVersionUpgrade to False, or don't specify any value.
For example, the UpdatePolicy attribute is configured for an in-place upgrade in the following template:
>AWSTemplateFormatVersion: 2010-09-09
Description: AWS CloudFormation sample template to launch an Amazon OpenSearch Service Domain. Performing an update using the same template and supplying a different ElasticsearchVersion will perform an in-place upgrade for an Elasticsearch Domain resource.
Parameters:
ElasticsearchVersion:
Type: String
AllowedValues: ['5.6', '5.5', '5.3', '5.1', '6.8', '6.7', '6.5', '6.4', '6.3', '6.2', '6.0', '7.4', '7.1']
Default: 5.3
Description: The version of Amazon OpenSearch Service to use.
InstanceTypeForDataNode:
Type: String
Default: m3.medium.elasticsearch
Description: The instance type for your data nodes.
NumberOfDataNodes:
Type: String
Default: 1
Description: The number of data nodes (instances) to use in the OpenSearch Service domain.
Resources:
ElasticSearchDomain:
Type: AWS::Elasticsearch::Domain
UpdatePolicy:
EnableVersionUpgrade: true ### In-place Upgrade
Properties:
ElasticsearchClusterConfig:
InstanceCount: !Ref NumberOfDataNodes
InstanceType: !Ref InstanceTypeForDataNode
ElasticsearchVersion: !Ref ElasticsearchVersion