I'm a little stuck trying to combine two code functions that don't seem to be working.
the aws cloudformation cli tool seems to be having problems and throws an error: 'list' object has no attribute 'get'.
I'm trying to specify a lambda function (Type AWS::Serverless::Function), which otherwise works, but I want to specify the Event Schedule object as lower case (required for database).
Code in question, the last 8 lines are the issue:
Resources:
UpdatePartitionsLogTableFunction:
Type: AWS::Serverless::Function
Properties:
Handler: updatePartitionsTable.handler
Runtime: nodejs12.x
CodeUri: src
Description: Updates partitions Athena tables
MemorySize: 128
Timeout: 60
Policies:
- Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "athena:*"
Resource:
- "*"
- Effect: Allow
Action:
- "glue:*"
Resource:
- "*"
- Effect: Allow
Action:
- "s3:*"
Resource:
- "*"
Events:
Timer:
Type: Schedule
Properties:
Schedule: cron(0 * * * ? *)
Input:
'Fn::Transform':
- Name: 'String'
Parameters:
InputString: !Sub |
{"database": "${AWS::StackName}_logs",
"tableNames": "${PartitionedTables}"}
Operation: Lower
I get an error:
'list' object has no attribute 'get'
Simplified code:
Input: !Sub |
{"database": "${AWS::StackName}_logs",
"tableNames": "${PartitionedTables}"}
If I simplify the code, I get no error, but I need the lowercase for my usecase. Can anyone help? I'm kinda stuck.