Cfn-python-lint: AWS::Athena::WorkGroup.Tags should be list not object

Created on 9 Jun 2020  路  1Comment  路  Source: aws-cloudformation/cfn-python-lint

cfn-lint version: 0.33.0

Description of issue.
Using the actual example provided by AWS for the AWS::Athena::WorkGroup resource produces a linting error for the Tags property.

Error:

E3002 Expecting an object at Resources/MyAthenaWorkGroup/Properties/Tags
example.yml:9:7

Template:

AWSTemplateFormatVersion: "2010-09-09"
Resources:
  MyAthenaWorkGroup:
    Type: AWS::Athena::WorkGroup
    Properties:
      Name: MyCustomWorkGroup
      Description: My WorkGroup
      State: ENABLED
      Tags:
        - Key: "key1"
          Value: "value1"
        - Key: "key2"
          Value: "value2"
      WorkGroupConfiguration:
        BytesScannedCutoffPerQuery: 200000000
        EnforceWorkGroupConfiguration: false
        PublishCloudWatchMetricsEnabled: false
        RequesterPaysEnabled: true
        ResultConfiguration:
          OutputLocation: s3://path/to/my/bucket/

Docs: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-workgroup.html#aws-resource-athena-workgroup--examples

It looks like this is maybe an issue with the spec provided by AWS. Here's what they have for this resource.

"AWS::Athena::WorkGroup.Tags": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-tags.html",
      "Properties": {
        "Tags": {
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-tags.html#cfn-athena-workgroup-tags-tags",
          "UpdateType": "Mutable",
          "Required": false,
          "Type": "List",
          "ItemType": "Tag"
        }
      }
    },

In another area they have it defined like this

    "AWS::AppSync::GraphQLApi.Tags": {
      "Type": "List",
      "Required": false,
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-tags.html",
      "ItemType": "Tag",
      "UpdateType": "Mutable"
    },

I tested and when formatted like this, the linter reports no errors, but CloudFormation won't succeed.

      Tags:
        Tags:
          - Key: "key1"
            Value: "value1"
          - Key: "key2"
            Value: "value2"
spec bug

Most helpful comment

Hey,

I think this should be picked up sooner than 7 months later. Or raised appropriately upstream or whatever the process is.

This needs to be resolved one way or another. There are internal conflicts in the CF Docs and Specs across different areas when it comes to tags.

In this case Athena Workgroup docs are internally conflicting. With examples and other references generally pointing to tags being a list but then in one instance it points to tags as being the tags object.

I don't know what type of tagging will actually work.

Other related issues:
https://github.com/aws-cloudformation/cfn-python-lint/issues/1636

>All comments

Hey,

I think this should be picked up sooner than 7 months later. Or raised appropriately upstream or whatever the process is.

This needs to be resolved one way or another. There are internal conflicts in the CF Docs and Specs across different areas when it comes to tags.

In this case Athena Workgroup docs are internally conflicting. With examples and other references generally pointing to tags being a list but then in one instance it points to tags as being the tags object.

I don't know what type of tagging will actually work.

Other related issues:
https://github.com/aws-cloudformation/cfn-python-lint/issues/1636

Was this page helpful?
0 / 5 - 0 ratings