The following snippet is from a Cloudformation formation template:
...
LambdaFunctionAssociations:
- !If
- ProtectDistribution
-
- EventType: viewer-request
LambdaFunctionARN: !GetAtt LambdaEdgeProtection.Outputs.CheckAuthHandler
- EventType: origin-response
LambdaFunctionARN: !GetAtt LambdaEdgeProtection.Outputs.HttpHeadersHandler
- !Ref AWS::NoValue
...
It's a part of a DefaultCacheBehavior
within a DistributionConfig
of a CloudFront distribution. It's giving me this error when trying to create the stack:
Property validation failure: [Value of property {/DistributionConfig/DefaultCacheBehavior/LambdaFunctionAssociations/0} does not match type {Object}]
Where am I going wrong please?