goformation
goformation copied to clipboard
Fix AWS::Serverless::{Function,StateMachine}.IAMPolicyDocument schemas
A Statement can have an object or an array of objects.
Got tired of VS Code telling me my Policy statements were malformed when in fact they were not. Tested a policy statement string and that did not work. Though I might have just forgotten some needed keys. Can't say for certain.
Hi @tmclaugh, can you please send me a concrete example of a statement that should work, but that isn't correctly validated by the schema?
Here is one:
Policies:
- Statement:
- Effect: Allow
Action:
- "dynamodb:PutItem"
- "dynamodb:GetItem"
- "dynamodb:UpdateItem"
- "dynamodb:UpdateItem"
Resource:
- !GetAtt DynamoDBTable.Arn
- Effect: Allow
Action:
- logs:CreateLogDelivery
- logs:GetLogDelivery
- logs:UpdateLogDelivery
- logs:DeleteLogDelivery
- logs:ListLogDeliveries
- logs:PutResourcePolicy
- logs:DescribeResourcePolicies
- logs:DescribeLogGroups
Resource: '*'
- Effect: Allow
Action:
- logs:CreateLogStream
- logs:DescribeLogStream
- logs:DescribeLogGroups
- logs:PutLogEvents
Resource:
- !GetAtt DdbOpsLogGroup.Arn
Unfortunately, this is not easy to fix (see my PR where testes are failing). I will need some extra time to think about how to integrate this PR.