Amazon web services CloudFront:从负载中标识的服务名称与传输标头中指定的服务名称不一致

Amazon web services CloudFront:从负载中标识的服务名称与传输标头中指定的服务名称不一致,amazon-web-services,amazon-cloudfront,Amazon Web Services,Amazon Cloudfront,我正在尝试创建一个自动CloudFront失效,如下所示: aws cloudfront create-invalidation --distribution-id=$DISTRIBUTION_ID --paths="/*" 但我总是犯这个错误 An error occurred (AccessDenied) when calling the CreateInvalidation operation: The service name : [ServiceName] ide

我正在尝试创建一个自动CloudFront失效,如下所示:

aws cloudfront create-invalidation --distribution-id=$DISTRIBUTION_ID --paths="/*"
但我总是犯这个错误

An error occurred (AccessDenied) when calling the CreateInvalidation operation: The service name : [ServiceName] identified from the payload does not agree with the service name: "UnknownService" specified in the transport header

您知道如何解决此问题吗?

一切似乎都是正确的,请先检查权限,然后尝试使单个文件无效

为了实现自动化,您可以参考以下内容来创建lambda函数,该函数在源S3放置事件时被触发以使文件无效