Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/@aws-cdk/core/lib/cfn-resource-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ export interface CfnUpdatePolicy {
*/
readonly useOnlineResharding?: boolean;

/**
* To upgrade an Amazon ES domain to a new version of Elasticsearch rather than replacing the entire
* AWS::Elasticsearch::Domain resource, use the EnableVersionUpgrade update policy.
*/
readonly enableVersionUpgrade?: boolean;

}

/**
Expand Down
22 changes: 22 additions & 0 deletions packages/@aws-cdk/core/test/test.resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,28 @@ export = {

test.done();
},

'enableVersionUpgrade can be set on a resource'(test: Test) {
const stack = new Stack();
const r1 = new CfnResource(stack, 'Resource', { type: 'Type' });

r1.cfnOptions.updatePolicy = {
enableVersionUpgrade: true
};

test.deepEqual(toCloudFormation(stack), {
Resources: {
Resource: {
Type: 'Type',
UpdatePolicy: {
EnableVersionUpgrade: true
}
}
}
});

test.done();
},
};

interface CounterProps {
Expand Down