Repository: getmoto/moto

Issue:
CloudFormation autoscaling group PropagateAtLaunch not setting properly
When creating a CloudFormation autoscaling group, PropagateAtLaunch for tags is being reported as 'False' even though it was set to 'True' in the template


Discussion:
I can also work on this

Resolving patch:
diff --git a/moto/autoscaling/models.py b/moto/autoscaling/models.py
--- a/moto/autoscaling/models.py
+++ b/moto/autoscaling/models.py
@@ -301,6 +301,14 @@ def _set_azs_and_vpcs(self, availability_zones, vpc_zone_identifier, update=Fals
         self.availability_zones = availability_zones
         self.vpc_zone_identifier = vpc_zone_identifier
 
+    @staticmethod
+    def __set_string_propagate_at_launch_booleans_on_tags(tags):
+        bool_to_string = {True: "true", False: "false"}
+        for tag in tags:
+            if "PropagateAtLaunch" in tag:
+                tag["PropagateAtLaunch"] = bool_to_string[tag["PropagateAtLaunch"]]
+        return tags
+
     @classmethod
     def create_from_cloudformation_json(
         cls, resource_name, cloudformation_json, region_name
@@ -329,7 +337,9 @@ def create_from_cloudformation_json(
             target_group_arns=target_group_arns,
             placement_group=None,
             termination_policies=properties.get("TerminationPolicies", []),
-            tags=properties.get("Tags", []),
+            tags=cls.__set_string_propagate_at_launch_booleans_on_tags(
+                properties.get("Tags", [])
+            ),
             new_instances_protected_from_scale_in=properties.get(
                 "NewInstancesProtectedFromScaleIn", False
             ),
@@ -455,7 +465,7 @@ def get_propagated_tags(self):
             # boto3 and cloudformation use PropagateAtLaunch
             if "propagate_at_launch" in tag and tag["propagate_at_launch"] == "true":
                 propagated_tags[tag["key"]] = tag["value"]
-            if "PropagateAtLaunch" in tag and tag["PropagateAtLaunch"]:
+            if "PropagateAtLaunch" in tag and tag["PropagateAtLaunch"] == "true":
                 propagated_tags[tag["Key"]] = tag["Value"]
         return propagated_tags
 


Test patch:
diff --git a/tests/test_cloudformation/test_cloudformation_stack_integration.py b/tests/test_cloudformation/test_cloudformation_stack_integration.py
--- a/tests/test_cloudformation/test_cloudformation_stack_integration.py
+++ b/tests/test_cloudformation/test_cloudformation_stack_integration.py
@@ -21,6 +21,7 @@
 
 from moto import (
     mock_autoscaling_deprecated,
+    mock_autoscaling,
     mock_cloudformation,
     mock_cloudformation_deprecated,
     mock_datapipeline_deprecated,
@@ -2496,3 +2497,57 @@ def test_stack_events_create_rule_as_target():
 
     log_groups["logGroups"][0]["logGroupName"].should.equal(rules["Rules"][0]["Arn"])
     log_groups["logGroups"][0]["retentionInDays"].should.equal(3)
+
+
+@mock_cloudformation
+@mock_autoscaling
+def test_autoscaling_propagate_tags():
+    autoscaling_group_with_tags = {
+        "AWSTemplateFormatVersion": "2010-09-09",
+        "Resources": {
+            "AutoScalingGroup": {
+                "Type": "AWS::AutoScaling::AutoScalingGroup",
+                "Properties": {
+                    "AutoScalingGroupName": "test-scaling-group",
+                    "DesiredCapacity": 1,
+                    "MinSize": 1,
+                    "MaxSize": 50,
+                    "LaunchConfigurationName": "test-launch-config",
+                    "AvailabilityZones": ["us-east-1a"],
+                    "Tags": [
+                        {
+                            "Key": "test-key-propagate",
+                            "Value": "test",
+                            "PropagateAtLaunch": True,
+                        },
+                        {
+                            "Key": "test-key-no-propagate",
+                            "Value": "test",
+                            "PropagateAtLaunch": False,
+                        },
+                    ],
+                },
+                "DependsOn": "LaunchConfig",
+            },
+            "LaunchConfig": {
+                "Type": "AWS::AutoScaling::LaunchConfiguration",
+                "Properties": {"LaunchConfigurationName": "test-launch-config"},
+            },
+        },
+    }
+    boto3.client("cloudformation", "us-east-1").create_stack(
+        StackName="propagate_tags_test",
+        TemplateBody=json.dumps(autoscaling_group_with_tags),
+    )
+
+    autoscaling = boto3.client("autoscaling", "us-east-1")
+
+    autoscaling_group_tags = autoscaling.describe_auto_scaling_groups()[
+        "AutoScalingGroups"
+    ][0]["Tags"]
+    propagation_dict = {
+        tag["Key"]: tag["PropagateAtLaunch"] for tag in autoscaling_group_tags
+    }
+
+    assert propagation_dict["test-key-propagate"]
+    assert not propagation_dict["test-key-no-propagate"]