【发布时间】:2014-11-19 03:47:00
【问题描述】:
我正在使用 OpsWorks 部署一堆应用程序,我想标记实例及其所有相关资源。我正在使用 opscode aws 食谱 (https://github.com/opscode-cookbooks/aws) 来标记我的实例,并且使用以下配方可以正常工作:
include_recipe 'aws'
custom_tags = node.fetch('aws_tag', {}).fetch('tags', nil)
instance_id = node.fetch('ec2', {}).fetch('instance_id', nil)
unless custom_tags.nil? || custom_tags.empty?
aws_resource_tag 'tag instance' do
tags custom_tags
resource_id instance_id
action :update
end
end
我想扩展此配方以标记附加到实例的 EBS 卷。 aws_resource_tag() 可以标记实例、快照和卷,但我需要为其提供要标记的卷列表。
如何获取附加到实例的卷 ID?
【问题讨论】:
标签: amazon-web-services chef-infra aws-opsworks