Repository: getmoto/moto
Pull request #7544 (2024-04-01 06:08:27)

chore: update Config Managed Rules
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action


Patch:
diff --git a/moto/autoscaling/models.py b/moto/autoscaling/models.py
index 5f22a7727..0a0ca2313 100644
--- a/moto/autoscaling/models.py
+++ b/moto/autoscaling/models.py
@@ -437,7 +437,7 @@ class FakeAutoScalingGroup(CloudFormationModel):
         autoscaling_backend: "AutoScalingBackend",
         ec2_backend: EC2Backend,
         tags: List[Dict[str, str]],
-        mixed_instance_policy: Optional[Dict[str, Any]],
+        mixed_instances_policy: Optional[Dict[str, Any]],
         capacity_rebalance: bool,
         new_instances_protected_from_scale_in: bool = False,
         created_time: datetime = datetime.now(),
@@ -460,9 +460,9 @@ class FakeAutoScalingGroup(CloudFormationModel):
         self.launch_config = None
 
         self._set_launch_configuration(
-            launch_config_name, launch_template, mixed_instance_policy
+            launch_config_name, launch_template, mixed_instances_policy
         )
-        self.mixed_instance_policy = mixed_instance_policy
+        self.mixed_instances_policy = mixed_instances_policy
 
         self.default_cooldown = (
             default_cooldown if default_cooldown else DEFAULT_COOLDOWN
@@ -547,7 +547,7 @@ class FakeAutoScalingGroup(CloudFormationModel):
         self,
         launch_config_name: str,
         launch_template: Dict[str, Any],
-        mixed_instance_policy: Optional[Dict[str, Any]],
+        mixed_instances_policy: Optional[Dict[str, Any]],
     ) -> None:
         if launch_config_name:
             self.launch_config = self.autoscaling_backend.launch_configurations[
@@ -555,7 +555,7 @@ class FakeAutoScalingGroup(CloudFormationModel):
             ]
             self.launch_config_name = launch_config_name
 
-        if launch_template or mixed_instance_policy:
+        if launch_template or mixed_instances_policy:
             if launch_template:
                 launch_template_id = launch_template.get("launch_template_id")
                 launch_template_name = launch_template.get("launch_template_name")
@@ -566,8 +566,8 @@ class FakeAutoScalingGroup(CloudFormationModel):
                     launch_template.get("version") or "$Default"
                 )
                 self.provided_launch_template_version = launch_template.get("version")
-            elif mixed_instance_policy:
-                spec = mixed_instance_policy["LaunchTemplate"][
+            elif mixed_instances_policy:
+                spec = mixed_instances_policy["LaunchTemplate"][
                     "LaunchTemplateSpecification"
                 ]
                 launch_template_id = spec.get("LaunchTemplateId")
@@ -617,6 +617,7 @@ class FakeAutoScalingGroup(CloudFormationModel):
         }
         load_balancer_names = properties.get("LoadBalancerNames", [])
         target_group_arns = properties.get("TargetGroupARNs", [])
+        mixed_instances_policy = properties.get("MixedInstancesPolicy", {})
 
         backend = autoscaling_backends[account_id][region_name]
         group = backend.create_auto_scaling_group(
@@ -643,6 +644,7 @@ class FakeAutoScalingGroup(CloudFormationModel):
             new_instances_protected_from_scale_in=properties.get(
                 "NewInstancesProtectedFromScaleIn", False
             ),
+            mixed_instances_policy=mixed_instances_policy,
         )
         return group
 
@@ -743,7 +745,7 @@ class FakeAutoScalingGroup(CloudFormationModel):
                 desired_capacity = max_size
 
         self._set_launch_configuration(
-            launch_config_name, launch_template, mixed_instance_policy=None
+            launch_config_name, launch_template, mixed_instances_policy=None
         )
 
         if health_check_period is not None:
@@ -1082,7 +1084,7 @@ class AutoScalingBackend(BaseBackend):
         capacity_rebalance: bool = False,
         new_instances_protected_from_scale_in: bool = False,
         instance_id: Optional[str] = None,
-        mixed_instance_policy: Optional[Dict[str, Any]] = None,
+        mixed_instances_policy: Optional[Dict[str, Any]] = None,
     ) -> FakeAutoScalingGroup:
         max_size = make_int(max_size)
         min_size = make_int(min_size)
@@ -1094,7 +1096,7 @@ class AutoScalingBackend(BaseBackend):
             launch_config_name,
             launch_template,
             instance_id,
-            mixed_instance_policy,
+            mixed_instances_policy,
         ]
         num_params = sum([1 for param in params if param])
 
@@ -1134,7 +1136,7 @@ class AutoScalingBackend(BaseBackend):
             ec2_backend=self.ec2_backend,
             tags=tags,
             new_instances_protected_from_scale_in=new_instances_protected_from_scale_in,
-            mixed_instance_policy=mixed_instance_policy,
+            mixed_instances_policy=mixed_instances_policy,
             capacity_rebalance=capacity_rebalance,
         )
 
diff --git a/moto/autoscaling/responses.py b/moto/autoscaling/responses.py
index 23a1ab1f9..a4d3ea360 100644
--- a/moto/autoscaling/responses.py
+++ b/moto/autoscaling/responses.py
@@ -90,7 +90,7 @@ class AutoScalingResponse(BaseResponse):
             instance_id=self._get_param("InstanceId"),
             launch_config_name=self._get_param("LaunchConfigurationName"),
             launch_template=self._get_dict_param("LaunchTemplate."),
-            mixed_instance_policy=params.get("MixedInstancesPolicy"),
+            mixed_instances_policy=params.get("MixedInstancesPolicy"),
             vpc_zone_identifier=self._get_param("VPCZoneIdentifier"),
             default_cooldown=self._get_int_param("DefaultCooldown"),
             health_check_period=self._get_int_param("HealthCheckGracePeriod"),
@@ -836,7 +836,7 @@ DESCRIBE_AUTOSCALING_GROUPS_TEMPLATE = """<DescribeAutoScalingGroupsResponse xml
         <CreatedTime>{{ group.created_time }}</CreatedTime>
         {% if group.launch_config_name %}
         <LaunchConfigurationName>{{ group.launch_config_name }}</LaunchConfigurationName>
-        {% elif group.mixed_instance_policy %}
+        {% elif group.mixed_instances_policy %}
         <MixedInstancesPolicy>
           <LaunchTemplate>
             <LaunchTemplateSpecification>
@@ -844,9 +844,9 @@ DESCRIBE_AUTOSCALING_GROUPS_TEMPLATE = """<DescribeAutoScalingGroupsResponse xml
               <Version>{{ group.launch_template_version }}</Version>
               <LaunchTemplateName>{{ group.launch_template.name }}</LaunchTemplateName>
             </LaunchTemplateSpecification>
-            {% if group.mixed_instance_policy.get("LaunchTemplate", {}).get("Overrides", []) %}
+            {% if group.mixed_instances_policy.get("LaunchTemplate", {}).get("Overrides", []) %}
             <Overrides>
-              {% for member in group.mixed_instance_policy.get("LaunchTemplate", {}).get("Overrides", []) %}
+              {% for member in group.mixed_instances_policy.get("LaunchTemplate", {}).get("Overrides", []) %}
               <member>
                 {% if member.get("InstanceType") %}
                 <InstanceType>{{ member.get("InstanceType") }}</InstanceType>
@@ -859,25 +859,25 @@ DESCRIBE_AUTOSCALING_GROUPS_TEMPLATE = """<DescribeAutoScalingGroupsResponse xml
             </Overrides>
             {% endif %}
           </LaunchTemplate>
-          {% if group.mixed_instance_policy.get("InstancesDistribution") %}
+          {% if group.mixed_instances_policy.get("InstancesDistribution") %}
           <InstancesDistribution>
-            {% if group.mixed_instance_policy.get("InstancesDistribution").get("OnDemandAllocationStrategy") %}
-            <OnDemandAllocationStrategy>{{ group.mixed_instance_policy.get("InstancesDistribution").get("OnDemandAllocationStrategy") }}</OnDemandAllocationStrategy>
+            {% if group.mixed_instances_policy.get("InstancesDistribution").get("OnDemandAllocationStrategy") %}
+            <OnDemandAllocationStrategy>{{ group.mixed_instances_policy.get("InstancesDistribution").get("OnDemandAllocationStrategy") }}</OnDemandAllocationStrategy>
             {% endif %}
-            {% if group.mixed_instance_policy.get("InstancesDistribution").get("OnDemandBaseCapacity") %}
-            <OnDemandBaseCapacity>{{ group.mixed_instance_policy.get("InstancesDistribution").get("OnDemandBaseCapacity") }}</OnDemandBaseCapacity>
+            {% if group.mixed_instances_policy.get("InstancesDistribution").get("OnDemandBaseCapacity") %}
+            <OnDemandBaseCapacity>{{ group.mixed_instances_policy.get("InstancesDistribution").get("OnDemandBaseCapacity") }}</OnDemandBaseCapacity>
             {% endif %}
-            {% if group.mixed_instance_policy.get("InstancesDistribution").get("OnDemandPercentageAboveBaseCapacity") %}
-            <OnDemandPercentageAboveBaseCapacity>{{ group.mixed_instance_policy.get("InstancesDistribution").get("OnDemandPercentageAboveBaseCapacity") }}</OnDemandPercentageAboveBaseCapacity>
+            {% if group.mixed_instances_policy.get("InstancesDistribution").get("OnDemandPercentageAboveBaseCapacity") %}
+            <OnDemandPercentageAboveBaseCapacity>{{ group.mixed_instances_policy.get("InstancesDistribution").get("OnDemandPercentageAboveBaseCapacity") }}</OnDemandPercentageAboveBaseCapacity>
             {% endif %}
-            {% if group.mixed_instance_policy.get("InstancesDistribution").get("SpotAllocationStrategy") %}
-            <SpotAllocationStrategy>{{ group.mixed_instance_policy.get("InstancesDistribution").get("SpotAllocationStrategy") }}</SpotAllocationStrategy>
+            {% if group.mixed_instances_policy.get("InstancesDistribution").get("SpotAllocationStrategy") %}
+            <SpotAllocationStrategy>{{ group.mixed_instances_policy.get("InstancesDistribution").get("SpotAllocationStrategy") }}</SpotAllocationStrategy>
             {% endif %}
-            {% if group.mixed_instance_policy.get("InstancesDistribution").get("SpotInstancePools") %}
-            <SpotInstancePools>{{ group.mixed_instance_policy.get("InstancesDistribution").get("SpotInstancePools") }}</SpotInstancePools>
+            {% if group.mixed_instances_policy.get("InstancesDistribution").get("SpotInstancePools") %}
+            <SpotInstancePools>{{ group.mixed_instances_policy.get("InstancesDistribution").get("SpotInstancePools") }}</SpotInstancePools>
             {% endif %}
-            {% if group.mixed_instance_policy.get("InstancesDistribution").get("SpotMaxPrice") %}
-            <SpotMaxPrice>{{ group.mixed_instance_policy.get("InstancesDistribution").get("SpotMaxPrice") }}</SpotMaxPrice>
+            {% if group.mixed_instances_policy.get("InstancesDistribution").get("SpotMaxPrice") %}
+            <SpotMaxPrice>{{ group.mixed_instances_policy.get("InstancesDistribution").get("SpotMaxPrice") }}</SpotMaxPrice>
             {% endif %}
           </InstancesDistribution>
           {% endif %}
diff --git a/moto/config/resources/aws_managed_rules.json b/moto/config/resources/aws_managed_rules.json
index 5de7c0849..ef2c06d8f 100644
--- a/moto/config/resources/aws_managed_rules.json
+++ b/moto/config/resources/aws_managed_rules.json
@@ -1945,6 +1945,12 @@
       "Resource Types": "AWS::EFS::FileSystem",
       "Trigger type": "Periodic"
     },
+    "EFS_MOUNT_TARGET_PUBLIC_ACCESSIBLE": {
+      "AWS Region": "All supported AWS regions except China (Beijing), Israel (Tel Aviv), China (Ningxia) Region",
+      "Parameters": [],
+      "Resource Types": "AWS::EFS::FileSystem",
+      "Trigger type": "Periodic"
+    },
     "EFS_RESOURCES_PROTECTED_BY_BACKUP_PLAN": {
       "AWS Region": "All supported AWS regions except China (Beijing), Asia Pacific (Jakarta), Middle East (UAE), Asia Pacific (Hyderabad), Asia Pacific (Osaka), Asia Pacific (Melbourne), Israel (Tel Aviv), Europe (Spain), China (Ningxia), Europe (Zurich) Region",
       "Parameters": [
diff --git a/moto/ec2/resources/instance_types.json b/moto/ec2/resources/instance_types.json
index 1182e67a1..6dabc14a5 100644
--- a/moto/ec2/resources/instance_types.json
+++ b/moto/ec2/resources/instance_types.json
@@ -17560,6 +17560,92 @@
    "DefaultVCpus": 1
   }
  },
+ "c7gn.metal": {
+  "AutoRecoverySupported": true,
+  "BareMetal": true,
+  "BurstablePerformanceSupported": false,
+  "CurrentGeneration": true,
+  "DedicatedHostsSupported": true,
+  "EbsInfo": {
+   "EbsOptimizedInfo": {
+    "BaselineBandwidthInMbps": 33333,
+    "BaselineIops": 133333,
+    "BaselineThroughputInMBps": 4166.625,
+    "MaximumBandwidthInMbps": 40000,
+    "MaximumIops": 160000,
+    "MaximumThroughputInMBps": 5000.0
+   },
+   "EbsOptimizedSupport": "default",
+   "EncryptionSupport": "supported",
+   "NvmeSupport": "required"
+  },
+  "FreeTierEligible": false,
+  "HibernationSupported": false,
+  "InstanceStorageSupported": false,
+  "InstanceType": "c7gn.metal",
+  "MemoryInfo": {
+   "SizeInMiB": 131072
+  },
+  "NetworkInfo": {
+   "DefaultNetworkCardIndex": 0,
+   "EfaInfo": {
+    "MaximumEfaInterfaces": 1
+   },
+   "EfaSupported": true,
+   "EnaSrdSupported": false,
+   "EnaSupport": "required",
+   "EncryptionInTransitSupported": true,
+   "Ipv4AddressesPerInterface": 50,
+   "Ipv6AddressesPerInterface": 50,
+   "Ipv6Supported": true,
+   "MaximumNetworkCards": 1,
+   "MaximumNetworkInterfaces": 15,
+   "NetworkCards": [
+    {
+     "BaselineBandwidthInGbps": 200.0,
+     "MaximumNetworkInterfaces": 15,
+     "NetworkCardIndex": 0,
+     "NetworkPerformance": "200 Gigabit",
+     "PeakBandwidthInGbps": 200.0
+    }
+   ],
+   "NetworkPerformance": "200 Gigabit"
+  },
+  "NitroEnclavesSupport": "unsupported",
+  "NitroTpmSupport": "unsupported",
+  "PlacementGroupInfo": {
+   "SupportedStrategies": [
+    "cluster",
+    "partition",
+    "spread"
+   ]
+  },
+  "ProcessorInfo": {
+   "Manufacturer": "AWS",
+   "SupportedArchitectures": [
+    "arm64"
+   ],
+   "SustainedClockSpeedInGhz": 2.6
+  },
+  "SupportedBootModes": [
+   "uefi"
+  ],
+  "SupportedRootDeviceTypes": [
+   "ebs"
+  ],
+  "SupportedUsageClasses": [
+   "on-demand",
+   "spot"
+  ],
+  "SupportedVirtualizationTypes": [
+   "hvm"
+  ],
+  "VCpuInfo": {
+   "DefaultCores": 64,
+   "DefaultThreadsPerCore": 1,
+   "DefaultVCpus": 64
+  }
+ },
  "c7gn.xlarge": {
   "AutoRecoverySupported": true,
   "BareMetal": false,


Test patch:
diff --git a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py
index 85ef41929..46b22946c 100644
--- a/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py
+++ b/tests/test_cloudformation/test_cloudformation_stack_crud_boto3.py
@@ -341,9 +341,21 @@ dummy_template_launch_template = {
             "Type": "AWS::AutoScaling::AutoScalingGroup",
             "Properties": {
                 "VPCZoneIdentifier": {"Ref": "Subnets"},
-                "LaunchTemplate": {
-                    "LaunchTemplateId": {"Ref": "TestLaunchTemplate"},
-                    "Version": "$DEFAULT",
+                "MixedInstancesPolicy": {
+                    "InstancesDistribution": {
+                        "OnDemandAllocationStrategy": "string",
+                        "OnDemandBaseCapacity": 123,
+                        "OnDemandPercentageAboveBaseCapacity": 123,
+                        "SpotAllocationStrategy": "string",
+                        "SpotInstancePools": 123,
+                        "SpotMaxPrice": "string",
+                    },
+                    "LaunchTemplate": {
+                        "LaunchTemplateSpecification": {
+                            "LaunchTemplateId": {"Ref": "TestLaunchTemplate"},
+                            "Version": "$DEFAULT",
+                        }
+                    },
                 },
                 "CapacityRebalance": True,
                 "MinSize": "1",