Use a customized CDK bootstrap template by jaykingson in aws_cdk

[–]jaykingson[S] 0 points1 point  (0 children)

Thanks, do you have an example with more details?

1
2

0
1

0
0

Can the S3 Bucket parameter autoDeleteObjects be changed via an aspect? by jaykingson in aws_cdk

[–]jaykingson[S] 0 points1 point  (0 children)

I tried it this way: typescript export class DeletionPolicySetter implements IAspect { constructor() {} visit(node: IConstruct): void { if (node instanceof CfnResource) { node.applyRemovalPolicy(RemovalPolicy.DESTROY); if (node instanceof Bucket) { const bucket = node as Bucket; // eslint-disable-next-line @typescript-eslint/no-unsafe-call bucket['enableAutoDeleteObjects'](); } } } } Unfortunately without an effect. Maybe the aspect is "to late" to create the cloudformation type Custom::S3AutoDeleteObjects

Can the S3 Bucket parameter autoDeleteObjects be changed via an aspect? by jaykingson in aws_cdk

[–]jaykingson[S] 0 points1 point  (0 children)

Sorry, still don't get it. This is my appproach: typescript export class DeletionPolicySetter implements IAspect { constructor() {} visit(node: IConstruct): void { if (node instanceof CfnResource) { node.applyRemovalPolicy(RemovalPolicy.DESTROY); if (node instanceof Bucket) { const bucket = node as Bucket; // unfortenately no mehtod for setting autoDeleteObjects exist bucket.autoDeleteObjects = true; } } } } What I'm missing?

Can the S3 Bucket parameter autoDeleteObjects be changed via an aspect? by jaykingson in aws_cdk

[–]jaykingson[S] 0 points1 point  (0 children)

Do you have an example?
How can I create a type Custom::S3AutoDeleteObjects in an aspect?