Skip to content

Commit d61bd2c

Browse files
authoredJul 8, 2019
fix(core): UpdateReplacePolicy mirrors DeletionPolicy (#3217)
When setting the DeletionPolicy, the UpdateReplacePolicy should also be set. There's the same implication of data loss for one and the other. Fixes #2901.
1 parent 7d020f1 commit d61bd2c

File tree

89 files changed

+388
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+388
-165
lines changed
 

‎packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"Resources": {
33
"ArtifactBucket7410C9EF": {
44
"Type": "AWS::S3::Bucket",
5-
"DeletionPolicy": "Delete"
5+
"DeletionPolicy": "Delete",
6+
"UpdateReplacePolicy": "Delete"
67
},
78
"CodePipelineRoleB3A660B4": {
89
"Type": "AWS::IAM::Role",

‎packages/@aws-cdk/aws-apigateway/lib/deployment.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CfnDeletionPolicy, Construct, Lazy, Resource, Stack } from '@aws-cdk/core';
1+
import { Construct, Lazy, RemovalPolicy, Resource, Stack } from '@aws-cdk/core';
22
import crypto = require('crypto');
33
import { CfnDeployment, CfnDeploymentProps } from './apigateway.generated';
44
import { IRestApi } from './restapi';
@@ -72,7 +72,7 @@ export class Deployment extends Resource {
7272
});
7373

7474
if (props.retainDeployments) {
75-
this.resource.cfnOptions.deletionPolicy = CfnDeletionPolicy.RETAIN;
75+
this.resource.applyRemovalPolicy(RemovalPolicy.RETAIN);
7676
}
7777

7878
this.api = props.api;

0 commit comments

Comments
 (0)
Please sign in to comment.