gpt4 book ai didi

amazon-web-services - 如何使用 AWS CLI 确定 AWS 资源属于哪个 CloudFormation 堆栈?

转载 作者:行者123 更新时间:2023-12-03 07:31:57 24 4
gpt4 key购买 nike

我有一个 EC2 实例,我想使用 AWS CLI 了解它属于哪个云形成堆栈。

要在 python 中使用 boto 来执行此操作,请参阅 How to determine what CloudFormation stack an AWS resource belongs to?

最佳答案

aws cloudformation describe-stack-resources --physical-resource-id i-xxxxxxxxxx

将 i-xxxxxxxxxx 替换为您的实例 ID 或任何其他常规物理资源 ID。

--physical-resource-id (string): The name or unique identifier that corresponds to a physical instance ID of a resource supported by AWS CloudFormation. For example, for an Amazon Elastic Compute Cloud (EC2) instance, PhysicalResourceId corresponds to the InstanceId . You can pass the EC2 InstanceId to DescribeStackResources to find which stack the instance belongs to and what other resources are part of the stack. Required: Conditional. If you do not specify PhysicalResourceId , you must specify StackName . Default: There is no default value.

引用:http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResources.html

关于amazon-web-services - 如何使用 AWS CLI 确定 AWS 资源属于哪个 CloudFormation 堆栈?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58724180/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com