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

fix(core): enableVersionUpgrade in CfnUpdatePolicy #6434

Merged
merged 2 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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