Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got "E3002 Property TopicARN should be of type List or Parameter should be a list" error #2914

Closed
dengmingtong opened this issue Oct 18, 2023 · 7 comments

Comments

@dengmingtong
Copy link

CloudFormation Lint Version

0.82.0

What operating system are you using?

ubuntu, mac

Describe the bug

we run cfn-lint -t template.json, got below error:
command: cfn-lint -i W3005 W2001 -e -r ap-east-1 -t template.json

E3002 Property TopicARN should be of type List or Parameter should be a list for resource <Resource> Error: <template.json file>

The template works well for cfn-lint 0.81.0 version. But got above error when we use cfn-lint 0.82.0

And the error only happens for region ap-east-1, other regions are workable.

Please help to research and solve the issue.

Thanks
Mingtong

Expected behavior

No error throw

Reproduction template

{
  "Description": "(SO0219-ing) Clickstream Analytics on AWS - IngestionServer IngestionServerC0110 (Version v1.0.0)(Build ci-latest)",
  ...
    "IngestionServerclickstreamingestionserviceecsasgASGEA31740A": {
      "Type": "AWS::AutoScaling::AutoScalingGroup",
      "Properties": {
        "HealthCheckGracePeriod": 60,
        "HealthCheckType": "EC2",
        "LaunchConfigurationName": {
          "Ref": "IngestionServerclickstreamingestionserviceecsasgLaunchConfig0567326F"
        },
        "MaxSize": {
          "Ref": "referencetoingestionservers3stackServerMax47BAD102Ref"
        },
        "MinSize": {
          "Ref": "referencetoingestionservers3stackServerMin60E08693Ref"
        },
        "NotificationConfigurations": [
          {
            "NotificationTypes": [
              "autoscaling:EC2_INSTANCE_LAUNCH",
              "autoscaling:EC2_INSTANCE_LAUNCH_ERROR",
              "autoscaling:EC2_INSTANCE_TERMINATE",
              "autoscaling:EC2_INSTANCE_TERMINATE_ERROR"
            ],
            "TopicARN": {
              "Ref": "referencetoingestionservers3stackNotificationsTopicArn794929B9Ref"
            }
          }
        ],
        "Tags": [
          {
            "Key": "Name",
            "PropagateAtLaunch": true,
            "Value": "ingestion-server-s3-stack/IngestionServerC0110/IngestionServer/clickstream-ingestion-service-ecs-asg"
          }
        ],
        "VPCZoneIdentifier": {
          "Fn::Split": [
            ",",
            {
              "Ref": "referencetoingestionservers3stackPrivateSubnetIds7D504D70Ref"
            }
          ]
        }
      },
      "UpdatePolicy": {
        "AutoScalingScheduledAction": {
          "IgnoreUnmodifiedGroupSizeProperties": true
        }
      },
      "Metadata": {
        "aws:cdk:path": "ingestion-server-s3-stack/IngestionServerC0110/IngestionServer/clickstream-ingestion-service-ecs-asg/ASG"
      }
    },
    ...
}
@kddejong
Copy link
Contributor

Do you know what referencetoingestionservers3stackNotificationsTopicArn794929B9Ref refers to? A parameter correct and what is its type?

@kddejong
Copy link
Contributor

Looks like certain regions have TopicARN specified as:

"TopicARN": {
     "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-notificationconfiguration.html#cfn-autoscaling-autoscalinggroup-notificationconfiguration-topicarn",
     "DuplicatesAllowed": true,
     "PrimitiveItemType": "String",
     "Required": true,
     "Type": "List",
     "UpdateType": "Mutable"
    }

@kddejong
Copy link
Contributor

kddejong commented Oct 18, 2023

From the schema:

"TopicARN" : {
          "type" : [ "string", "array" ],
          "items" : {
            "type" : "string"
          }
        },

The array is being picked over the string when translating into the specs. Specs are used by v0 of cfn-lint and the schemas are used by v1. This error will naturally go away as we move to v1. The only other option I have for v0 at this point is to patch it a consistent value.

@kddejong
Copy link
Contributor

Fixed in this commit: 8ec403e

I'll have this released early next week.

@dengmingtong
Copy link
Author

Cannot find your commit in the main branch, when will it be released?

@kddejong
Copy link
Contributor

Should be there in https://github.com/aws-cloudformation/cfn-lint/releases/tag/v0.83.0

Let me know if you are still having issues.

@dengmingtong
Copy link
Author

there is still issue, but error is different as below:

cfn-lint 0.83.0
W3045 Consider using AWS::S3::BucketPolicy instead of AccessControl
Warning: templates/default/cloudfront-s3-control-plane-stack-cn.template.json:77:9

You can see full error log from PR in our repo.

https://github.com/awslabs/clickstream-analytics-on-aws/actions/runs/6668778118/job/18125577750?pr=374

Could you help to check it?

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants