python - 如何使用 Python boto3 检索 VPC ID 和子网 ID?
解决方案
正如 jordanm 提到的,您可以使用describe_stacks()
来获取该堆栈创建的所有资源
import boto3
def lambda_handler(event, context):
client = boto3.client('cloudformation')
response = client.describe_stacks(
StackName="eks-sample-vpc"
)
return print(response)
或者你可以使用describe_stack_resource()
response = client.describe_stack_resource(
StackName="eks-sample-vpc",
LogicalResourceId="Subnet01" #Logical ID in you template
)
推荐阅读
- powershell - 计算 csv 列中包含“男性”的行数
- sql-server - 如何从 EMI 金额和分期付款中找到支付的利息和本金金额
- android - 如何解决这个二进制 XML 文件第 8 行:Error inflating class android.support.v7.widget.CardView
- javascript - 如何使用 cookie 进行标准登录以保持用户登录?
- java - 如何使用 java 客户端驱动程序在 Arangodb 中使用 pregel 模块
- aws-fargate - aws ECS- Farget 任务提交等待时间
- ios - 如何使用 UIImageView resizableImage 添加阴影
- orientdb - Gephi中的无向图
- amazon-web-services - 如何在我的 Elastic Beanstalk CloudFormation 模板中添加监控
- python - 恢复使用 shuffle_batch 的张量流图永远挂起