AWS Security ChangesHomeSearch

AWS AWSCloudFormation documentation change

Service: AWSCloudFormation · 2025-12-10 · Documentation low

File: AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-lifecyclehook.md

Summary

Reformatted JSON/YAML examples for AWS::AutoScaling::LifecycleHook resource documentation by condensing syntax and removing whitespace

Security assessment

The changes are purely structural formatting improvements to CloudFormation examples without modifying any security-related configurations (SecurityGroupIds, IAM roles, or access patterns remain unchanged). No vulnerabilities are addressed or security features added.

Diff

diff --git a/AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-lifecyclehook.md b/AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-lifecyclehook.md
index a54251e66..015d75bd8 100644
--- a//AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-lifecyclehook.md
+++ b//AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-lifecyclehook.md
@@ -195,73 +195,16 @@ The example bash script in the user data customizes the hostname on instances to
-    {
-        "AWSTemplateFormatVersion": "2010-09-09",
-        "Parameters": {
-            "LatestAmiId": {
-                "Description": "Region specific image from the Parameter Store",
-                "Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
-                "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
-            },
-            "InstanceType": {
-                "Description": "Amazon EC2 instance type for the instances",
-                "Type": "String",
-                "AllowedValues": [
-                    "t3.micro",
-                    "t3.small",
-                    "t3.medium"
-                ],
-                "Default": "t3.micro"
-            },
-            "Subnets": {
-                "Type": "CommaDelimitedList"
-            }
-        },
-        "Resources": {
-            "myAppLaunchTemplate": {
-                "Type": "AWS::EC2::LaunchTemplate",
-                "Properties": {
-                    "LaunchTemplateName": { "Fn::Sub": "${AWS::StackName}-launch-template" },
-                    "LaunchTemplateData": {
-                        "ImageId": { "Ref": "LatestAmiId" },
-                        "InstanceType": { "Ref": "InstanceType" },
-                        "KeyName": "MyKeyPair",
-                        "SecurityGroupIds": [  "sg-083cd3bfb8example" ],
-                        "UserData": {"Fn::Base64": {"Fn::Join": [ "", [
-                          "#!/usr/bin/env bash\n",
-                          "set -e\n",
-                          "export INSTANCE_ID=$(curl -sLf http://169.254.169.254/latest/meta-data/instance-id)", "\n",
-                          "export NEW_HOSTNAME=\"${LaunchTemplateName}-$INSTANCE_ID\"", "\n",
-                          "hostname $NEW_HOSTNAME", "\n"
-                        ]]}}
-                    }
-                }
-            },
-            "myASG": {
-                "Type": "AWS::AutoScaling::AutoScalingGroup",
-                "Properties": {
-                    "LaunchTemplate": {
-                        "LaunchTemplateId": {
-                            "Ref": "myAppLaunchTemplate"
-                        },
-                        "Version": {
-                            "Fn::GetAtt": [
-                                "myAppLaunchTemplate",
-                                "DefaultVersionNumber"
-                            ]
-                        }
-                    },
-                    "MaxSize": 10,
-                    "MinSize": 1,
-                    "VPCZoneIdentifier": {
-                        "Ref": "Subnets"
-                    },
-                    "LifecycleHookSpecificationList": [
-                        {
-                            "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING",
-                            "LifecycleHookName": "myLaunchLifecycleHook",
-                            "DefaultResult": "CONTINUE",
-                            "HeartbeatTimeout": 60
-                        }
-                    ]
-                }
-            }
-        }
-    }
+    { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": { "LatestAmiId": { "Description":
+        "Region specific image from the Parameter Store", "Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
+        "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2" }, "InstanceType": { "Description":
+        "Amazon EC2 instance type for the instances", "Type": "String", "AllowedValues": [ "t3.micro", "t3.small",
+        "t3.medium" ], "Default": "t3.micro" }, "Subnets": { "Type": "CommaDelimitedList" } }, "Resources": {
+        "myAppLaunchTemplate": { "Type": "AWS::EC2::LaunchTemplate", "Properties": { "LaunchTemplateName": { "Fn::Sub":
+        "${AWS::StackName}-launch-template" }, "LaunchTemplateData": { "ImageId": { "Ref": "LatestAmiId" }, "InstanceType":
+        { "Ref": "InstanceType" }, "KeyName": "MyKeyPair", "SecurityGroupIds": [ "sg-083cd3bfb8example" ], "UserData":
+        {"Fn::Base64": {"Fn::Join": [ "", [ "#!/usr/bin/env bash\n", "set -e\n", "export INSTANCE_ID=$(curl -sLf
+        http://169.254.169.254/latest/meta-data/instance-id)", "\n", "export
+        NEW_HOSTNAME=\"${LaunchTemplateName}-$INSTANCE_ID\"", "\n", "hostname $NEW_HOSTNAME", "\n" ]]}} } } }, "myASG": {
+        "Type": "AWS::AutoScaling::AutoScalingGroup", "Properties": { "LaunchTemplate": { "LaunchTemplateId": { "Ref":
+        "myAppLaunchTemplate" }, "Version": { "Fn::GetAtt": [ "myAppLaunchTemplate", "DefaultVersionNumber" ] } },
+        "MaxSize": 10, "MinSize": 1, "VPCZoneIdentifier": { "Ref": "Subnets" }, "LifecycleHookSpecificationList": [ {
+        "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING", "LifecycleHookName": "myLaunchLifecycleHook",
+        "DefaultResult": "CONTINUE", "HeartbeatTimeout": 60 } ] } } } }
@@ -272,48 +215,13 @@ The example bash script in the user data customizes the hostname on instances to
-    AWSTemplateFormatVersion: 2010-09-09
-    Parameters:
-      LatestAmiId:
-        Description: Region specific image from the Parameter Store
-        Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
-        Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'
-      InstanceType:
-        Description: Amazon EC2 instance type for the instances
-        Type: String
-        AllowedValues:
-          - t3.micro
-          - t3.small
-          - t3.medium
-        Default: t3.micro
-      Subnets:
-        Type: CommaDelimitedList
-    Resources:
-      myAppLaunchTemplate:
-        Type: AWS::EC2::LaunchTemplate
-        Properties:
-          LaunchTemplateName: !Sub ${AWS::StackName}-launch-template
-          LaunchTemplateData:
-            ImageId: !Ref LatestAmiId
-            InstanceType: !Ref InstanceType
-            KeyName: MyKeyPair
-            SecurityGroupIds:
-              - sg-083cd3bfb8example
-            UserData:
-              Fn::Base64: !Sub |
-                #!/usr/bin/env bash
-                set -e
-                export INSTANCE_ID=$(curl -sLf http://169.254.169.254/latest/meta-data/instance-id)
-                export NEW_HOSTNAME="${LaunchTemplateName}-$INSTANCE_ID"
-                hostname $NEW_HOSTNAME
-      myASG:
-        Type: AWS::AutoScaling::AutoScalingGroup
-        Properties:
-          LaunchTemplate:
-            LaunchTemplateId: !Ref myAppLaunchTemplate
-            Version: !GetAtt myAppLaunchTemplate.DefaultVersionNumber
-          MaxSize: '10'
-          MinSize: '1'
-          VPCZoneIdentifier: !Ref Subnets
-          LifecycleHookSpecificationList:
-            - LifecycleTransition: autoscaling:EC2_INSTANCE_LAUNCHING
-              LifecycleHookName: myLaunchLifecycleHook
-              DefaultResult: CONTINUE
-              HeartbeatTimeout: '60'
+    AWSTemplateFormatVersion: 2010-09-09 Parameters: LatestAmiId: Description: Region specific
+        image from the Parameter Store Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>' Default:
+        '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2' InstanceType: Description: Amazon EC2 instance type
+        for the instances Type: String AllowedValues: - t3.micro - t3.small - t3.medium Default: t3.micro Subnets: Type:
+        CommaDelimitedList Resources: myAppLaunchTemplate: Type: AWS::EC2::LaunchTemplate Properties: LaunchTemplateName:
+        !Sub ${AWS::StackName}-launch-template LaunchTemplateData: ImageId: !Ref LatestAmiId InstanceType: !Ref InstanceType
+        KeyName: MyKeyPair SecurityGroupIds: - sg-083cd3bfb8example UserData: Fn::Base64: !Sub | #!/usr/bin/env bash set -e
+        export INSTANCE_ID=$(curl -sLf http://169.254.169.254/latest/meta-data/instance-id) export
+        NEW_HOSTNAME="${LaunchTemplateName}-$INSTANCE_ID" hostname $NEW_HOSTNAME myASG: Type:
+        AWS::AutoScaling::AutoScalingGroup Properties: LaunchTemplate: LaunchTemplateId: !Ref myAppLaunchTemplate Version:
+        !GetAtt myAppLaunchTemplate.DefaultVersionNumber MaxSize: '10' MinSize: '1' VPCZoneIdentifier: !Ref Subnets
+        LifecycleHookSpecificationList: - LifecycleTransition: autoscaling:EC2_INSTANCE_LAUNCHING LifecycleHookName:
+        myLaunchLifecycleHook DefaultResult: CONTINUE HeartbeatTimeout: '60'
@@ -330,14 +238,3 @@ This snippet does not include the notification target that would need to exist o
-    {
-      "myTerminationLifecycleHook":{
-        "Type":"AWS::AutoScaling::LifecycleHook",
-        "Properties":{
-          "AutoScalingGroupName":{
-            "Ref":"myASG"
-          },
-          "LifecycleTransition":"autoscaling:EC2_INSTANCE_TERMINATING",
-          "HeartbeatTimeout": 300,
-          "DefaultResult": "CONTINUE",
-          "NotificationMetadata": "optional metadata"
-        }
-      }
-    }
+    { "myTerminationLifecycleHook":{ "Type":"AWS::AutoScaling::LifecycleHook", "Properties":{
+        "AutoScalingGroupName":{ "Ref":"myASG" }, "LifecycleTransition":"autoscaling:EC2_INSTANCE_TERMINATING",
+        "HeartbeatTimeout": 300, "DefaultResult": "CONTINUE", "NotificationMetadata": "optional metadata" } } }
@@ -348,9 +245,3 @@ This snippet does not include the notification target that would need to exist o
-    ---
-    myTerminationLifecycleHook: 
-      Type: AWS::AutoScaling::LifecycleHook
-      Properties: 
-        AutoScalingGroupName: !Ref myASG
-        LifecycleTransition: autoscaling:EC2_INSTANCE_TERMINATING
-        HeartbeatTimeout: '300'
-        DefaultResult: CONTINUE
-        NotificationMetadata: optional metadata
+    --- myTerminationLifecycleHook: Type: AWS::AutoScaling::LifecycleHook Properties:
+        AutoScalingGroupName: !Ref myASG LifecycleTransition: autoscaling:EC2_INSTANCE_TERMINATING HeartbeatTimeout: '300'
+        DefaultResult: CONTINUE NotificationMetadata: optional metadata
@@ -367,56 +258,8 @@ This snippet does not include the Amazon SQS queue and IAM role resources that w
-    {
-      "AWSTemplateFormatVersion":"2010-09-09",
-      "Parameters":{
-        "Subnets":{
-          "Type":"CommaDelimitedList"
-        }
-      },
-      "Resources":{
-        "myASG":{
-          "Type":"AWS::AutoScaling::AutoScalingGroup",
-          "Properties":{
-            "MaxSize":"3",