From 76214399ee136d4120ff1c9002f922ab3fb7777f Mon Sep 17 00:00:00 2001 From: Xia Zhao <78883180+xazhao@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:09:35 -0700 Subject: [PATCH] chore(ec2): make applyCloudFormationInit() function public (#30907) ### Issue # (if applicable) Closes #30863. ### Reason for this change The issue is asking to make the function `applyCloudFormationInit()` public from private. Also we have this function being public in https://github.com/aws/aws-cdk/blob/ffd9d9ce510a4c820b1437cce93c4772cd7c14c0/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts#L1650 ### Description of changes Make the function public ### Description of how you validated changes build passed ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-ec2/lib/instance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts index a8e184361d019..01aa0f18ab89e 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance.ts @@ -630,7 +630,7 @@ export class Instance extends Resource implements IInstance { * - Add commands to the instance UserData to run `cfn-init` and `cfn-signal`. * - Update the instance's CreationPolicy to wait for the `cfn-signal` commands. */ - private applyCloudFormationInit(init: CloudFormationInit, options: ApplyCloudFormationInitOptions = {}) { + public applyCloudFormationInit(init: CloudFormationInit, options: ApplyCloudFormationInitOptions = {}) { init.attach(this.instance, { platform: this.osType, instanceRole: this.role,