2
votes

I tried to use the exact same example provided in the user guide mentioned below. It works from console but fails to create stack using client.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-namedquery.html

I got an error while trying to execute the following:

{
  "Resources": {
    "AthenaNamedQuery": {
      "Type": "AWS::Athena::NamedQuery",
      "Properties": {
        "Database": "swfnetadata",
        "Description": "A query that selects all aggregated data",
        "Name": "MostExpensiveWorkflow",
        "QueryString": "SELECT workflowname, AVG(activitytaskstarted) AS AverageWorkflow FROM swfmetadata WHERE year='17' AND GROUP BY workflowname ORDER BY AverageWorkflow DESC LIMIT 10"
      }
    }
  }
}

Is the "create-stack" parameter of cloudformation correct?

aws cloudformation create-stack --stack-name dnd --template-body file://final.json

Why am I getting a resource type error like this?

An error occurred (ValidationError) when calling the CreateStack operation: Template format error: Unrecognized resource types: [AWS::Athena::NamedQuery]
1
I would suggest check/update your CLI version. Either way do let know if that works - asr9
Were you able to create the named query using the command mentioned above @ASR ? - shantanuo
@ASR you can post your comment as answer if you are interested in bounty :) - shantanuo
Glad to know it worked. Though not really worth as an answer. Silly things happen. - asr9

1 Answers

2
votes

It worked when I updated my CLI version as suggested in the comment. This issue is now closed.