From 63c229bf0ac509e70e70216bd7783aaef666d5a6 Mon Sep 17 00:00:00 2001 From: David Jackson Date: Tue, 14 Apr 2020 20:46:59 +0100 Subject: [PATCH] Fix CloudFront distribution to allow POST method - otherwise calls to metrics POST API from Azure will fail --- spf-api/serverless.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spf-api/serverless.yml b/spf-api/serverless.yml index 6fc3920..20fa40f 100644 --- a/spf-api/serverless.yml +++ b/spf-api/serverless.yml @@ -257,6 +257,15 @@ resources: MinimumProtocolVersion: TLSv1.2_2018 SslSupportMethod: sni-only DefaultCacheBehavior: + # must allow all methods in order to allow posts from Azure to SPF API via cloudfront distribution URL + AllowedMethods: + - DELETE + - GET + - HEAD + - OPTIONS + - PATCH + - POST + - PUT TargetOriginId: OriginSPFAPI${self:provider.stage} ViewerProtocolPolicy: 'redirect-to-https' DefaultTTL: 31536000