【问题标题】:What is causing cfn-signal with waithandle.url to get 403 error是什么导致带有 waithandle.url 的 cfn-signal 出现 403 错误
【发布时间】:2020-05-08 08:12:43
【问题描述】:

美好的一天。

由于 WaitCondition 错误,我的 cloudformation 堆栈不断回滚。

EC2 实例具有调用自定义 bootstrap.sh 的用户数据,该自定义 bootstrap.sh 使用带有 waithandle.url 的 cfn-signal(将敏感信息替换为“屏蔽”):

cfn-signal --success true --http-proxy http://proxyAbc:123 --https-proxy http://proxyAbc:123  --region ap-southeast-2 https://cloudformation-waitcondition-ap-southeast-2.s3-ap-southeast-2.amazonaws.com/arn%3Aaws%3Acloudformation%3Aap-southeast-2%3A747462550105%3Astack/asg-masked-20200508162554-0b080289adf738030/35459000-90f5-11ea-a7af-0a0ad6464e74/WaitHandle?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20200508T062906Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86399&X-Amz-Credential=masked&X-Amz-Signature=masked

但是现在遇到这个错误:

Error signaling CloudFormation: [Errno 403] HTTP Error 403 : AccessDeniedAccess DeniedXYZ...123

没有代码更改除了使用新的 Centos 7 AMI

有没有人遇到这个错误并设法解决它?

编辑: 用户数据在 CloudFormation 模板中有这个(它周围有单引号),其中 WAITHANDLE 环境变量用于上面的 cfn-signal 命令(https://cloudformation-waitcondition-ap-southeast-2...。):

BASH_SCRIPT[8]=\"export WAITHANDLE='", {"Ref": "WaitHandle"}, "'\"\n

【问题讨论】:

  • waithandle url 很复杂。有时将其放在引号中,有助于在用户数据中调用时解决一些奇怪的问题。
  • @Marcin 感谢您的评论,但是是的,它用单引号括起来。

标签: amazon-web-services amazon-cloudformation amazon-ami


【解决方案1】:

这个问题原来是由于代理问题。 使用的代理之前(多年)工作,但现在已被破坏。 这可能不是一个普遍的答案,因为 403 似乎很广泛,但请注意它说 AccessDenied(没有“请求已过期”)的部分,无论如何只要回答这个问题,以防其他人遇到它。

例如:

预签名 URL 已过期:

Error signaling CloudFormation: [Errno 403] HTTP Error 403 : 
AccessDeniedRequest has expired863992020-05-15T05:17:56Z2020-05-18T20:41:19Z[somehashvalue]

代理问题:

Error signaling CloudFormation: [Errno 403] HTTP Error 403 : AccessDeniedAccess Denied[somehashvalue]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-26
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 2017-07-16
    • 1970-01-01
    • 2020-10-10
    • 2021-02-21
    相关资源
    最近更新 更多