2

我們有一個CloudFormation腳本,它有四個嵌套堆棧。我試圖描述這些嵌套堆棧的資源。但是,當我的describe-stack-resources具有其中一個嵌套堆棧的物理ID時,它只返回「父」堆棧(資源只是嵌套堆棧)。此行爲在JavaScript SDK和AWS CLI中一致。描述嵌套CloudFormation堆棧資源的正確方法是什麼?

我正在做這個對嗎?這是一個錯誤?有沒有解決方法?

例AWS CLI請求:

(注:所要求的物理資源ID是第二即所返回)

aws cloudformation describe-stack-resources --physical-resource-id arn:aws:cloudformation:us-west-2:58701038XXXX:stack/pelorus-vk-DatabaseStack-W12E3SAXPG6K/b0197770-7519-11e6-9518-50aXXXXXca9a 
{ 
    "StackResources": [ 
     { 
      "StackId": "arn:aws:cloudformation:us-west-2:58701038XXXX:stack/pelorus-vk/f93b5960-7518-11e6-8939-XXXXX0f2ad1e", 
      "ResourceStatus": "UPDATE_COMPLETE", 
      "ResourceType": "AWS::CloudFormation::Stack", 
      "Timestamp": "2016-09-07T16:53:11.305Z", 
      "StackName": "pelorus-vk", 
      "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:58701038XXXX:stack/pelorus-vk-DashboardStack-1GDLBCAFE6U3F/fb9c53d0-7518-11e6-bd48-50dXXXXX84d2", 
      "LogicalResourceId": "DashboardStack" 
     }, 
     { 
      "StackId": "arn:aws:cloudformation:us-west-2:58701038XXXX:stack/pelorus-vk/f93b5960-7518-11e6-8939-XXXXX0f2ad1e", 
      "ResourceStatus": "CREATE_COMPLETE", 
      "ResourceType": "AWS::CloudFormation::Stack", 
      "Timestamp": "2016-09-07T16:53:04.667Z", 
      "StackName": "pelorus-vk", 
      "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:58701038XXXX:stack/pelorus-vk-DatabaseStack-W12E3SAXPG6K/b0197770-7519-11e6-9518-50aXXXXXca9a", 
      "LogicalResourceId": "DatabaseStack" 
     }, 
     { 
      "StackId": "arn:aws:cloudformation:us-west-2:58701038XXXX:stack/pelorus-vk/f93b5960-7518-11e6-8939-XXXXX0f2ad1e", 
      "ResourceStatus": "UPDATE_COMPLETE", 
      "ResourceType": "AWS::CloudFormation::Stack", 
      "Timestamp": "2016-09-07T16:53:13.293Z", 
      "StackName": "pelorus-vk", 
      "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:58701038XXXX:stack/pelorus-vk-EventProcessingStack-GB814FASNNV4/fb8f3470-7518-11e6-a2c5-503XXXXXadae", 
      "LogicalResourceId": "EventProcessingStack" 
     }, 
     { 
      "StackId": "arn:aws:cloudformation:us-west-2:587010381366:stack/pelorus-vk/f93b5960-7518-11e6-8939-XXXXX0f2ad1e", 
      "ResourceStatus": "UPDATE_COMPLETE", 
      "ResourceType": "AWS::CloudFormation::Stack", 
      "Timestamp": "2016-09-07T16:53:11.496Z", 
      "StackName": "pelorus-vk", 
      "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:587010381366:stack/pelorus-vk-StreamStack-NAA3DJMELCFG/04990c30-7519-11e6-934e-50aXXXXX12f2", 
      "LogicalResourceId": "StreamStack" 
     } 
    ] 
} 

回答

1

一個潛在的解決方法:在我所期望的行爲更換--physical-resource-id--stack-name結果,即使我提供了物理ID

相關問題