internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: aws-cloudformation/cfn-lint

Issue:
Unknown warning about unpublished metrics
*cfn-lint version: 0.55.0*

*Description of issue.*

`cfn-lint template.yaml` is outputting `There are unpublished metrics. Please make sure you call publish after you record all metrics.` where previous versions of `cfn-lint` did not. This is causing the Atom plugin to display a really intrusive error message on every save event.

Frustratingly, I can't find any information on what this message means


Discussion:
Could you try forcibly reinstalling and see if that helps?
[`pip3 install --upgrade --force-reinstall cfn-lint`](https://stackoverflow.com/questions/19548957/can-i-force-pip-to-reinstall-the-current-version)
Same here. 
@PatMyron I've tried your command, but warning still raising.
@PatMyron No, it's working, my apologies 👍 
@PatMyron I installed `cfn-lint` through Homebrew and have tried re-installing with no effect. I just tried doing it inside a Docker container as well:

```Dockerfile
FROM python
WORKDIR /var/task
RUN pip install cfn-lint
COPY template.yaml .
CMD [ "cfn-lint", "template.yaml" ]
```

```bash
docker build -t cfn-lint .
docker run --rm cfn-lint
# => There are unpublished metrics. Please make sure you call publish after you record all metrics.
```
Looks like this may have been introduced with a more recent version of sam-translator?

https://github.com/aws/serverless-application-model/blob/560cc8cae3753e044e7a297443fafba1925b8d79/samtranslator/metrics/metrics.py#L128

I'm seeing the LOG.warn on SAM templates now.
Well spotted @kddejong. Closing this issue and subscribing to the one you referenced. Cheers!

Resolving patch:
diff --git a/src/cfnlint/transform.py b/src/cfnlint/transform.py
--- a/src/cfnlint/transform.py
+++ b/src/cfnlint/transform.py
@@ -15,6 +15,8 @@
 from cfnlint.rules import Match, TransformError
 LOGGER = logging.getLogger('cfnlint')
 
+samtranslator_logger = logging.getLogger('samtranslator')
+samtranslator_logger.setLevel(logging.CRITICAL)
 
 class Transform(object):
     """


Test patch:
Repository: aws-cloudformation/cfn-lint

Issue:
E3002 Invalid Property Lambda/Properties/EphemeralStorage
*cfn-lint version: (`cfn-lint --version`)*

`cfn-lint 0.58.4`

*Description of issue.*
Looks like it does not yet recognize `EphemeralStorage` as a valid property for lambdas
```yml
Lambda:
    Type: AWS::Lambda::Function
    Properties:
      Role: !GetAtt Role.Arn
      Timeout: 600
      MemorySize: 2048
      EphemeralStorage:
        Size: 1024
```

Link to the [**docs**](https://aws.amazon.com/blogs/compute/using-larger-ephemeral-storage-for-aws-lambda/) where it shows the new feature

Cfn-lint uses the [CloudFormation Resource Specifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html) as the base to do validation. These files are included as part of the application version. Please update to the latest version of `cfn-lint` or update the spec files manually (`cfn-lint -u`)



Discussion:

Resolving patch:
diff --git a/src/cfnlint/version.py b/src/cfnlint/version.py
--- a/src/cfnlint/version.py
+++ b/src/cfnlint/version.py
@@ -3,4 +3,4 @@
 SPDX-License-Identifier: MIT-0
 """
 
-__version__ = '0.58.4'
+__version__ = '0.59.0'


Test patch:
Repository: aws-cloudformation/cfn-lint

Issue:
AWS Application Insights Tier  and Log values aren't accepting any valid values
*cfn-lint version: v0.58.4*

*Description of issue.*
AWS::ApplicationInsights::Application.ComponentMonitoringSetting.Tier
AWS::ApplicationInsights::Application.Log.LogType
These 2 property types are not accepting any valid values defined within regex.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-applicationinsights-application-log.html#cfn-applicationinsights-application-log-logtype

We see the regex details provided here
https://github.com/aws-cloudformation/cfn-lint/tree/main/src/cfnlint/data/CloudSpecs
which don''t reflect most recent source value defined here
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html

Please provide as much information as possible:

Sample Template 
```
  myappinsights: 
    Type: AWS::ApplicationInsights::Application
    Properties:
      ResourceGroupName: !Ref CreateResourceGroup
      CWEMonitorEnabled: true
      OpsCenterEnabled: true
      OpsItemSNSTopicArn: !Ref SNSTopic
      AutoConfigurationEnabled: true
      ComponentMonitoringSettings:
      - ComponentName: !Ref SqlFSxFCIName
        Tier: 'SQL_SERVER'
        ComponentConfigurationMode: DEFAULT_WITH_OVERWRITE
        DefaultOverwriteComponentConfiguration:
          SubComponentTypeConfigurations:
            - SubComponentType: 'AWS::EC2::Instance'
              SubComponentConfigurationDetails:
                Logs:
                  - LogGroupName: !Sub 'SQL_SERVER-${ResourceGrpName}'
                    LogType: 'SQL_SERVER'
                    LogPath: >-
                      C:\Program Files\Microsoft SQL
                      Server\MSSQL**.MSSQLSERVER\MSSQL\Log\ERRORLOG
```




Discussion:
Related to this issue.  We will have to fix our regex testing so that we aren't allowing these types into the spec.

https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-applicationinsights/pull/9

Resolving patch:
diff --git a/src/cfnlint/maintenance.py b/src/cfnlint/maintenance.py
--- a/src/cfnlint/maintenance.py
+++ b/src/cfnlint/maintenance.py
@@ -11,6 +11,7 @@
 import zipfile
 import re
 from io import BytesIO
+import warnings
 import jsonpatch
 try:
     from urllib.request import urlopen, Request
@@ -278,6 +279,7 @@ def resolve_refs(properties, schema):
 
     def get_object_details(names, properties, schema):
         results = {}
+        warnings.filterwarnings('error')
         for propname, propdetails in properties.items():
             subname, propdetails = resolve_refs(propdetails, schema)
             t = propdetails.get('type')


Test patch:
Repository: aws-cloudformation/cfn-lint

Issue:
Add <Comma... as a list type for E3002
*Issue #, if available:*
fix #2320

*Description of changes:*
- Add `<CommaDelimitedList>` as a parameter list type for rule E3002

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.



Discussion:

Resolving patch:
diff --git a/src/cfnlint/rules/resources/properties/Properties.py b/src/cfnlint/rules/resources/properties/Properties.py
--- a/src/cfnlint/rules/resources/properties/Properties.py
+++ b/src/cfnlint/rules/resources/properties/Properties.py
@@ -303,7 +303,7 @@ def propertycheck(self, text, proptype, parenttype, resourcename, path, root):
                                     if ref in parameternames:
                                         param_type = self.cfn.template['Parameters'][ref]['Type']
                                         if param_type:
-                                            if 'List<' not in param_type and '<List' not in param_type and not param_type == 'CommaDelimitedList':
+                                            if 'List<' not in param_type and '<List' not in param_type and '<CommaDelimitedList' not in param_type and not param_type == 'CommaDelimitedList':
                                                 message = 'Property {0} should be of type List or Parameter should ' \
                                                           'be a list for resource {1}'
                                                 matches.append(


Test patch:
Repository: aws-cloudformation/cfn-lint

Issue:
E0002 parsing I3013 on AWS::RDS::DBInstance if Engine is a Ref
### CloudFormation Lint Version

0.65.0

### What operating system are you using?

Ubuntu 22.04

### Describe the bug

A cfn-lint exception is raised when parsing I3013 rule.

The trigger seems to be the presence of a reference as a value of the "Engine" resource parameter.

![Screenshot from 2022-09-29 13-57-09](https://user-images.githubusercontent.com/1442700/193029918-32a6b143-06c4-4707-834b-b9ea0c262c74.png)
![Screenshot from 2022-09-29 13-58-10](https://user-images.githubusercontent.com/1442700/193029945-c8d06db4-4513-4389-89eb-70ea6f51296e.png)
![Screenshot from 2022-09-29 14-15-37](https://user-images.githubusercontent.com/1442700/193029965-83f97802-cc82-459a-ac09-d424430ccb4e.png)



### Expected behavior

No error should be present is `Engine: !Ref Something` is used.

### Reproduction template

```yaml
---
AWSTemplateFormatVersion: 2010-09-09

Parameters:

  Engine:
    Description: DB Engine
    Type: String
    AllowedValues:
      - aurora-mysql
      - aurora-postgresql


Resources:

  DbCluster:
    Type: AWS::RDS::DBCluster
    DeletionPolicy: Snapshot
    UpdateReplacePolicy: Retain
    Properties:
      DBClusterIdentifier: FooBar
      Engine: !Ref Engine
      StorageEncrypted: true
      ## XXX Other properties removed for brevity

  DbWriterInstance:
    Type: AWS::RDS::DBInstance
    DeletionPolicy: Snapshot
    UpdateReplacePolicy: Retain
    Properties:
      DBClusterIdentifier: !Ref DbCluster
      Engine: !Ref Engine  # XXX here a cfn-lint bug. Allowed parameter values are "aurora-postgresql" and "aurora-mysql"
      PubliclyAccessible: false
```


Discussion:

Resolving patch:
diff --git a/src/cfnlint/rules/resources/RetentionPeriodOnResourceTypesWithAutoExpiringContent.py b/src/cfnlint/rules/resources/RetentionPeriodOnResourceTypesWithAutoExpiringContent.py
--- a/src/cfnlint/rules/resources/RetentionPeriodOnResourceTypesWithAutoExpiringContent.py
+++ b/src/cfnlint/rules/resources/RetentionPeriodOnResourceTypesWithAutoExpiringContent.py
@@ -106,6 +106,8 @@ def match(self, cfn):
         return matches
 
     def _validate_property(self, value, regex) -> bool:
-        if regex.match(value):
-            return True
-        return False
+        if isinstance(value, str):
+            if regex.match(value):
+                return True
+            return False
+        return True


Test patch:
Repository: aws-cloudformation/cfn-lint

Issue:
E2532 does not support TimeoutSecondsPath and HeartbeatSecondsPath
*cfn-lint version: (`cfn-lint --version`)* 0.61.0

*Description of issue.*
I'm getting the E2532 when trying to use the `TimeoutSecondsPath` parameter in a `Task`.

It is mentioned that it is supported both at https://states-language.net/spec.html#statetypes and https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html

Example:

```
"run": {
  "Type": "Task",
  "Resource": "arn:aws:states:::ecs:runTask.sync",
  "Parameters": {
    "LaunchType": "FARGATE",
    "Cluster": "arn:aws:ecs:${AWS::Region}:${AWS::AccountId}:cluster/${BatchCluster}",
    "TaskDefinition.$": "$.taskDefinition"
  }
  "TimeoutSecondsPath": "$.timeout",
  "ResultPath": null,
  "Next": "done"
}
```

Error from the cfn-lint run:
```
E2532 State Machine Definition key (TimeoutSecondsPath) for State (run) of Type (Task) is not valid
```



Discussion:
Looks hardcoded in [`src/cfnlint/rules/resources/stepfunctions/StateMachine.py`](https://github.com/aws-cloudformation/cfn-lint/blob/main/src/cfnlint/rules/resources/stepfunctions/StateMachine.py), sadly couldn't find any official schemas, maybe we could pull an unofficial JSON schema out of something like @ChristopheBougere's https://github.com/ChristopheBougere/asl-validator

Resolving patch:
diff --git a/src/cfnlint/rules/resources/stepfunctions/StateMachine.py b/src/cfnlint/rules/resources/stepfunctions/StateMachine.py
--- a/src/cfnlint/rules/resources/stepfunctions/StateMachine.py
+++ b/src/cfnlint/rules/resources/stepfunctions/StateMachine.py
@@ -43,14 +43,18 @@ def _check_state_json(self, def_json, state_name, path):
         state_key_types = {
             "Pass": ["Result", "ResultPath", "Parameters"],
             "Task": [
+                "Credentials",
                 "Resource",
+                "Parameters",
                 "ResultPath",
                 "ResultSelector",
                 "Retry",
                 "Catch",
                 "TimeoutSeconds",
+                "TimeoutSecondsPath",
                 "Parameters",
                 "HeartbeatSeconds",
+                "HeartbeatSecondsPath",
             ],
             "Map": [
                 "MaxConcurrency",


Test patch:
Repository: aws-cloudformation/cfn-lint

Issue:
E0001: Error DisableExecuteApiEndpoint works only within 'DefinitionBody' property
### CloudFormation Lint Version

0.73.1

### What operating system are you using?

Ubuntu

### Describe the bug

I want to disable the execute api endpoint in my RestAPI using SAM. This works as expected in deployment by adding the ` DisableExecuteApiEndpoint: True` property on `Properties` for a `AWS::Serverless::Api` type (see reproduction template). 

However cfn-lint gives this error message running:

```
$ cfn-lint -t template.yaml

E0001 Error transforming template: Resource with id [ApiGatewayRestApi] is invalid. DisableExecuteApiEndpoint works only within 'DefinitionBody' property.
template2.yaml:1:1
```

### Expected behavior

No E0001 lint error when using DisableExecuteApiEndpoint on a SAM `AWS::Serverless::Api`

### Reproduction template

```yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:
  ApiGatewayRestApi:
    Type: AWS::Serverless::Api
    Properties:
      OpenApiVersion: "3.0.3"
      DisableExecuteApiEndpoint: True
      StageName: default
      EndpointConfiguration:
        Type: REGIONAL

  Function:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Runtime: nodejs16.x
      InlineCode: |
        exports.handler = async (event) => ++event;
      Events:
        Notify:
          Type: Api
          Properties:
            Method: POST
            Path: /
            RestApiId: !Ref ApiGatewayRestApi
```


Discussion:
This is coming from sam translator package.  I need to look into that package's logic to see if we need to alter the template to make it work correctly.
https://github.com/aws/serverless-application-model/blob/83306d38ff957152f7f274eef3b9b9abd873101f/samtranslator/model/api/api_generator.py#L322-L325

Resolving patch:
diff --git a/src/cfnlint/transform.py b/src/cfnlint/transform.py
--- a/src/cfnlint/transform.py
+++ b/src/cfnlint/transform.py
@@ -113,6 +113,7 @@ def _replace_local_codeuri(self):
                     "DefinitionBody" not in resource_dict
                     and "Auth" not in resource_dict
                     and "Cors" not in resource_dict
+                    and "DisableExecuteApiEndpoint" not in resource_dict
                 ):
                     Transform._update_to_s3_uri("DefinitionUri", resource_dict)
                 else:


Test patch:
Repository: aws-cloudformation/cfn-lint

Issue:
E3502 taking 20min+ to process
**cfn-lint 0.73.1**

Hello, 

We have a cfn template containing a very configurable AWS::IAM::ManagedPolicy resource. The way we can configure this is via a set of six parameters that allow us to choose which services we need permissions for.

cfn-lint is taking a very long time (up to 30 minutes) to analyse this. When running in debug mode, we can see this is due to rule E3502. 

- Is this because cfn-lint is trying every single combination of parameters to resolve this resource?
- We are thinking of skipping this rule for now, unless anyone can suggest a better solution?

Thank you!







Discussion:

Resolving patch:
diff --git a/src/cfnlint/conditions.py b/src/cfnlint/conditions.py
--- a/src/cfnlint/conditions.py
+++ b/src/cfnlint/conditions.py
@@ -86,12 +86,14 @@ class Condition:
     Not = None
     Equals = None
     Influenced_Equals = None
+    Name = None
 
     def __init__(self, template, name=None, sub_condition=None):
         self.And = []
         self.Or = []
         self.Not = []
         self.Influenced_Equals = {}
+        self.Name = name
         if name is not None:
             value = template.get("Conditions", {}).get(name, {})
             try:
@@ -106,6 +108,11 @@ def __init__(self, template, name=None, sub_condition=None):
                 LOGGER.debug("Error parsing condition: %s", name)
                 self.Equals = None
 
+    def __eq__(self, __o: object) -> bool:
+        if self.Name is None:
+            return False
+        return self.Name == __o.Name
+
     def test(self, scenarios):
         """Test a condition based on a scenario"""
         if self.And:
@@ -441,9 +448,10 @@ def multiply_equals(currents, s_hash, sets, parameter_values):
         if matched_conditions:
             scenarios = []
             for con_hash, sets in matched_equals.items():
-                scenarios = multiply_equals(
-                    scenarios, con_hash, sets, self.Parameters.get(con_hash)
-                )
+                if len(scenarios) < 20:
+                    scenarios = multiply_equals(
+                        scenarios, con_hash, sets, self.Parameters.get(con_hash)
+                    )
 
         for scenario in scenarios:
             r_condition = {}


Test patch:
Repository: aws-cloudformation/cfn-lint

Issue:
E3002 false positives with intrinsics returning complex types when referenced via select
### CloudFormation Lint Version

0.76.2

### What operating system are you using?

Fedora

### Describe the bug

When using intrinsic functions and !Select to retrieve complex (ie structured) data from custom resources for other resources E3002 incorrectly marks the intrinsic as invalid properties of the resource.

For example, given a custom resource which returns an AWS::Lambda::Function Code object:

```
"Code": {
  [
   "S3Bucket": "<name>",
   "S3Key": "<object-key>",
   "S3ObjectVersion": "<object-version>"
 ],
 [
   "S3Bucket": "<name 2>",
   "S3Key": "<object-key 2>",
   "S3ObjectVersion": "<object-version 2>"
 ]
} 
```

Then referencing this as the Code property for the Function resource via select eg

`Code: !Select [ 0, !GetAtt CustomResource.Output.Code ]`

cfn-lint raises an E3002 of the form:
E3002 Invalid Property Resources/Function/Properties/Code/Fn::Select

This is similar to https://github.com/aws-cloudformation/cfn-lint/issues/2537 which resolved a similar case.




### Expected behavior

E3002 should not be raised when referencing via !Select

### Reproduction template

```yaml
Parameters:
    RoleArn:
        Type: String
    FunctionArn:
        Type: String

Resources:

    GetCodeForLatestS3Object:
        Type: Custom::LambdaSource
        Properties:
            ServiceToken: !Ref FunctionArn
            S3Url: "s3://some-bucket/lambdazips/helper.zip"

    Helper:
        Type: 'AWS::Lambda::Function'
        Properties:
            Handler: 'helper.lambda_handler'
            Role: !Ref RoleArn
            Code: !Select [ 0, !GetAtt GetCodeForLatestS3Object.Code ]
```



Discussion:

Resolving patch:
diff --git a/src/cfnlint/decode/node.py b/src/cfnlint/decode/node.py
--- a/src/cfnlint/decode/node.py
+++ b/src/cfnlint/decode/node.py
@@ -96,7 +96,7 @@ def is_function_returning_object(self, mappings=None):
                                 if isinstance(p_v, dict):
                                     if len(p_v) == 1:
                                         for l_k in p_v.keys():
-                                            if l_k == "Fn::FindInMap":
+                                            if l_k in ["Fn::FindInMap", "Fn::GetAtt"]:
                                                 return True
 
             return False


Test patch:
Repository: aws-cloudformation/cfn-lint

Issue:
include_experimental does not work when set via metadata
### CloudFormation Lint Version

0.77.10

### What operating system are you using?

Ubuntu 22

### Describe the bug

The README.md file says that `include_experimental` can be enabled with the `-e` flag or via metadata: https://github.com/aws-cloudformation/cfn-lint/blob/v0.77.10/README.md#parameters

However, using metadata to enable `include_experimental` does not have the same behavior as `-e`:
```shell
$ yq -y .Metadata repro.yml 
cfn-lint:
  config:
    include_experimental: true

$ cfn-lint repro.yml
# no failures

$ cfn-lint -e repro.yml 
W3037 Invalid permission "ListObjects" for "s3" found in permissions
repro.yml:12:13
```

Thanks.

### Expected behavior

Expected output:
```
W3037 Invalid permission "ListObjects" for "s3" found in permissions
```


### Reproduction template

```yaml
Metadata:
  cfn-lint:
    config:
      include_experimental: true
Resources:
  BadPolicy:
    Type: AWS::IAM::ManagedPolicy
    Properties:
      PolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: Allow
            Action:
              - s3:ListObjects
            Resource:
              - 'arn:aws:s3:::bucket_name'
```


Discussion:

Resolving patch:
diff --git a/src/cfnlint/config.py b/src/cfnlint/config.py
--- a/src/cfnlint/config.py
+++ b/src/cfnlint/config.py
@@ -585,6 +585,9 @@ def set_template_args(self, template):
                         if config_name == "configure_rules":
                             if isinstance(config_value, dict):
                                 defaults["configure_rules"] = config_value
+                        if config_name == "include_experimental":
+                            if isinstance(config_value, bool):
+                                defaults["include_experimental"] = config_value
 
         self._template_args = defaults
 


Test patch: