Skip to content

Commit e150246

Browse files
committed
Fix removal policy on edge function
1 parent d84529a commit e150246

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

packages/microapps-cdk/API.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ Path prefix on the root of the CloudFront distribution.
885885

886886
### MicroAppsEdgeToOriginProps <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps"></a>
887887

888-
Properties to initialize an instance of `MicroAppsCF`.
888+
Properties to initialize an instance of `MicroAppsEdgeToOrigin`.
889889

890890
#### Initializer <a name="[object Object].Initializer"></a>
891891

@@ -943,8 +943,6 @@ Origin region that API Gateway will be deployed to, used for the config.yml on t
943943

944944
RemovalPolicy override for child resources.
945945

946-
Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true`
947-
948946
---
949947

950948
##### `replaceHostHeader`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps.replaceHostHeader"></a>

packages/microapps-cdk/src/MicroAppsEdgeToOrigin.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ export interface IMicroAppsEdgeToOrigin {
2727
}
2828

2929
/**
30-
* Properties to initialize an instance of `MicroAppsCF`.
30+
* Properties to initialize an instance of `MicroAppsEdgeToOrigin`.
3131
*/
3232
export interface MicroAppsEdgeToOriginProps {
3333
/**
3434
* RemovalPolicy override for child resources
3535
*
36-
* Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true`
37-
*
3836
* @default - per resource default
3937
*/
4038
readonly removalPolicy?: RemovalPolicy;
@@ -189,6 +187,7 @@ replaceHostHeader: ${props.replaceHostHeader}`;
189187
// },
190188
}),
191189
],
190+
...(removalPolicy ? { removalPolicy } : {}),
192191
};
193192
if (
194193
process.env.NODE_ENV === 'test' ||
@@ -263,10 +262,6 @@ replaceHostHeader: ${props.replaceHostHeader}`;
263262
},
264263
...edgeToOriginFuncProps,
265264
});
266-
267-
if (removalPolicy) {
268-
this._edgeToOriginFunction.applyRemovalPolicy(removalPolicy);
269-
}
270265
}
271266

272267
this._edgeToOriginLambdas = [

0 commit comments

Comments
 (0)